I want my android application to take automatically owner name from deice. So, how I get the owner information (like owner name) from android device.
Asked
Active
Viewed 1,578 times
0
-
do you need device information like name, model, android version and else? – karimkhan Aug 07 '16 at 15:40
-
No, i want device owner name. – Prathap Badavath Aug 07 '16 at 15:43
2 Answers
0
This code will help you get the owner name stored in the device
Cursor c = getApplication().getContentResolver().query(ContactsContract.Profile.CONTENT_URI, null, null, null, null);
c.moveToFirst();
textView.setText(c.getString(c.getColumnIndex("display_name")));
c.close();
make sure to add this permission to your manifest:
<uses-permission android:name="android.permission.READ_PROFILE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>

karimkhan
- 321
- 3
- 18
-
then use this [link](http://stackoverflow.com/questions/6222384/possible-to-get-owner-contact-info-in-android) – karimkhan Aug 08 '16 at 11:24
0
Please refer this link for accessing the device related information
https://developer.android.com/reference/android/os/Build.html
if you want to get the playstore user account information you have to use the firebase play service api to get the account information
Please refer this link for more reference https://firebase.google.com/docs/auth/android/manage-users

Vijayaramanan
- 80
- 2