Determination of the mail address of the device

Status
Not open for further replies.

Amalkotey

Active Member
Licensed User
Longtime User
Hallo,

gibt es eine Möglichkeit, die EMail-Adresse, welche im Device gespeichert ist, abzufragen? Vielen Dank für euere Hilfe im Voraus.

Mit freundlichen Grüssen

Amalkotey

-------------------------------------

Hello,

is there a way, the e - mail address which is stored in the device to query? Thank you for your help in advance.

best regards

Amalkotey
 

luke2012

Well-Known Member
Licensed User
Longtime User
Here is the code with reflection:
B4X:
   Dim r As Reflector
   r.Target = r.RunStaticMethod("android.accounts.AccountManager", "get", _
      Array As Object(r.GetContext), Array As String("android.content.Context"))
   Dim accounts() As Object
   accounts = r.RunMethod2("getAccountsByType","com.google", "java.lang.String")
   For i = 0 To accounts.Length - 1
      r.Target = accounts(i)
      Dim accountName As String
      accountName = r.GetField("name")
      Log(accountName)
   Next

So the first account listed by this code is the phone owner (first account user for Android activation) ?
 
Upvote 0
Status
Not open for further replies.
Top