Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
Can we get account information about our app's users?
Nitish Govekar
Greenhorn
Posts: 25
I like...
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am trying to get user information of those who have downloaded my app but I am unable to retrieve any ot them ...
public class MainActivity extends Activity{ String User_EmailId = getEmiailID(MainActivity.this); private String getEmiailID(Context context) { AccountManager accountManager = AccountManager.get(context); Account account = getAccount(accountManager); if (account == null) { return null; } else { return account.name; } } private static Account getAccount(AccountManager accountManager) { Account[] accounts = accountManager.getAccountsByType("com.google"); Account account; if (accounts.length > 0) { account = accounts[0]; } else { account = null; } return account; } }
Tim Moores
Saloon Keeper
Posts: 7585
176
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The code looks broadly correct. What does "unable to" mean? What happens if you run the code? Which permissions did you give the app?
Nitish Govekar
Greenhorn
Posts: 25
I like...
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
I am not able to retireve information
Tim Moores
Saloon Keeper
Posts: 7585
176
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am not able to retireve information
Again, what does that mean? What is or is not happening when the code runs? What are the values of the involved variables?
Dave Tolls
Rancher
Posts: 4801
50
posted 7 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
And to get that information I would suggest adding in logging statements for debugging purposes.
That way you can know which methods are actually being called, and with what values.
At the moment you are flying blind.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Creating a custom listview with data from databas
check latest versioncode
Android WebView not loading second page from cache
how do i pass text from one android activity to the other
android program that connects to internet doesn't work
More...