What does the new NDK plugins do? - android

I was installing the last ADT version on eclipse and there's some NDK plugins (https://dl-ssl.google.com/android/eclipse/). Does anybody know what is does? Does it allow eclipse do compile native code? How do you use it?
I can't find any documentation out there.

NDK is a toolset that allows you to write part of your android app using native code in languages such as C and C++. Many developers will probably not need this for android development, however, for accessing certain libraries and optimizing performance it can be useful.
Check out a description here:

This page explains how to build Native Applications using the NDK plugins

Related

Is it possible to build a native android appliation (ndk) with only cmake?

i'm trying to write an application framework for android and linux/windows. Now my question is if it's possible to use only cmake for the compilation or do i need other ndk tools to create the final .apk file ? As far what i've read so far and what i know from cmake it must be possible but i find nothing on the web describing the build process. I hope someone can help me out here.
Thanks in advance
You need C++ compiler for Android. It's not part of CMake, and the easiest (bit not the only) option is Android NDK. Note that you will need a compiler for Windows if your framework is intended to work there too.
But this will not produce an APK for you: this requires yet another tool, Android SDK.
So i need cmake to compile the native libraries for android and the windows/linux libraries and then the andoid sdk to create a .apk file ? android-ndk uses cmake to build native c/c++ code for android.

How to compile Android native library with Android Studio?

I am a new user of android studio and I am developing application based on native library(JNI) and eclipse is provide builder facilities for NDK-build. so any functionality available in android studio to build NDK
NDK integration is very basic, limited, and not documented (per the New Build System page) at the time of this writing. There a couple of examples in the samples at the bottom of that page that illustrate how this can be done. You can also check the Gradle Plugin User Guide periodically to see if any additional documentation is available.
Android Studio runs ndk-build automatically if you have a jni directory in your project root. I describe the minimal setup you need in my answer to a similar question.

Android NDK doesn't include ltdl

I'm trying to build a linux library for Android, but it seems that libtool for the android gcc toolchain doesn't include ltdl, the dynamic loader. Is there a system-related reason for this, or is it just not there?
How would I go about incorporating the ltdl from www.gnu.org/software/libtool/ into an android build?
Thanks!
Many of the standard libraries are 'missing' from the Android NDK most likely for technical reasons of which I am not aware. I do believe in the release notes for the NDK there are entries for those standard C libraries which are not currently incorporated there might be a mention in there as to why ltdl. I can only suggest to get the source and create an Android NDK project and build it that way. Although may I ask why you need the dynamic loader.. android loads libraries as required anyway (so I understand in my limited knowledge)

Building .so libraries on windows for use on android

I am building C libraries that will be used by an android app(through either JNI or the NDK, I've never used the NDK though) and I am wondering what IDE/development environment is best to use? I've basically only used Visual Studio for native development and I'm not sure how to adapt to building .so libraries for use on android.
Thanks
EDIT: Update -- I want to avoid makefiles if possible (never used them) and rather use a complete IDE such as the case with visual stuido to compile
Generally, cygwin (i.e. command line) is used for building Android native code. But you can also try to use Eclipse for this purpose. It doesn't help very much but it highlights syntax and you don't have to switch to other apps to write code and build your app. You can read more about using Eclipse for C/C++ Android development here.
I would strongly recommend that you use the NDK's compiler.
Normally this is done by writing an Android.mk in accordance with the instructions for the NDK. It is not complicated. The easiest thing to do is to grab the hello-jni sample app and just make the necessary changes, for example substituting your source files into its android.mk.
You can stay in visual studio if you like that as an editing environment, simply using the ability to bind an external command to a keystroke to launch the ndk build script. Ages ago I had figured out how to reformat GCC error messages with sed into something that VS could parse to make them click-able, though I soon moved development of that project under linux.
I think a lot of people use Eclipse as their IDE for Android development. I use it and its pretty good. You shouldn't have any problems if you're used to VS.
The Android SDK comes with a plugin, the Android Development Tools (ADT), to develop applications for Android inside the Eclipse IDE, which is same kind of beast as Visual Studio. And within that IDE, it is possible to use JavaCPP (disclaimer: I am the author) to have it compile all the native C/C++ stuff we need through the Android NDK, but without needing Makefiles and such. More details here:
http://code.google.com/p/javacpp/#Instructions_for_Android

Android NDK with Visual Studio

I'd like to build some native libraries for android using the NDK (native development kit), but i'd like to use Visual Studio 2010 to do it. I've googled quite a bit but haven't found any information on it. Does anyone have any experience with this and know the steps necessary to make this happen? I have CYGWin installed, made sure i get Make (per the NDK instructions), but i'm not really sure of the next steps in terms of setting up the project, compiler in visual studio, etc.
If anyone knows of any write-ups, tutorials, or links to sample projects, that would be awesome, as there isn't much on google yet.
thanks!
Here's another solution, which integrates the NDK fully within Visual Studio. No makefiles. It behaves like a proper Win32 project:
Here's an excellent blog post about how you can configure your environment to debug android NDK code using Visual Studio.
Visual Studio is officially not supported.
Some problems (but not limited to):
MSVS cannot create the proper ARM binaries
Android makefiles (.mk) are not supported by MSVS
There are however, third party solutions:
vs-android
VisualGDB
You might want to check out DS-5 as well, though it's not Visual Studio.
The answer depends on what kind of integration you require.
To just build the native Android code from Visual Studio you can create a new Makefile project, and make it run ndk-build.cmd when you press "build". If you would like to get the error messages mapped as well, you will need to parse the output of ndk-build.cmd and convert it to a format that Visual Studio can udnerstand.
If you want to debug your native Android code from Visual Studio, you will need a third party tool that will control ndk-gdb on behalf of Visual Studio and provide workarounds for several bugs (e.g. rebind breakpoints when libraries are loaded).
You can try our VisualGDB for Android tool that does exactly that - creates projects that wrap ndk-build and controls NDK debugger on behalf of Visual Studio. If you need more information, there is a step-by-step tutorial available.
I have not found a direct clean solution, here is my workaround.
I develop my native code on VS as a static library, and use some test project to try it as a console aplication.
When it is ok, from cygwin I use a little bash script that copies all needed files to the jni folder and launch the standard android ndk make command. (also copy some file to assets folder when needed), producing the executable in the right folder.
To use the pthreads I have linked my projects to pthreads-win32.
The only files I do not compile in VS are the jni code.
I hope this can help you.
There's also a couple of other third party alternatives for developing ANdroid apps with VS in addition to those above. There is the open source dot42 located at http://www.dot42.com and Remobjects, http://www.remobjects.com , which allows you to program in c#, Pascal, and Swift. I have played with the trial of Remobjects and am now starting to play around with dot42.
My use of the remobjects trial allowed me to recreate in c# the first five chapter projects in the textbook of the Android course I took. I haven't had the same success with dot42 so far but I need to find some time to really give it a chance.

Categories

Resources