I tried to compile and run the app hello-jni from NDK examples in Motodev Studio, and when I run on the phone, it crashs and LogCat says "Library not found". Can anyone suggest how to correctly setup the project? BTW, is is possible to write an entire Android app using only C/C++ code?
2 Answers
Library not found :- Did you compiled the jni part successfully. If you jni module is made then there will be .so file in you libs folder.
Using NDK to Call C code from Android Apps
Refer this When to Develop in Native Code, there it given
Write a native activity, which allows you to implement the lifecycle callbacks in native code. The Android SDK provides the NativeActivity class, which is a convenience class that notifies your native code of any activity lifecycle callbacks (onCreate(), onPause(), onResume(), etc). You can implement the callbacks in your native code to handle these events when they occur. Applications that use native activities must be run on Android 2.3 (API Level 9) or later.
You cannot access features such as Services and Content Providers natively, so if you want to use them or any other framework API, you can still write JNI code to do so.