So I am making mobile game with unity engine, think to release to android target.
Now my game will have my own custom highscore board, there I think when user earn score
try this
AccountManager manager = AccountManager.get(context);
Account[] accounts = manager.getAccountsByType("com.google");
List<String> username = new LinkedList<String>();
for (Account account : accounts) {
username.add(account.name);
}
and add permission to android manifest
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
If you have a string asdf@gmail.com and you want everything before the @ you can use .split();
String email = asdf@gmail.com
String[] parts = email.split("@");
String nickname = parts[0];