问题
So I'm having a problem with my app which has a functionality to send SMS. However it can work just fine without that functionality. I got info that people cant install it on tablets. So what can I do, to disable that functionality on tablets but keep it on phones.
That's my Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.SEND_SMS">
</uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS">
</uses-permission>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="@drawable/ikona"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Is there a way?
回答1:
If your app works without SMS functionality, you might need to add the uses-feature
to the AndroidMainfest.xml
file so the app will also show for devices in Google Play that doesn't have phone (sms) hardware capabilities.
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature>
SYNTAX:<uses-feature android:name="string" android:required=["true" | "false"] android:glEsVersion="integer" />
CONTAINED IN:<manifest>
DESCRIPTION:
Declares a single hardware or software feature that is used by the application.
The purpose of a <uses-feature>
declaration is to inform any external entity of the set of hardware and software features on which your application depends. The element offers a required attribute that lets you specify whether your application requires and cannot function without the declared feature, or whether it prefers to have the feature but can function without it. Because feature support can vary across Android devices, the <uses-feature>
element serves an important role in letting an application describe the device-variable features that it uses.
In general, you should always make sure to declare <uses-feature>
elements for all of the features that your application requires.
Declared <uses-feature>
elements are informational only, meaning that the Android system itself does not check for matching feature support on the device before installing an application. However, other services (such as Google Play) or applications may check your application's <uses-feature>
declarations as part of handling or interacting with your application.
Reference:
http://developer.android.com/guide/topics/manifest/uses-feature-element.html
来源:https://stackoverflow.com/questions/16398194/is-there-a-way-to-install-app-that-has-send-sms-permission-on-tablet