Turn off telephone number detection on Android

1,413 views
Skip to first unread message

Alex Y

unread,
Jun 8, 2011, 4:52:42 PM6/8/11
to rhomobile
I'm having an issue with labels that contain numbers with more than
three digits being selectable and crashing my application on an
Android. I believe it is because of the phone number detection
similar to what is described in an old iPhone related question (http://
groups.google.com/group/rhomobile/browse_thread/thread/
b06714603c5cab64/2abe67bf476415e6?lnk=gst). My question is, does the
Android have a similar option that I could turn off or is this
actually just the Android OS doing it?

Thanks,
~Alex

Alex Y

unread,
Jun 8, 2011, 4:54:21 PM6/8/11
to rhomobile
Here is a shortened version of that link. I keep forgetting about the
wrapping here.

http://bit.ly/kTaxkh

~Alex

evgeny vovchenko

unread,
Jun 9, 2011, 3:15:16 AM6/9/11
to rhom...@googlegroups.com
https://www.pivotaltracker.com/story/show/14357783

If you find way how to do it, let us know

Thanks,
~Alex

--
You received this message because you are subscribed to the Google Groups
"rhomobile" group.
To post to this group, send email to rhom...@googlegroups.com.
To unsubscribe from this group, send email to
rhomobile+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rhomobile?hl=en.

Alex Y

unread,
Jun 9, 2011, 8:17:15 AM6/9/11
to rhomobile
So this is something the Android OS is doing on it's own?

~Alex

On Jun 9, 3:15 am, "evgeny vovchenko" <evgenyvovche...@gmail.com>
wrote:

evgeny vovchenko

unread,
Jun 10, 2011, 4:09:20 AM6/10/11
to rhom...@googlegroups.com
yes

Alex Y

unread,
Jun 10, 2011, 11:21:03 AM6/10/11
to rhomobile
Alright, I did some digging in the Rhodes code and found out that this
is actually happening because of Rhodes, not just the Android OS.

What's happening is that the WebViewClient created by Rhodes in the
RhodesActivity.java file (on line 337) is overriding the
shouldOverrideUrlLoading method with a call to
RhodesService.handleUrlLoading method (line 204 of
RhodesService.java). This is iterating through custom UriHandlers
which are initialized in RhodesService.java (line 398). One of these
Custom uri handlers is TelUriHandler. This handler (defined in
TelUriHandler.java) correctly attempts to send an Intent to the
dialer, however I don't think the correct permissions are being set to
invoke the Dialer (thus the apparent crashing of the application).
According to Android SDK documentation (http://bit.ly/rU740) the
manifest must contain the following permission: <uses-permission
id="android.permission.CALL_PHONE" />

I looked at the AndroidManifest.xml and AndroidManifest.full.xml, the
full manifest has this permissions however I do not know what Rhodes
is using to determine which Manifest file to use. There is a command
provided by the Android SDK to view the permissions of a built APK
file. Running this command from a command prompt on either a debug or
production APK file gives me only the following permissions:

package: com.rhomobile.androidtest
uses-permission: android.permission.ACCESS_NETWORK_STATE
uses-permission: android.permission.INTERNET
uses-permission: android.permission.PERSISTENT_ACTIVITY
uses-permission: android.permission.WAKE_LOCK

The command can be found in the platform-tools folder of the Android
SDK. The syntax to use is this: aapt d permissions <path to APK file>

In summary, I can work around the issue I am facing by commenting out
adding the custom TelUriHandler to the handler list. But if you want
to actually have the Dialer open so that people can make a phone call,
permissions are going to have to be set.

~Alex
==============================================================

Here's the full paths to the files mentioned above.
\platform\android\Rhodes\src\com\rhomobile\rhodes\RhodesActivity.java
\platform\android\Rhodes\src\com\rhomobile\rhodes\RhodesService.java
\platform\android\Rhodes\src\com\rhomobile\rhodes\uri
\TelUriHandler.java
\platform\android\Rhodes\AndroidManifest.xml
\platform\android\Rhodes\AndroidManifest.full.xml

On Jun 10, 4:09 am, "evgeny vovchenko" <evgenyvovche...@gmail.com>

Alexey Tikhvinsky

unread,
Jun 10, 2011, 12:59:30 PM6/10/11
to rhom...@googlegroups.com
AndroidManifest.xml nor AndroidManifest.full.xml are not final manifests. The real manifest is created by rake script.

To have phone ralated permissions you need to add the next to your build.yml

capabilities:
- phone

Look for an additional information about capabilities and configuration:
http://docs.rhomobile.com/rhodes/device-caps

-alexey

Alexey Tikhvinsky

unread,
Jun 10, 2011, 1:27:09 PM6/10/11
to rhom...@googlegroups.com
Ok, I now got the message.

I've made a ticket, you can track progress with this link:
https://www.pivotaltracker.com/story/show/14434847

Thanks fo finding this.
Reply all
Reply to author
Forward
0 new messages