Android Question sdkversion in manifest

DT1111

Member
Licensed User
Longtime User
Hi

I would like to understand about the sdkversion in a manifest file

Following is my manifest and I understand that android:targetSdkVersion="14" is recommended.

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:largeHeap,"true")
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light")

I have 2 questions.

Q1: My android jar path is pointing to android 19 and shouldn't the targetSdkVersion set to android:targetSdkVersion="19"

Configure Path:
B4X:
C:\Android SDK\adt-bundle-windows-x86-20131030\sdk\platforms\android-19\android.jar

Q2: what will happen if i just leave it as <uses-sdk android:minSdkVersion="4"/>. I have done so in the past without any obvious problem. But I need some comments.


My Android OS is 4.4.2.


Thanks.
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
Sorry, I don't understand question 1.

Question 2 : If you leave minSdkVersion to its default value :
  • your app will be available in the Play Store to devices from Android version 4
  • but if you use functions (classes) available in higher API, your app could crash on devices running lower API

Referring to the Android SDK Manager, your device uses API 17
 
Upvote 0

DT1111

Member
Licensed User
Longtime User
Hi lemonisdead

Thanks for your explanations to Q2.

Regarding Q1, under Tools/Configure Paths, the path pointing to the jar file seems to suggest it is basing on version 19

C:\Android SDK\adt-bundle-windows-x86-20131030\sdk\platforms\android-19\android.jar

If that is the case, shouldn't the targetSdkVersion in my manifest set to android:targetSdkVersion="19" instead of "17" or even "14". (Aside: I read elsewhere "14" is recommended as it has been thoroughly tested).

But why not "19" in order to match the android.jar file which I assume is version 19. What dictates the final number? That is what I am a little unclear.

Thanks.
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
You can point to a higher Sdk because it is backward compatible (compatible with versions above).
So you don't have to change the path each time but only its target in the Manifest (if required). I have already seen people using a targetSdk numbered 99 without any problems (I don't know if they are other effects).
 
Upvote 0

DT1111

Member
Licensed User
Longtime User
Thanks. At least I don't have to lose sleep over this targetsdk as nothing can break or crash. 99? That will cover all bases.
 
Upvote 0

DT1111

Member
Licensed User
Longtime User
Hi again

I have noticed occasional "lags" when reading data from sql db. The lag is noticeable by observing the progressdialog spinning round in circle taking quite
long to load data (~ 10 sec).

The occasional lag happened was when I have the manifest set to android:minSdkVersion="4" android:targetSdkVersion="14" or even "19".

But the lags disappear when I set the manifest to android:minSdkVersion="4" and no target value. And data got loaded fast (~ 1 sec).

I don't understand why and is it wrong to leave out targetSdkVersion?
 
Upvote 0

DT1111

Member
Licensed User
Longtime User
Hi Erel

The problem is now solved by not using Doevents in the loading data routine. But the only downside is that the progressdialog box "spinning" circle freezes. Can anything be done to solve that new problem?

Thanks.
 
Upvote 0
Top