I have been reading many questions on stackoverflow and I can't quite figure this problem out. I have an app that has a call feature but I still want tablets to access it. The app works on tablets if I manually install it via USB but it will not show up on the market place. I know that there are other questions regarding this issue but I am also asking if there are any other permissions I have that will not work on tablets.
Here is my manifest..
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" android:required="false"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<!-- End of copy. -->
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
I originally just had <uses-permission android:name="android.permission.CALL_PHONE"/>
But I recently added..
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
Will this solve the problem of the tablet not being able to make calls and have it listed on the tablet marketplace?
Also, are there any other permissions that I have listed that I need to add android:required="false" to?
Also, this is how I am calling in the code...
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + markPhone));
startActivity(callIntent);
Change your code to call using ACTION_DIAL not ACTION_CALL:
try {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber));
startActivity( intent );
} catch ( Exception e ) {
// no dialer activity found...
}
then you can completely remove these:
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
from your Manifest, as your app is no longer need them.
Related
I have the following permissions explicitly requested in my manifest.
I would like to optimize store visibility by switching as many as possible of them to implicit 'uses-feature' declarations. I will also handle this additionally in code checking for features before I access them.
Internet access is the only thing that's truly required for my app, other features I can enable/disable conditionally based on hasFeatures().
Question:
Which of these permissions can I change?
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="com.android.vending.BILLING" />
<permission android:name="com.appName.supportmapfragment.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.appName.supportmapfragment.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
Set required to 'false' if your app doesn't require something to run:
To control filtering, always explicitly declare hardware features in
elements, rather than relying on Google Play to
"discover" the requirements in elements. Then, if
you want to disable filtering for a particular feature, you can add a
android:required="false" attribute to the declaration.
http://developer.android.com/guide/topics/manifest/uses-permission-element.html (in the right-hand sidebar)
The documentation has this example:
<uses-feature android:name="android.hardware.camera" android:required="false" />
I have made a simple app,In that i want to make a phone call on click of a text view,But I am getting an exception that "No activity found that can do this action"..I have tried a lot and gives all permission to manifest,But still having the same error".
main.java
Intent dialer = new Intent(Intent.ACTION_CALL,
Uri.parse("9033309332"));
startActivity(dialer);
manifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
Try to use this code.
Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:9033309332"));
startActivity(callIntent);
I also had the same problem. Most probably it may be because our device grant the permission to that app then it may work. Just go to settings and grant the permission.
I have an android application which has a provision to controls calls ie, allow or block specific incoming & outgoing phone calls.Here is part of manifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xxxx.xxxxxx.xxxxxxx"
android:installLocation="internalOnly"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:name="android.hardware.location"
android:required="false" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application>
</activities>
</services>
<receiver android:name="xxxx.xxxx.ReceiverOutGoingCall" >
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
<receiver android:name="xxxx.xxxx.ReceiverIncomingCall" >
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
</application>
</manifest>
This application does not show for some devices in Google play.After a long time search I understood that it is due to <uses-feature> hardware requirements. No i want to remove the required hardware features for phone calls from manifest and check them from code.
Some tablets which does not have a Phone Call functionality does not show my application.So i want to make my application available to these tablets which lacks the required hardware.How can i achieve this?
Thanks in Advance
Some permissions automatically impy feature requirements.
This is what the API Guides says:
"For any of the permissions below, you can disable filtering based on the implied feature by explicitly declaring the implied feature explicitly, in a element, with an android:required="false" attribute."
Your permissions impliy the features android.hardware.wifi, android.hardware.location.network, android.hardware.location.gps, android.hardware.location and android.hardware.telephony.
You set only two of them to android:required="false". So you might try to set the other permissions to not required, too.
Unfortunately, there isn't a way to add permissions after the application is installed. Perhaps you can release 2 APKs. One for mobile devices and one for tablets.
Try this code to check if phone functionality is available :
public static boolean isTablet(Context context) {
TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
return manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE;
}
I know this has been asked a few times but why is my app not compatible with the Nexus 7 and Acer Iconia a210?
I didn't find a working solution in the existing questions so what else could I be missing?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mw88.witness.lite"
android:versionCode="5"
android:versionName="2.0">
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15"
/>
...
<supports-screens android:resizeable="true" />
<uses-permission android:name="android.permission.CAMERA" android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
The problem may be with the <supports-screen> tag in the Manifest.
Read the descriptions for the attributes in tag here especially the screen supporting attributes. For those attributes like android:smallscreens,android:normalscreens the default value is true as expected.
But for attributes like android:largescreens and android:xlargescreens, the default values varies.
The default value for this actually varies between some versions, so
it's better if you explicitly declare this attribute at all times.
As your specified devices are tablets having large screens, stating <support-screen> tag may trigger in as not compatible for your app in these devices.
So either you give all the necessary attribues or remove the <support-screens> tag. It is not a required field to be given.
Note:
If you are giving <support-screen> tag, remove the
android:resizable attribute. Its deprecated.
Remove the android:required="false" from <uses-permission>. It'll
not work.
I'm new developer on android. What I needed in purpose to use com.android.internal.telephony? Downloading ? Special permissions ?
You have to add the following lines in your Manifest, inside of the application tag:
<uses-feature android:name="android.hardware.telephony">
</uses-feature>
Also particular features require special Permissions, for example sending and receiving sms requires:
<uses-permission
android:name="android.permission.RECEIVE_SMS" >
</uses-permission>
<uses-permission
android:name="android.permission.SEND_SMS" >
</uses-permission>