3

After uploading my app to Google Play, I tried downloading it to my nexus 7 and didn't see the app. on top of it I got a suggestion in the console to enable it to tablets. What I have in my manifest is:

<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.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

Now I assume it's because the SEND_SMS. the problem is, I want handsets to have sms feature, but not tablets.

When I tried:

<uses-feature android:name="android.permission.SEND_SMS" android:required="false"></uses-feature>

I got an exception on handset.

I looked at: Android app not available for some tablets in Google Play

Android app showing in Google Play for Phone but not for Google Play for Tablets

Android App is not visible on Google Play store for tablets

But non worked, what should I do?

Thx.

Community
  • 1
  • 1
Dgot
  • 119
  • 3
  • 14

2 Answers2

0

I never had that problem, but i think you have to "uses- feature"

In the AndroidManifest you need: TO ALL PHONE FEATURES not only sms

  • SEND_SMS
  • CALL_PHONE
  • and the rest

.

<uses-feature android:name="android.permission.SEND_SMS" android:required="false" />
<uses-feature android:name="android.permission.CALL_PHONE" android:required="false" />

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

Link : uses-feature - Android Developer site

Each time you upload an application to the Android Market Publisher Site, Android Market scans the application's manifest file. It looks for elements and evaluates them in combination with other elements, in some cases, such as and elements. After establishing the application's set of required features, it stores that list internally as metadata associated with the application .apk and the application version.

When a user searches or browses for applications using the Android Market application, the service compares the features needed by each application with the features available on the user's device. If all of an application's required features are present on the device, Android Market allows the user to see the application and potentially download it. If any required feature is not supported by the device, Android Market filters the application so that it is not visible to the user and not available for download.

Community
  • 1
  • 1
Jakub S.
  • 5,580
  • 2
  • 42
  • 37
  • Thanks for the answer, as I wrote, when I added to uses-feature, android:required="false", it crashed on handsets. – Dgot Jun 01 '16 at 07:55
0

If this is only SMS permission related issue, I suggest you to ask for sms permission at runtime. First, remove SEND_SMS from manifest, then where you write send sms code in your app, check if device is phone or tablet, like this:

boolean tabletSize = getResources().getBoolean(R.bool.isTablet);
if (tabletSize) {
    // do something
} else {
    // ask for permission code
}

Where resource R.bool.isTablet is described here in this answer.

Then in else code block ask for SEND_SMS permission at run time. Since it will ask every time, you can only check for this permission when you need to send an sms. Otherwise there will be useless prompts.

Permission code can be copy-pasted exactly from android developer's site requesting permissions at runtime. Let me know if this worked.

Links:

Also the comment on this answer discusses if the resolution fails to identify tablet/phone, you may also check for telephony feature (or only check for telephony feature to get permission at runtime).

Community
  • 1
  • 1
Talha
  • 903
  • 8
  • 31
  • Thank you so much for your answer. first, I'm not sure that SEND_SMS is the problem, I only assume that. second, the Request permission at runtime is only available for devices running marshmallow (6.+). – Dgot Jun 01 '16 at 07:34
  • Unfortunately, that's limitation of this approach, yes it supports Marshmallow and above. – Talha Jun 01 '16 at 07:50