0

I'm going to try aviary, and found these words in the documentation:

The Aviary Android SDK supports Android 2.2+ as the minSdkVersion, but it must be compiled using Android 4.0 (API level 14) as the target sdk. This means that your application must have "Android 4.0" selected in the "Project Build Target" Eclipse panel.

I'm confused why it must be compiling using android 4.0 and the same time support Android 2.2? If I use it write an application, can it run on an android 2.2 mobile? If yes, why it needs android 4.0 to compiling?

Freewind
  • 193,756
  • 157
  • 432
  • 708
  • Simple sort line, **If you are compiling your application through android 4.0 it will also run in device which has android 2.2 or above without failing.** So for this make your app in Android 4.0 and write `minSdkVersion=2.2` in manifest file.. – user370305 Sep 05 '12 at 08:23
  • Why it can't be compiled using android 2.2, as the `minSdkVersion`? – Freewind Sep 05 '12 at 08:26
  • 1
    Because it may take advantage of APIs call of newer versions of android if those are available in the device – André Oriani Sep 05 '12 at 08:31
  • To support some features and API's which are not available on 2.2. – user370305 Sep 05 '12 at 08:31

1 Answers1

1

AndEngine requires Android 4.0 to compile, but it does check the Android version of the phone is running to ensure it will only call APIs that are compatible with that version. So although it as compiled with android 4.0 , it will run fine in a Android 2.3 device. I guess the same applies to the Aviary.

This link is useful: http://developer.android.com/training/basics/supporting-devices/platforms.html

André Oriani
  • 3,553
  • 22
  • 29
  • Android uses Java and which is a static type language (no macro), how AndEngine can check the version and only invoke those APIs supported by a specified version? – Freewind Sep 05 '12 at 08:34
  • I mean in Java, the older JVM may refuse to run the class bytes generated by newer JVM, Dalvik VM doesn't have this limitation? – Freewind Sep 05 '12 at 08:38
  • I just tested with some Java code, and found it's the same. I misunderstand java :) – Freewind Sep 05 '12 at 09:11
  • There is no macro indeed, but there is reflection. That allows to check for a method before getting the `Method` object and then calling `invoke` on it. – André Oriani Sep 05 '12 at 15:37