Get device phone number (Manual process)

fbritop

Active Member
Licensed User
Longtime User
Hi Erel,
I found just imposible to trust on the phoneId library to get the device phone number, as now a days, most of the phones are being portrated from telco to telco.

I have an application, which in order to gain secure access to the server, needs to register the IMEI, IMSI and device number.

For the first two variables, we can get them straight in Android (iOS and WPhone are a pain and restricted).

Regarding the phone, we made the user to enter his own phone number, in order to have the application, to dispatch an SMS with a "X_AUTH" string together with the IMSI and IMEI values codified with and SHA Key. On the other end, the application starts a service for SMS Interept, reading the next messages withing a 30 second threshold, if the message contains the exact parameters, then we have a positive match for the device number and we can go on with registration on the server.

This has worked well for a Samsung S2, S1 and ACE. I cannot yet seem to understand why:

RAZR: Wont send the SMS
S4: Wont intercept de SMS

Have you got any chances to test this devices with the libraries?

Thanks in advance
Felipe Brito.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The APIs used to send and intercept messages are the standard Android APIs.

RAZR: Wont send the SMS
Have you checked the logs including the unfiltered logs for any message?

S4: Wont intercept de SMS
How are you intercepting the message? Was the message intercepted by the default application?
 
Upvote 0

fbritop

Active Member
Licensed User
Longtime User
Erel,

Have you checked the logs including the unfiltered logs for any message?

No I could not have a chance, as I just tested the APK over the weekend with a friends device

How are you intercepting the message? Was the message intercepted by the default application?

Once the message is sent out, the smsCapture service is started, waiting for either 30 seconds, or to the message arrival. The message arrives, but the Interceptor is not catching the SMS, it is already with priority 999.

Thanks
FBP
 
Upvote 0

fbritop

Active Member
Licensed User
Longtime User
I see.
In that case, suppose we have an application (not mine) that has it's priority to 2147483647, and I have mine in 999.

There is an incoming SMS, the other app intercepts the message and decides not to do nothing with him, does my application intercepts the SMS in second place, or after it was intercepted by the other application, no further intercept can be done?

Thanks
FBP
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can set your priority to this value as well.

the other app intercepts the message and decides not to do nothing with him, does my application intercepts the SMS in second place
Your application will receive the message in that case. However it is likely that the other app has aborted the intent.
 
Upvote 0
Top