SDKs Installed and minSdkVersion & targetSdkVersion

Hi

complete newbie to Cocos2d-x (though an ageing grumpy Windows programmer).

I have managed to get a Mac to compile and run my first Cocos2d-x project on Xcode using iOS simulators.

I am working on getting Eclipse to debug my project on Windows using AVD.

The AndroidManifest.xml on my project allows me to select values ‘minSdkVersion’ and ‘target SdkVersion’.

Using Android SDK Manager I can install SDK Versions Android 2.2 (API 8) through Android 5.1.1 (API 22).

Somewhat obviously I understand that targeting older SDK versions will allow older devices to run the app.

Queries:

  1. If I set minSdkVersion = 10 and targetSdkVersion = 22 then does this require that I install ALL of the intermediate SDK versions as well as those mentioned?
  2. Will targeting many SDK versions increase the size of my installer/app considerably? Why wouldn’t I simply install ALL and set minSdk to targetSdk to the full range?
  3. Notwithstanding replies to the above queries, are there any rules of thumb for these two values?

Any guidance appreciated!

AndyF.

  1. No just install 22
  2. Just install 22, it will work with 10 and above.
  3. Not sure. I have always used 10 and whatever the latest supported (by cocos) sdk version is.

Thank you very much!

Rule of thumb: use the lowest minSdkVersion you can. Start with the version cocos2d-x uses, then work from there if you need features that are only available in newer SDK version.

If you want to access newer features but make that optional, there are some ways to do it while still allowing older version to run it (use SDK level detection at run-time instead).

For the targetSdkVersion, it is recommended you put a version you actually test on, not always the newest, to have forward-compatibility: in case something you use work on your SDK version but was changed in newer SDK, if you say you target the newer SDK, it will break, whereas if you use older SDK version, Android will enable forward-compatibility, and it will work.

1 Like

oookaaayy…

might be a step too far just now. Trying hard at the moment to get a breakpoint hit in Eclipse and struggling…

Thanks for the advice anyway.