What should I set android:targetSdkVersion to?

surfuric

Member
Licensed User
Longtime User
I am writing specifically for an AVD set to API level 14, so I set:
Paths Configuration:
javac.exe to: C:\Program Files (x86)\Java\jdk1.7.0_07\bin\javac.exe
android.jar to: C:\Program Files (x86)\Android\android-sdk\platforms\android-14\android.jar

Manafest had the line:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>

(The AVD I used to test was running API Level 14.)

I then copied in and ran the extremely simple example given in the online documentation for HTTP (I included the HTTP version 1.21 library). Unfortunatley it died on the line:
Response.GetString("UTF8")

Only setting targetSdkVersion to 9 or less made the example work. (I understand I should use Response.GetAsynchronously instead to get this to work.)

****
So my question is: Should I always use 9 or less for SdkVersion even though my target phone can run 14? And if so, do I lose the functionality of updates from 10 through 14?
****
 
Last edited:

Djembefola

Active Member
Licensed User
Longtime User
Erel, is it a good idea to edit the manifest and use the latest Target SDK Version?

B4X:
android:targetSdkVersion="16"

Or should i always use "14" with B4A 2.22?
 
Upvote 0

John H. Guillory

Member
Licensed User
Longtime User
I saw a site that said you should set it to the latest device you tested your program with. The reason being is in newer versions, some features like the menu button might not be present, and if your app needs the menu button to exit and there is none on the device, but you set the target version to the version you tested it on, it will put up a menu button on the screen... With that being said, how can I tell for sure what version my operating system is?
Settings, About Phone, I have:

Firmware Version 2.3.6
Kernel Version 2.6.35.7
 
Upvote 0
Top