This is a followup to About the NativeActivity in Android 2.2/NDK-r5。
The example AndroidManifest.xml with the NativeActivity documentation and (android_ndk)/samples/native-activity/AndroidManifest.xml in both R6 and R6b include
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="8" />
Attempting to build with APP_PLATFORM := android-8 in Appliction.mk fails horribly because (android_ndk)/platforms/android-8/arch-arm/usr/include/android is nearly empty.
Despite this being a very silly idea, I tried to build a library with APP_PLATFORM := android-9 in Application.mk and build a .apk with target=android-8 in default.properties. To my surprise, it built. Not to my surprise, it didn’t run.
It seems unlikely, but is there some way to make this work on Android 2.2?
I have filed a bug report with Google since it is most likely a documentation error, but I thought I would raise the issue here too.
NativeActivity was introduced in Android 2.3. The sample in the documentation has at least two errors:
minSdkVersionshould be 9 andandroid:hasCodeshould betrue.So NO, you cannot make it working on Android 2.2.