hi folks
i want to get device phone number through javascript for validating user.
i am sending sms to client when he click on url i need to perform some operation.
for that i want to get device phone number in smartphones
hi folks
i want to get device phone number through javascript for validating user.
i am sending sms to client when he click on url i need to perform some operation.
for that i want to get device phone number in smartphones
Ask them to enter in into a form - otherwise Ankit is right, it's a security / privacy issue. They might not want you to know their number.
If your javascript is part of a webpage and is displayed in Android browser than you are out of luck. It behaves the same way as javascript on other browsers - it can't access any underlying operating system functions.
On the other hand if your javascript is part of installable Android application (and executed in WebView) then javascript can call your custom Java function which provides this info. Of course your application will have to request the privilege to access personal info at install time and user will have to confirm this.