Search code examples
androidgoogle-signinuser-dataandroid-account

Getting user's name in Android


I would like to get the user's name in my app so that it can provide a personalized message during it's first run like,

Hey %user's name,

..

Since the app will be paid and primarily available on Google Play Store, i would have all the information about the user as in their synced gmail account. But how do i go about writing code for it?


Solution

  • As suggested by cricket_007, Google Sign-In API provides the user's display name.

    enter image description here