Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.permission.CALL_PHONE for tablets

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?

like image 924
mouser58907 Avatar asked Oct 24 '11 23:10

mouser58907


People also ask

What is Call_phone permission?

Permission CALL_PHONE belong to dangerous permission group. So if your apps target SDK is 23 or higher and your device is running on Android 6.0 or higher, you must request for CALL_PHONE permission while the app is running. Example : String number = ("tel:" + numTxt.

How do I set custom permissions on Android?

You can use the sharedUserId attribute in the AndroidManifest. xml 's manifest tag of each package to have them assigned the same user ID. By doing this, for purposes of security the two packages are then treated as being the same app, with the same user ID and file permissions.

What is Android manifest permission?

The Android manifest file helps to declare the permissions that an app must have to access data from other apps. The Android manifest file also specifies the app's package name that helps the Android SDK while building the app.


1 Answers

In the AndroidManifest you need:

<uses-feature android:name="android.hardware.telephony" android:required="false" /> 

The CALL_PHONE permission implies telephony is required, but if you specify that is not you won't be filtered.

like image 191
Kevin TeslaCoil Avatar answered Sep 22 '22 21:09

Kevin TeslaCoil