Access user info

In our game user are able to create maps and submit it to the community where other gamers can play these maps. So we want to have some info about the user, like username, email, etc. since Ouya console has user account, is there a way to access that info? ideally with user permission of course, like how facebook connect would work? I didn't see anything like that in ODK doc, or Unity plugin either so any ideas are welcome.

Thx.

Answers

  • AyrikAyrik Posts: 429Member
    There isn't anything currently. I wish there was.
    Saga Heroes - Adventure RPG
    image image
  • StoicHamsterStoicHamster Posts: 113Member
    I'm fairly sure that you can't access e-mail, but I have successfully retrieved the Ouya username by using this code:

    AccountManager am = AccountManager.get(context);
    Account[] accts = am.getAccountsByType(OuyaAuthenticationHelper.OUYA_ACCOUNT_TYPE);

    in Java-land. You also have to remember to add this permission to your Android manifest:
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    I'm actually using Unity, so I then had to modify the Ouya Unity plugin to handle talking between C# and Java, but it works great and is definitely possible.
    Jarcas Studios - Check out our latest Ludum Dare game: The Vengeful Baby-Men

    Take some time and learn Designer-Friendly Programming 101.
  • ChapelChapel Posts: 10Member
    edited July 2013
    @StoicHamster...where did you do your research to arrive at the conclusion that this would work?  It sounds like a pretty good solution, but I'm just curious how you got there.

    Thanks!
    Post edited by Chapel on
  • StoicHamsterStoicHamster Posts: 113Member
    well, I knew about the AccountManager object from past Android dev work. It manages Google accounts, Facebook accounts, Twitter accounts, etc., and I suspected Ouya accounts would be handled in a similar way... but it was @Matt_Lang in another thread that clued me into the specific OUYA_ACCOUNT_TYPE constant that's necessary to get the Ouya account.
    Jarcas Studios - Check out our latest Ludum Dare game: The Vengeful Baby-Men

    Take some time and learn Designer-Friendly Programming 101.
  • ChapelChapel Posts: 10Member
    @StoicHamster...awesome...thanks.

    Ouya development is my first trip into Android development work...so these little tricks are good to learn.

    :)
  • WPGWPG SwedenPosts: 15Member
    I struggled to do a name-entry screen for the hiscore list until I saw this thread.
    Then  forgot to say thanks @StoicHamster !

Sign In or Register to comment.