wmardian Member Licensed User Longtime User Sep 28, 2014 #1 Dear All, I already try searching in this forum, and all solution told me to use phoneId to get the phone number. But it seem i can not use this solution.. maybe there is something wrong with my code.. Code: Copy Sub Button1_Click Dim ph As PhoneId Dim phoneNumber As String phoneNumber = ph.GetLine1Number Label1.Text = phoneNumber Please find attached picture.. from my debug that show the value is just empty. Your help will be very appreciated. Thanks and Regards
Dear All, I already try searching in this forum, and all solution told me to use phoneId to get the phone number. But it seem i can not use this solution.. maybe there is something wrong with my code.. Code: Copy Sub Button1_Click Dim ph As PhoneId Dim phoneNumber As String phoneNumber = ph.GetLine1Number Label1.Text = phoneNumber Please find attached picture.. from my debug that show the value is just empty. Your help will be very appreciated. Thanks and Regards
mangojack Expert Licensed User Longtime User Sep 28, 2014 #2 have you added the following permission to you manifest file ? android.permission.READ_PHONE_STATE Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 28, 2014 #3 The permission should be added automatically unless the manifest file is set to be read-only. Upvote 0
wmardian Member Licensed User Longtime User Sep 28, 2014 #4 Thanks MangoJack.. Just add it soon after i got your advice...And.... Still No luck the value is still empty.. Rgds Upvote 0
Thanks MangoJack.. Just add it soon after i got your advice...And.... Still No luck the value is still empty.. Rgds
Erel B4X founder Staff member Licensed User Longtime User Sep 28, 2014 #5 Which device are you using? Upvote 0
wmardian Member Licensed User Longtime User Sep 28, 2014 #6 Dear Erel, I connect the IDE to my lenovo P780 with dual sim card. But i also found another thread in this forum and they also have the same problem.. Thanks and Regards Upvote 0
Dear Erel, I connect the IDE to my lenovo P780 with dual sim card. But i also found another thread in this forum and they also have the same problem.. Thanks and Regards
Erel B4X founder Staff member Licensed User Longtime User Sep 28, 2014 #7 GetLine1Number calls the native API to get the phone number. If the number is not available then it returns an empty string. It is impossible to say why the number is considered not available in this case. Upvote 0
GetLine1Number calls the native API to get the phone number. If the number is not available then it returns an empty string. It is impossible to say why the number is considered not available in this case.
wmardian Member Licensed User Longtime User Sep 28, 2014 #8 Dear Erel, Many thanks. Erel said: GetLine1Number calls the native API to get the phone number. If the number is not available then it returns an empty string. It is impossible to say why the number is considered not available in this case. Click to expand... Do you have any idea what i should do now? or is there another way to do this? my lenovo P780 loaded with kitkat... Thanks and regards Upvote 0
Dear Erel, Many thanks. Erel said: GetLine1Number calls the native API to get the phone number. If the number is not available then it returns an empty string. It is impossible to say why the number is considered not available in this case. Click to expand... Do you have any idea what i should do now? or is there another way to do this? my lenovo P780 loaded with kitkat... Thanks and regards
lemonisdead Well-Known Member Licensed User Longtime User Sep 28, 2014 #9 Hi, Could the phone number not been returned only because the SIM card does not know it ? Some operators won't write the phone number into the SIM card. Upvote 0
Hi, Could the phone number not been returned only because the SIM card does not know it ? Some operators won't write the phone number into the SIM card.
wmardian Member Licensed User Longtime User Sep 28, 2014 #10 Hi lemonisdead, if it is the case, then what should we do to get the number or the identity of the phone which always return valid value? Rgds Upvote 0
Hi lemonisdead, if it is the case, then what should we do to get the number or the identity of the phone which always return valid value? Rgds
DonManfred Expert Licensed User Longtime User Sep 28, 2014 #11 wmardian said: Hi lemonisdead, if it is the case, then what should we do to get the number or the identity of the phone which always return valid value? Rgds Click to expand... You dont need the telephone-number to identify a device... You can use the imei and/or SubscriberID... Upvote 0
wmardian said: Hi lemonisdead, if it is the case, then what should we do to get the number or the identity of the phone which always return valid value? Rgds Click to expand... You dont need the telephone-number to identify a device... You can use the imei and/or SubscriberID...
wmardian Member Licensed User Longtime User Sep 28, 2014 #12 Dear Don, thanks for the idea.. anyway, why do they keep trying to find how to find the phoneID if they can use imei? http://www.b4x.com/android/forum/th...unique-id-alternative-to-phoneid.14759/page-2 Thanks a lot.. Upvote 0
Dear Don, thanks for the idea.. anyway, why do they keep trying to find how to find the phoneID if they can use imei? http://www.b4x.com/android/forum/th...unique-id-alternative-to-phoneid.14759/page-2 Thanks a lot..
DonManfred Expert Licensed User Longtime User Sep 28, 2014 #13 wmardian said: Dear Don, thanks for the idea.. anyway, why do they keep trying to find how to find the phoneID if they can use imei? http://www.b4x.com/android/forum/th...unique-id-alternative-to-phoneid.14759/page-2 Thanks a lot.. Click to expand... a telephone-number is more worth. you cannot call the imei to send an offer-sms to this device for example.... Upvote 0
wmardian said: Dear Don, thanks for the idea.. anyway, why do they keep trying to find how to find the phoneID if they can use imei? http://www.b4x.com/android/forum/th...unique-id-alternative-to-phoneid.14759/page-2 Thanks a lot.. Click to expand... a telephone-number is more worth. you cannot call the imei to send an offer-sms to this device for example....
wmardian Member Licensed User Longtime User Sep 28, 2014 #14 Dear Don, We are still trying to find alternative to getDeviceID and getLine1Number because there are some device which do not return correct value using these method.. Rgds Upvote 0
Dear Don, We are still trying to find alternative to getDeviceID and getLine1Number because there are some device which do not return correct value using these method.. Rgds
lemonisdead Well-Known Member Licensed User Longtime User Sep 28, 2014 #15 Wmardian, have you tried GetSimSerialNumber ? This should work if there is one inserted Upvote 0
wmardian Member Licensed User Longtime User Sep 30, 2014 #16 Hi Lemonisdead, Thanks.. i will try to test it. Sorry for the late reply.. was busy for something else. Will back to you with the result.. Rgds Upvote 0
Hi Lemonisdead, Thanks.. i will try to test it. Sorry for the late reply.. was busy for something else. Will back to you with the result.. Rgds