2

In android gradle build file I have the following closure:

android {
compileSdkVersion 21
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.mycoolapp"
    minSdkVersion 16
    targetSdkVersion 21
    versionCode 41
    versionName "3.0"
}
}

I do not want my app to run on Marshmallow. My targetSdkVersion is 21 and Marmallow would be 23. So imagine I have a phone that is Marshmallow, if I go to the play store will my app appear in the listing?

My second question is how would I stop my app from appearing in google play store for marshmallow devices?

Kayathiri
  • 779
  • 1
  • 15
  • 26
j2emanue
  • 60,549
  • 65
  • 286
  • 456
  • yes it will appear any reason why dont you want to list it on marshmallow? – Pavan Oct 15 '15 at 14:13
  • so wont my app break then ? api 23 is asking for runtime permissions. so if i have a device running 23 and since android is backward compatible, what will happen for example if im using apache httpClient which is depreacated in marshmallow or if im not prepared to handle runtime permissions ? wont my app break in this case ? – j2emanue Oct 15 '15 at 14:15
  • You can manually exclude devices. Please check with thease links https://support.google.com/googleplay/android-developer/answer/1286017?hl=en http://developer.android.com/intl/es/guide/practices/compatibility.html – Madhukar Hebbar Oct 15 '15 at 14:18
  • As a user if this was a paid app I would be pretty mad about a developer being lazy and not letting me download an app that I paid for because they were to lazy to update their code though – tyczj Oct 15 '15 at 14:25

3 Answers3

3

So imagine i have a phone that is Marshmallow, if i go to the play store will my app appear in the listing ?

Yes.

how would i stop my app from appearing in google play store for marshmallow devices?

You are welcome to try android:maxSdkVersion in the <uses-sdk> element of your manifest, as the current documentation suggests that the Play Store uses it as a filter, though this comes at a cost to users who get upgrades of their app to Android 6.0.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I read MaxSdkVersion is deprecated and not to be used anymore from the docs. And regarding your comment on cost to user ? if user has Android 6.0 my app update will not come to them i assume. is this the cost your referring to ? Could you talk about the scenario where if the device is Android 6.0 but my app is targetSDKVersion 21 will it runtime permissions have any affect on my app ? – j2emanue Oct 15 '15 at 14:49
  • 2
    @j2emanue as the documentation states `If the device or the app's targetSdkVersion is 22 or lower, the system prompts the user to grant all dangerous permissions when they install or update the app.` so all your permissions will be granted upon install. the user however can revoke any of those permissions at anytime – tyczj Oct 15 '15 at 15:00
2

Answering not to original question, but to reasons of it.

I'm not sure you have to do it.

api 23 is asking for runtime permissions. so if i have a device running 23 and since android is backward compatible, what will happen for example if im using apache httpClient which is depreacated in marshmallow

You still can use HTTP client. From the docs:

To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in your build.gradle file:

android {
    useLibrary 'org.apache.http.legacy'
}

I tried to install my old applications which use HTTP Client on Android 6.0. They still work, without the dependency in build.gradle and even without recompiling.


or if im not prepared to handle runtime permissions ? wont my app break in this case ?

App wouldn't break. If you don't compile your app under Marshmallow (targetSdkVersion 23 or higher) then it will work in "legacy" mode: permissions will be requested before installation. With one exception: users still can switch off permissions in settings; I don't think that many users do it.


Try your app in emulator or real device. I'm almost sure it will work under Marshmallow.

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
0

may be i think it is described in app runtime permission model will work if we target api to 23

Note: This lesson describes how you implement permissions requests on apps that target API level 23 or higher, and are running on a device that's running Android 6.0 (API level 23) or higher. If the device or the app's targetSdkVersion is 22 or lower, the system prompts the user to grant all dangerous permissions when they install or update the app.

link: https://developer.android.com/intl/es/training/permissions/requesting.html

may be if i have some misunderstanding then please notify me

Pavan
  • 5,016
  • 1
  • 26
  • 30