Hi,
I would like to get the mobile number of the device on which my app is installed.
Now a mobile number can be stored in a sim card or it may be stored inside the mobile device.
Need help on :
i) detecting the number of sim cards in that device
ii) get the mobile numbers on the sim cards
iii) if it is the case that the number is stored inside the mobile device, get the mobile number from that mobile device.
In this regard I tried the post at:
This displays a BLANK for the Phone Number.
Then I tried the post at :
in which user Invocker responded
And made the foll. entry in the manifest :
AddPermission(android.permission.READ_PHONE_STATE)
However I am getting the error which is pasted in the code portion below...
Please note that I am reposting my request since I did not get the solution to my earlier request of 25th December,2022.
Please help.
Thanks.
I would like to get the mobile number of the device on which my app is installed.
Now a mobile number can be stored in a sim card or it may be stored inside the mobile device.
Need help on :
i) detecting the number of sim cards in that device
ii) get the mobile numbers on the sim cards
iii) if it is the case that the number is stored inside the mobile device, get the mobile number from that mobile device.
In this regard I tried the post at:
Phone Number of Device
I have a need to access the phone number of the Phone running my app. I have found so many, many references to Phone on the forum, but none that tell me what the phone number of the phone is Any ideas please
www.b4x.com
This displays a BLANK for the Phone Number.
Then I tried the post at :
How to get the mobile number in the mobile device/sim cards in that device on which my app is installed ?
Hi, I would like to get the mobile number of the device on which my app is installed. Now a mobile number can be stored in a sim card or it may be stored inside the mobile device. Need help on : i) detecting the number of sim cards in that device ii) get the mobile numbers on the sim...
www.b4x.com
in which user Invocker responded
And made the foll. entry in the manifest :
AddPermission(android.permission.READ_PHONE_STATE)
However I am getting the error which is pasted in the code portion below...
Please note that I am reposting my request since I did not get the solution to my earlier request of 25th December,2022.
Please help.
Thanks.
B4X:
Logger connected to: Xiaomi Redmi Note 7 Pro
--------- beginning of system
--------- beginning of main
Logger connected to: Xiaomi Redmi Note 7 Pro
--------- beginning of system
--------- beginning of main
--------- beginning of crash
java.lang.RuntimeException: Unable to create service b4a.example.starter: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4026)
at android.app.ActivityThread.access$1600(ActivityThread.java:227)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7592)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:164)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:94)
at b4a.example.starter.onCreate(starter.java:34)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4014)
... 8 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at anywheresoftware.b4a.shell.ShellConnector.sendControlMessage(ShellConnector.java:61)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:124)
... 12 more