I published my application on the Play Store, but it is not available for tablet...">

<use-permission android: name = "android.permission.SEND_SMS" / ">

I published my application on the Play Store, but it is not available for tablets. I checked the functionality of the application in the Google Play Store, and after some research it turned out that my application has some telephony features, which, I believe, are guilty. Here is my manifest file.

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="17" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission> <uses-permission android:name="android.permission.SEND_SMS" /> <!-- GCM requires a Google account. --> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <!-- Keeps the processor from sleeping when a message is received. --> <uses-permission android:name="android.permission.WAKE_LOCK" /> <permission android:name=".permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name=".permission.C2D_MESSAGE" /> <!-- This app has permission to register and receive data message. --> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <!-- Keeps the device on vibrating mode when a message is received. --> <uses-permission android:name="android.permission.VIBRATE" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar" > <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="" /> </intent-filter> </receiver> <service android:name=".GCMIntentService" /> <activity android:name=".Splash" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".MainActivity" android:screenOrientation="portrait"> </activity> <activity android:name=".SelectedArticlePush" android:screenOrientation="portrait"> </activity> <activity android:name=".ActusScreen" android:screenOrientation="portrait"> </activity> <activity android:name=".MentionLegale" android:screenOrientation="portrait"> </activity> <activity android:name=".SelectedArticle" android:screenOrientation="portrait" android:windowSoftInputMode="stateAlwaysHidden|adjustPan">> </activity> <activity android:name=".ReglementScreen" android:screenOrientation="portrait"> </activity> <activity android:name=".SelectedReglementation" android:screenOrientation="portrait"> </activity> <activity android:name=".FavoriteScreen" android:screenOrientation="portrait"> </activity> <activity android:name=".AlertScreen" android:screenOrientation="portrait"> </activity> <activity android:name=".ClubScreen" android:screenOrientation="portrait"> </activity> <activity android:name="ClubMi" android:screenOrientation="portrait"> </activity> <activity android:name=".DisplayWeb" android:screenOrientation="portrait"> </activity> <activity android:name=".Contact" android:screenOrientation="portrait"> </activity> <activity android:name=".tab.TabClubMi" android:screenOrientation="portrait"> </activity> <activity android:name=".SMS" android:screenOrientation="portrait" android:theme="@style/Theme.Transparent" > </activity> </application> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:resizeable="true" android:anyDensity="true" /> 

I believe that <uses-permission android:name="android.permission.SEND_SMS" /> activates telephony functionality. However, I need this permission to send SMS. Can someone tell me if there is an alternative way by passing this on startup on a tablet.

+7
source share
2 answers

Add a function block to the manifest:

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

The above indicates to the device that this function is used in your application. However, android:required="false" ensures that this is not a strict requirement and will install the application regardless of the device that supports the android.hardware.telephony function.

This, however, creates a new problem. Do not worry. The following is the solution. :-)

What happens when a device that does not support the android.hardware.telephony function tries to use the function in some way? In your case, send an SMS message. A simple solution is to check if the device has the ability to use telephony features.

 TelephonyManager tm = (TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) { // SHOW A DIALOG, A TOAST OR A NOTIFICATION TO TELL THE USER THAT THE FEATURE IS MISSING } else { // RUN THE CODE TO SEND OUT THE SMS } 

And I think this is a workaround if the device on which it is running is a CDMA device.

 String strTM = ((TelephonyManager) getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE)).getLine1Number(); if (strTM == null) { // SHOW A DIALOG, A TOAST OR A NOTIFICATION TO TELL THE USER THAT THE FEATURE IS MISSING } else { // RUN THE CODE TO SEND OUT THE SMS } 

Any of the code blocks listed above needs READ_PHONE_STATE permission:

 <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 

There is another way to verify (using PackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY) ) if the device has the specified functions. I personally have never intended to test it, but the OP indicates that it works. stack overflow

+15
source

You forgot to add xlargeScreens to your Manifest .

 <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" /> 

EDIT: the <uses-permissions> does not use any equipment or features on the device, only the <uses-feature> provides capabilities when required set to true . p>

+2
source

All Articles