How to prompt user to enter a valid mobile phone number? - java

I am currently developing an Android anti-theft application and I am new in Android development. My apps is able to remotely lock the lost phone, so during configuration, user needs to enter a valid phone number, but how I determine whether the phone number entered is valid? Thanks

-Option one : read(get) the phone number from the sim card (if available, not all operators enable this)
-Option two : If sim card changed(sim serial number) lock the phone and send sms to an other phone number (since the thief will throw away the sim card )
-Option three : use what WHatApp android application uses to identify a person (sending an sms to a specified phone number and detect the incoming sms)
Option 3 seems a bit complicated since you will need a sever side with an sms gateway.
Well here's what comes to my mind .Good luck.

If you connect a data base so, compare to the phone number with to enter a phone number in field. I hope help you. :)

I did a project for a client where a same scenario was raised. Here is what we came to conclusion.
Send an SMS to the Number input and ask the number to send an sms code in reply.
eg. CONFIRM
If the number is valid and known to the user he will call them up
and ask them to SMS back.
If the number is valid and in use the message will get deliverd.
The client agreed the above scenario. Unless you have a really big Database of working numbers (updated so often), it will be a bypass solution.

I believe it is impossible to verify whether a phone number exists unless you call it. You could create a procedure where the app would call the entered phone number, and timed its connection. If the connections last longer than X amount of seconds, it is a valid phone number.

Related

Alternative method of getting Sim number if getLine1Number() returns null

I have written an app which sends a message to a number if the sim card of the phone is changed in other words if the phone number of the phone is changed. The code is working fine on android emulator but when I run this app on my phone, getLine1Number() of TelephonyManager class is returning null string.
Is there any other way to check if the sim card of the phone is changed?
Regards
You can use getSimOperatorName() concat to getSimSerialNumber() or getSimSerialNumber() only as phone number alternative.
Is more ease to detect sim changes in this way.

Detect input from another phone?

I am creating an app and would like to add a feature. What I want to do is be able to detect some sort of input code from another phone. For example, if phone A has my app and is talking to someone on phone B, if the person on phone B inputs a predetermined code, the app on phone A will do something.
Phone B ---> input code ---> app on phone A takes action
The app on phone A will be running in the background when it receives the input.
If this is not possible, then I have already found ways to do this with a text message using a BroadcastReceiver.
Here is a DTMF recognizer: http://code.google.com/p/dtmf-decoder/
No idea how ripe the project is. But it may be a source of inspiration for you :).

How can i get both sender and receivers mobile number in Android

I tried finding current mobile no of my app user but in my country the mobile no is not present in SIM so the current API returns null.
As a work around i thought i would just access the outbox of the user to get both senders and receivers no but unfortunately i am getting only receivers no.
Say for example I am user X and I send an SMS to user Y, through telephony API i am only able to get phone no of user Y to whom i am sending the SMS but not of user X.
Can any one suggest any other way i can access the current mobile no of any user??
Thanks
Pranay
Do you think this is what you are looking for? TelephonyManager::getLine1Number
(please, notice you are going to need the "android.permission.READ_PHONE_STATE" permission set in your app manifest.)

How to automate a text message?

I have a group that needs to send out announcements and current events via phone text message. I want to have a central phone number that when it receives a text message, it rebroadcasts that message to a growing list of subscribers. I'm hoping to use a Google Voice number to avoid buying an actual phone number.
Any ideas? I've thought about some type of Java/HTMLunit that continually parses the GVoice html inbox, but I just have that computer-gut feeling that there is a more intuitive way. I haven't been able to find a GVoice API, as I imagine that would be the trick.
Thanks
I've used a different approach. There's a number of E-mail to SMS services out there. So you send an e-mail (using standard JavaMail) to a specific address that is then associated with mobile phone numbers. I use TextMagic, but there are also other similar services out there. They also have API support, if thats what you'd prefer.

How to make a Skype Out call using asterisks?

I've been working on an asterisk-java application and so far I've been able to figure out how to call from one phone to another phone and also one phone to another computer. Now I want it so that I can use my phone to dial a number and if a preceding number is some special character, that number will be dialed through the skype server and call that number using Skype. Of course I will pay for all fees that apply and such.
For example:
If I dial a number such as #1234567888, the # will mean I would want to do a skype out call so the dial string 1234567888 will be called using skype's server.
Is this possible? Any hints or tips would be much appreciated!
Thank you for any help in advance!!
I use "Skype for Asterisk" by Digium (commercial).
When I want to call some skype user I use his/her id with Skype/ prefix, so you can replace # into this prefix and dial such id.
On Asterisk wiki there is list of Asterisk gateways including free/opensource: Skype Gateways, but I haven't tried it.
Skype for Asterisk will no longer be available after July 26th
I've tried a lot, and finally had luck with freeswitch + skypopen (ex skypiax)
http://wiki.freeswitch.org/wiki/Mod_skypopen_Skype_Endpoint_and_Trunk#What_is_Skypopen
( not trivial to implement )

Categories

Resources