I am developing an app and in the manifest I have:
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
When I click on the button to execute this code:
Intent intentcall = new Intent();
intentcall.setAction(Intent.ACTION_CALL);
intentcall.setData(Uri.parse("tel:" + phonenumber)); // set the Uri
startActivity(intentcall);
It will run fine on phones, and on tablets it pops up with a display where you can view or add the number to contacts. However, if I keep the permission in the manifest, it isn't available for tablets in the market. How can I keep the code behavior and still have it display in the market for tablets as well as phones?
In the AndroidManifest you need:
The
CALL_PHONE
permission implies telephony is required, but if you specify that is not you won't be filtered.From google docs:
usage is only for google play
Instead of adding a user with the
ACTION_CALL
identifier, change it to ACTION_INSERT_OR_EDIT.You'll need these permissions too, instead of the
CALL_PHONE
permission:Take a look at this related question:
can't find app on market
Try to use Intent.ACTION_DIAL instead Intent.ACTION_CALL.
For example:
And in this case you can completely remove these tags from AndroidManifest.xml:
Regarding "uses-feature" and it crashing - are you checking that telephony is available before actually making the call? It might be you need to do that extra step for the case when the app is on tablets. All you are saying in the manifest is that the feature is not required. It probably relies on you to actually implement the logic around that.