Android Question How to detect the phone number using B4A

walterf25

Expert
Licensed User
Hi,
Is there a way to capture the phone number of the device running the
You can use the Phone Library, I believe there is a property that will return the phone number, "GetLine1Number" i believe.

Regards,
Walter
 

Fayez Boulos

Member
Licensed User
Sorry Walter, It may be a shallow question, is there an example on how to use the phone library... what objects and methods it exposes?. Thanks
 

walterf25

Expert
Licensed User
Sorry Walter, It may be a shallow question, is there an example on how to use the phone library... what objects and methods it exposes?. Thanks
I'm sure there are tons of examples if you do a search for Phone library, I think this will work!
B4X:
Dim pID as PhoneID
Dim phonenumber as String
phonenumber = pID.GetLine1Number
Log("My Phone Number is: " & phonenumber)
Didn't test it as i'm on my mac right now.

Walter
 
Top