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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With