Get Register Account in android

omidaghakhani1368

Well-Known Member
Licensed User
Hi to all.
A few minutes ago I created a library that provides a list of user accounts Android.
options account is GOOGLE account and ALL regsiter account in android
example :
Dim k As RegisterAccount
Log(k.GetRegisterAccount("ALL"))
Or
Log(k.GetRegisterAccount("GOOGLE"))

Download Library from Here
Erel i cannot attahment library because you limit upload size,please increase it
GoodLuck special Erel
 
Last edited:

daemon

Active Member
Licensed User
I found this simple code somewhere in forum:
B4X:
Sub GetUserAccounts As List
    Dim r As Reflector
    Dim accounts() As Object
    Dim l As List
    l.Initialize
    r.Target = r.RunStaticMethod("android.accounts.AccountManager", "get", _
        Array As Object(r.GetContext), Array As String("android.content.Context"))
    accounts = r.RunMethod2("getAccountsByType", "com.google", "java.lang.String")
    For i = 0 To accounts.Length - 1
        r.Target = accounts(i)
        l.Add(r.GetField("name"))
    Next
    Return l
End Sub
 

omidaghakhani1368

Well-Known Member
Licensed User
I found this simple code somewhere in forum:
B4X:
Sub GetUserAccounts As List
    Dim r As Reflector
    Dim accounts() As Object
    Dim l As List
    l.Initialize
    r.Target = r.RunStaticMethod("android.accounts.AccountManager", "get", _
        Array As Object(r.GetContext), Array As String("android.content.Context"))
    accounts = r.RunMethod2("getAccountsByType", "com.google", "java.lang.String")
    For i = 0 To accounts.Length - 1
        r.Target = accounts(i)
        l.Add(r.GetField("name"))
    Next
    Return l
End Sub
Oh my God,it's better than my library thanks.
 
Top