Android NDK basics steps

279 views
Skip to first unread message

Gane R

unread,
Jun 23, 2016, 12:35:56 PM6/23/16
to android-ndk
I am C++ developer. I am new to this android-ndk.


Goal
 I want to build GDAL a C++ library with few functionality calls from JNI for all android devices.

 I have already worked with JNI on linux and Java

 I tried to build the basic hello-jni on Ubuntu 14. 64 bit running on with android studio under Oracle Virutal Machine on Windows 10


So what is the basic requirement for Android NDK such as ubuntu running on a real Intel 64 bit machine will it be OK ???

or

Can you say any steps that I should follow.

Gane


Kenneth Geisshirt

unread,
Jun 24, 2016, 9:54:13 AM6/24/16
to andro...@googlegroups.com
Hi Gene,

The instructions in http://trac.osgeo.org/gdal/wiki/BuildingForAndroid seems to be out of date. The current version of NDK is r12b. You can install Android Studio, and then the SDK and NDK from Android Studio. You can try the new (experimental) android plugin for Gradle. It is still in an early stage of development. I have a little demo app where I play with it: https://github.com/kneth/AndroidCalcPi


Best,
  Kenneth

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/05e22b0a-bda3-42a0-bd8a-0dc0401726c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cass

unread,
Jun 27, 2016, 11:43:20 PM6/27/16
to android-ndk
Use Android Studio with:

Just follow it and you will save yourself a lot of time and pain.

Tyler Wilson

unread,
Jul 18, 2016, 12:35:50 PM7/18/16
to android-ndk
That is a great link, but what I would love to see is some sort of technical note on the various Android Studio releases, gradle releases and NDK releases and how they all relate. 

For example, I have been using Android Studio 2.1 and the default gradle and an NDK module, which means I cannot source-level debug so I am stuck using log statements for debugging. I tried to move to the experimental grade plugin, but then it will not build due to being incompatible with the Kotlin plugin (I use about half Java and half Kotlin at the moment). I then tried with Android Studio 2.2, but then all the NDK grade configs change. I make the changes, but then it does not pull in the Android.mk and Application.mk correctly and so it tries to link pre-compiled object files of the wrong architecture (I am using the Superpowered audio library, which comes with the various architectures already built). 

So again, it would be great to see some official documentation something like:

- With Android Studio 2.1 and the built-in gradle plugin, use these NDK gradle configs (but note you cannot source level debug with this setup, etc.)
- With Android Studio 2.1 and experimental gradle plugin, use this NDK config (but note you cannot use it with Kotlin [and perhaps other plugins] etc.)
- With Android Studio 2.2 and the built in gradle plugin, use this NDK config (but note the following bugs which may prevent your app from building etc.)

Thank you,
Tyler

Dan Albert

unread,
Jul 18, 2016, 2:25:54 PM7/18/16
to android-ndk
The need for a decoder ring should go away once 2.2 is released.
 
I make the changes, but then it does not pull in the Android.mk and Application.mk correctly and so it tries to link pre-compiled object files of the wrong architecture (I am using the Superpowered audio library, which comes with the various architectures already built).

 Have you filed a bug for this? If not, could you? http://tools.android.com/filing-bugs

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
Reply all
Reply to author
Forward
0 new messages