Android Question Phone Owner Info

luke2012

Well-Known Member
Licensed User
Longtime User
Hi to all,
based on this Erel tutorial (https://www.b4x.com/android/forum/threads/how-to-get-the-phone-owners-profile.38543/#post-458930) we can get the full data about the (phone) owner user profile.

The full data is like this:

sort_key: John Doe
photo_uri: null
send_to_voicemail: 0
contact_status: null
contact_status_label: null
pinned: 0
display_name: John Doe
phonebook_label_alt: C
phonebook_bucket: 12
contact_status_res_package: null
in_default_directory: 0
photo_id: null
custom_ringtone: null
_id: 9223372034707292161
times_contacted: 0
phonebook_label: L
display_name_alt: Doe, John
lookup: profile
phonetic_name: null
last_time_contacted: 0
contact_last_updated_timestamp: 1432226464723
has_phone_number: 0
in_visible_group: 0
contact_status_icon: null
name_raw_contact_id: 9223372034707292161

I can see the person full name but not the person account (GMAIL).
Is it possibile to known also the person account (ex. [email protected]) ?

In other words is it possible to read the full name and the account (gmail) about the first user that was added (phone owner) and used by Android for the first phone activation ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This code prints all Google accounts addresses:
B4X:
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim jo As JavaObject
jo = jo.InitializeStatic("android.accounts.AccountManager").RunMethod("get", Array(ctxt))
Dim accounts() As Object = jo.RunMethod("getAccountsByType", Array("com.google"))
For Each ac As JavaObject In accounts
   Log(ac.GetField("name"))
Next

Manifest editor:
B4X:
AddPermission(android.permission.GET_ACCOUNTS)
 
Upvote 0
Top