Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems wih minSdkVersion 1.5

we have a problem related to the manifest file and the property "android:minSdkVersion". The issue is: If our platform is 2.0 and we use the property "android:minSdkVersion=3" (3 = sdk 1.5) the graphics get corrupted (In details, the application's resolution get reduced to a 2/3 part of the original size, this is, when the resolution should be 480x720, it becomes in a 320x480). This is happening on the Android emulator, and on the devices Droid/Milestone (Which are platforms 2.0). When we switch the property to "android:minSdkVersion=4" (4 = sdk 1.6) the problem gets solved, but when we want to put that version on platform 1.5, Android doesn't allow us to install it. It would help us to know any conflict regarding graphics within the 2.0 sdk, or any known problem around the "android:minSdkVersion" in the manifest.

Thanks!

like image 794
Tebam Avatar asked Jan 06 '10 14:01

Tebam


People also ask

How do I update minSdkVersion?

To change Android minSdkVersion in Flutter for the project created after the 2.8 update, you have to make changes in the local. properties file and then reference the new variable from the local. properties file inside the build. gradle file.

Which Android API level should I use?

When you upload an APK, it must meet Google Play's target API level requirements. New apps must target Android 12 (API level 31) or higher; except for Wear OS apps, which must target Android 11 (API level 30) or higher.

What is the difference between compileSdkVersion and targetSdkVersion?

compileSdkVersion is the version of the compiler used in building the app, while targetSdkVersion is the "API level that the application targets".


2 Answers

If you specify targetSdkVersion as well as minSdkVersion your application will start to work correctly on all platforms.

So have an entry in your manifest like this:

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/>

This is covered in the Android API Levels page in the Android Developer documentation.

like image 169
Dave Webb Avatar answered Oct 21 '22 02:10

Dave Webb


I assume you're specifying different assets for different screen densities using directories like res/drawable-mdpi, res/drawable-hdpi and so on?

Android 1.6 (API level 4) was the first version of the SDK to support multiple screen densities, so it knows the significance of these directory names and so can successfully select the correct drawable from your res folders for the particular device it's running on.

However, if you run an application developed in this way on an Android 1.5 device (API level 3), then the framework does not know that it should only use the medium DPI resources (as there are no Android 1.5 devices released with anything other than medium DPI screens (AFAIK)). So in this case, the framework can end up choosing seemingly randomly from all the available resource in your APK, whether they're intended for high density screens or medium density screens, or whatever.

However, I haven't seen the reverse happening that you are, i.e. a 2.0 device appears to select drawables for, or assumes, a different screen density.

I would make sure your res directory layout is correct, and that you're using density-independent measurements in each of your layouts as appropriate.

But if you want to support multiple screen resolutions and densities and support Android 1.5 devices in a single APK, then I don't believe it's possible.

like image 21
Christopher Orr Avatar answered Oct 21 '22 04:10

Christopher Orr