I've developed an android application whose GUI is designed for small screens. When run on a tablet it looks rubbish because I've assumed 320dp width to make my life easier - I don't have the resources to test on tablets.
People using android 3.2 were able to zoom into the app so it looks like it's running on a big phone. But after my last update that option is not available, and I don't understand why.
The change is related to the Manifest file. Here's what my orignal app had (there's nothing to do with screens in my Manifest):
<uses-sdk android:minSdkVersion="7" />
After updating my development environment, I got a warning saying I should specify a target sdk, so I did this:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="10" />
Using a painfully slow Android 3.2 emulator I have confirmed that this has caused the problem. I thought any target SDK below 11 wouldn't affect the zooming option?
Using the following also removed the zoom option:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="9" />
But this didn't:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8" />
So setting my target SDK to 8 is a workaround, but it's also wrong because I use version 2.3.3 for testing.
Am I missing something here? Is there a better solution?
Thanks.
Try setting targetSdkVersion to 9 (or 10) and adding <supports-screens android:xlargeScreens="false" /> to your AndroidManifest.xml (docs for supports-screens). This tells the system that your application does not explicitly support xlarge screens and that it should offer the compatibility zoom/scale option for users that use the app on xlarge devices. Note that this will not cause the app to be hidden from xlarge devices on the Play Store (supports-screens only causes Play Store to filter apps from smaller screens if they are designed to run on larger screens, not the other way around).
The reason I think this is happening once you set targetSdkVersion to 9+ is because supports-screens xlargeScreens was added in API Level 9 and (I believe) defaults to true (for API Level 9+ at least). Once xlargeScreens is true the system will disable the compatibility zoom/scale mode.
Supporting docs (where it does say this but is fairly convoluted):
http://developer.android.com/guide/practices/screen-compat-mode.html
http://android-developers.blogspot.com/2011/07/new-mode-for-apps-on-large-screens.html
http://developer.android.com/guide/topics/manifest/supports-screens-element.html
Related
I have an application live in Google Play for more than a year and recently a user reported that he has a Sony Tablet S and Google Play shows him that my app is not compatible with this device.
I read through many threads in stackoverflow regarding incompatible issues, and as far as I could understand it usually happens (based on my research on various stackoverflow threads) for one of the following 4 reasons
Size of the application is large (larger than some limit specified on the device).
Due to the supported screen sizes specified in the manifest
Google play filters out app based on some implied features for the permissions requested in the app.
Filtered based on min sdk specified in the manifest
As far as I know , none of the above should be applicable for my app because
Size of the app is less than 1mb
I have not specified any supported screen sizes in the manifest
I have only requested 3 permissions in the manifest (INTERNET, ACCESS_NETWORK_STATE, WRITE_EXTERNAL_STORAGE) and based on android documentation these permissions don't seem to have any implied user-features. (I could be wrong here). I wonder if there was a need to explicitly mention all of these permissions as optional, but couldn't find any way to do that since there are no implied user-features for these.
Min sdk is is 8, which is lower than the one supported by Sony Tablet S (API Level 15 I believe). I have not specified any max sdk version.
Here is the section from my manifest which has permissions etc.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk android:minSdkVersion="8" />
I'm at a loss as to what might be prompting Google Play to show my app as incompatible on Sony Tablet S for the user. When I go to google developer console and look at the supported devices, Sony Tablet S is listed as supported, but apparently for the user it appears as incompatible.
Any leads to narrow down this issue is highly appreciated. FYI. App works fine on many other tablets - Kindle Fire, Galaxy Tab, Asus etc.
You may want to try explicitly declaring that you app supports xlarge screen sizes:
<supports-screens android:xlargeScreens="true">
By default this is not always set to true.
No, it doesn't mean that you don't support other sizes. By default your app will support small and normal screens but it's best to set it explicitly for large and xlarge screens since it can vary depending on device. See here for more info:
http://developer.android.com/guide/topics/manifest/supports-screens-element.html
Update: Adding this to manifest solved it:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14"/>
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true"/>
Looks like google silently stopped listing newly submitted apps in tablet market that don't meet their "optimization tips".
One of those "tips" is setting minSdkVersion="11", which means losing 40% of their whole userbase who still run sdk 10 (hilarious).
Can someone please suggest the least painful solution that would let me target both pre 11 SDK users and tablets, preferably without getting into multiple APK business.
If multiple APK is the way to go, then what is the best criteria to separate users on, so I can have a single version code at least.
(the app is fully compatible with all screen sizes and densities, currently targets minSdkVersion="8")
You are reading it wrong..
At a minimum, check the element to make sure that:
targetSdkVersion is declared with value 11 or higher (14 or higher is
recommended), OR minSdkVersion is declared with value 11 or
higher.
I put 'or' in bold to make sure you read it...It was already in upper case, but was not enough ;-)
Use targetSdkVersion to 17 and Support library as other people said.
Use the Android Support Library provided by Google. You can download it through the SDK manager. It requires a few changes to existing code (like using getSupportFragmentManager() instead of getFragmentManager(), but it works just fine.
Looks like google silently stopped listing newly submitted apps in tablet market that don't meet their "optimization tips".
I'd be interested to know of any proof you have which supports that statement.
One of those "tips" is setting minSdkVersion="11"
That is partially correct. Quoting the Target Android versions properly section which you linked to in your comment to Waza_Be ...
At a minimum, check the element to make sure that:
a. targetSdkVersion is declared with value 11 or higher (14 or higher is recommended), OR
b. minSdkVersion is declared with value 11 or higher.
c. If a maxSdkVersion attribute is declared, it must have a value of 11 or higher. Note that, in general, the use of maxSdkVersion is not recommended.
Note at the end of 'a' there is the word OR in capitals making 'b' unnecessary if 'a' is true (and we all know we can ignore 'c').
You need to use the support library which has most of the functionality (if not more) of all sdk's > 11
The support library can be used on any device 2.2 and up
Google play is a unified market place for both phones and tablets. When a device visits the Google Play, it reports api version and capabilities (hardware), so the market only shows apps matching the provided criteria. If your app is not compatible with a device it will not show up.
Up to version 2.x (api 10) the same code was used for both tablets and phones. Then version 3.x (api 11-13) was just for tablets and then version 4.x (api 14) was again unified.
So we have 2.x tablets, 3.x tablets and 4.x tablets. Use minSdkVersion to declare up to which version your app supports.
I recently posted about the Play store not letting me publish my app without a minSdkVersion, but whenever I set it to anything above "1" my app just doesn't work (minSdkVersion breaking program).
So this guy suggested to just set my minSdkVersion to 1, which worked. But now when I submitted my app even though the developer site says:
API level: 1-16+
Supported screens: normal-xlarge
OpenGL textures: all
But the app only shows it supports Android under 4.x, I developed it on my 4.0.4 device. I tried searching around and I found that some people have problems with services messing up the phones it supports, so I deleted all of my services, because I don't really need any for this version of the app to submit. And it still didn't work. So I don't know what else to do, here is my AndroidManifest.xml if it helps... I've been trying to figure out why my application isn't working for a week now, still nothing. I have tried setting a targetSdkVersion to something like 14, my application still breaks. I cleaned out my code, taking everything out of the already short, 200 lines, application, and it still isn't working. Is there something I can't use in an android application 4.0 that I am using in my application? or is it just my AndroidManifest? Thank you so much!
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unparalleledsoftware.app.list"
android:versionCode="5"
android:versionName="2.02" >
<uses-sdk
android:minSdkVersion="1" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I should note,I am using the Theme.Holo.Light, but even if I change it to DeviceDefault it doesn't work.
Edit:
I googled the app on my friends Samsung Galaxy S3 (it didn't show up in the Play Store on his phone), when I installed by googling the app and hitting the "install" button on google and it opened in the Google Play store and was able to install. When I did the same on my phone, Galaxy Note, it opened in the Google Play Store, but then said "Not compatible." Why? They are both on the same version of OS. Why is mine not compatible, nor the One X compatible, but the Samsung Galaxy S3 worked...?
Edit: I get these errors/problems when compiling with a targetSdkVersion, http://pastebin.com/mxgWNLdM
It's showing up as "Requires Android 1.0 and up" on my end, and there's nothing wrong with your manifest either. It'll show up on all devices.
You should, however, avoid using Holo themes if you're targeting devices running versions of Android prior to 3.0. The best practice is to create two themes - one for API levels 1-10 and one for API level 11+, and make sure that the v11 one is using a Holo theme as the parent style.
Your Manifest file only has a minSdk setting which is odd/bad since according to the documentation if you don't set a targetSdk, it will default to the minSdk level.Android Manifest - Uses SDK element. The thing is that an API setting of 1 is really old and I wouldn't be surprised that Market/Play has issues. If you developed this on ICS, you should really have a targetSdk. Also if it was developed for API level 14, you should have a supports-screen element as well.
At worst, I would create a new project and copy over that manfest file for any missing elements. If you are still having issues with a targetSdk and supports-screens, turn on verbose build messages and see if anything looks wrong.
I you posted your complete Manifest file above, then I suggest adding <supports-screen> entry (above <applicaion>) to it, like this:
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true" />
Lack of it (if not intentional) causes application to be not available for any device it should, due to Play's filtering mechanism.
Hi im having problems getting an app i have written for the motorola xoom to fill the screen. When i run the app it runs it in the middle of the screen as if it was on a phone or something. When creating the main.xml at the top it is showing the screen as a 10.1in WXGA screen and the system at the right hand side is set to Android 3.1
Any idea what im doing wrong?
Screen sizes beyond phone screens was added in Donut (API 4). Thus to say that you know about different screen sizes, you need to set at least API 4 as the target SDK version in your manifest:
<manifest ...>
<uses-sdk android:targetSdkVersion="4" />
</manifest>
This allows the system to use the modern defaults for the supported screens that you can specify with this:
http://developer.android.com/guide/topics/manifest/supports-screens-element.html
The use of android:targetSdkVersion is very important, since it allows the platform to disable a variety of compatibility behavior for your app to allow it to run better on more recent versions of the platform. Some of the things it impacts can be found here:
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
I had the same problem with porting to Galaxy Tab. Make sure you specify the correct API Level. I used an old one and had the same behaviour.
Try adding this to your AndroidManifest.xml: <uses-sdk android:minSdkVersion="4" />
The app is Flash Cards Max on the Android market. I recently updated my app with a 1.6 only feature. However, I still want the app to work with those that have Android 1.5. I built it using Android 1.6 in Eclipse and I have the correct strings in the Android manifest file.
<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="4"
/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
Everything works in the emulator fine on 1.5 just want to be sure it shows up on the Android Market for those with 1.5. It does not. This is a market filtering question.
Please see this thread for info on what I changed and how I went about it thanks to several of your suggestions.
tl;dr
Why doesn't my app show up for 1.5 users?
Answer by a helpful user on Reddit.
"I had the same problem, solution was <supports-screens/>
Why?
Because
android:anyDensity
Indicates whether the application can accommodate any screen density. Older applications (pre API Level 4) are assumed unable to accomodate all densities and this is "false" by default. Applications using API Level 4 or higher are assumed able to and this is "true" by default. You can explicitly supply your abilities here."