Porting C/C++ application to Android

292 views
Skip to first unread message

João M. S. Silva

unread,
Jun 22, 2016, 5:57:08 PM6/22/16
to android-ndk
Hi,

I'd like to evaluate the possibility of porting a C/C++ application to Android.

The application depends on some off-the-shelf libraries (v4l2, libopencv_core, libopencv_highgui, libopencv_imgproc, mysqlpp, mariadb, vsqlitepp) and on some custom-compiled libraries.

I understand that I should use NDK: is there some guide for GNU/Linux, C++ users? The instructions on https://developer.android.com/ndk/guides/setup.html still mention Eclipse, so they are outdated.

Is this porting viable for someone with absolutely no Android experience and just one course experience on Java?

Thanks for any help and insights.

João M. S. Silva


jeff shanab

unread,
Jun 22, 2016, 6:04:47 PM6/22/16
to andro...@googlegroups.com
I had a browser plugin in the firebreath framework, so C++.  I played from RTSP and long polling HTTP video from security cameras.

I was able to port almost ALL the c++ code using the NDK

The NPAPI plugin was javascript calling C++.
The Android was Jav JNI calls to C++, a bit messy but it worked.
The IOS port was objective C wrapped C++, they blend really well.

I did all the android work with eclipse, very painful compared to the ios experiance but porting was 4 days ios 4 weeks android and it was my first time.
Some of the choices in android made things unneccesarilly difficult. no library versions.



--
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/3ed2943e-274f-4eb4-9e91-c4fa92eb16db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Albert

unread,
Jun 22, 2016, 6:27:33 PM6/22/16
to android-ndk
Sorry to leave you hanging in IRC. Had to run to a meeting.

Android does not provide any of those libraries as part of the system (it's a very small list: https://android.googlesource.com/platform/ndk/+/master/build/core/build-binary.mk#61)

You'll need to package each library in your app. If the libraries you depend on haven't already been ported to Android by the maintainers or someone else, you'll have to do the porting yourself or find a way to make those features optional and then not used in Android.

In general our aim is to be able to support anything you can build against glibc, though there are a handful of things that just don't make sense in Android (our user model is entirely different, so most of that doesn't exist). In other words, if you run into things that Android's C library is missing when porting things, file a bug at https://github.com/android-ndk/ndk/issues

João M. S. Silva

unread,
Jul 10, 2016, 5:12:40 PM7/10/16
to android-ndk
Thanks jshanab and Dan for the inputs. Should I start here:

  https://developer.android.com/ndk/guides/index.html

?

João M. S. Silva
Reply all
Reply to author
Forward
0 new messages