This is a very cool project. Anything that improves on ndk-gdb is tremendously exciting to me.
I hate to distract, but if this project is of interest to you, you should also check out https://developer.nvidia.com/tegra-android-development-pack It's a one-stop installer for the complete Android native development suite, a CPU profiler, a GPU debugger, Eclipse integration for native debugging and the best Visual Studio integration I've found yet (I have not yet tried Android++).
To my knowledge, Nvidia is doing more to improve the native development experience on Android than any other group on the planet (including Google). This is my plea to ask as many people as possible to try their package and give them feedback just so that they'll be motivated to put even more resources into the project.
It is quite awesome of Natural Motion to release Android++ to the public. Given their "No Hardware Restrictions" feature I understand their concern with relying on Nvidia. However, from working with Nvidia, I'm quite confident that Nv's primary concern is getting people to make high-performance games on Android at all. I would encourage Natural Motion and Nvidia to reach out and find ways to help each other reach their common goal -beyond simply providing friendly competition.
This is certainly good for games and similar multimedia heavy type apps.
However, if you're using C++ for portability for any sort of non-realtime needs you've lost your marbles, and would be better off with JavaScript (no, really) and/or platform specific code to leverage the class libraries of the respective platforms. C++ heavy apps on Android are larger, use more memory, and load less quickly. This isn't obvious if you're used to other worlds, but it is a side effect of how pervasive Dalvik is on the system. Even if most of your app code is in C++ it's still easy to get screwed by a GC pause caused by where you have to interface with the framework.
Much of the underlying problem here is that speed-wise Dalvik just isn't very good. It wasn't even competitive with J2ME VM performance when it first appeared, and took a long time to get close.
With all that said, native debugging has been a sore point forever, and any improvement in that area is welcome.
If by JavaScript you mean making a webview-based app with something like Cordova/PhoneGap, then that's not a great option either. Pre-4.4 WebView on android is notoriously bad, and things as trivial as smooth scrolling are a huge issue. The same app performs fine on iOS and on Android 4.4 which uses Chrome's engine, but unfortunately it will be a while before older versions go the way of IE6. I agree that C++ is not a solution for portable GUI apps either (although it works great for portable games since OpenGL ES runs on pretty much everything.)
> if you're using C++ for portability for any sort of non-realtime needs you've lost your marbles
Maybe if you're starting from absolutely nothing. If I had non-trivial functionality already written in native code then I suspect I'd rather write JNI bindings than do a complete rewrite in Java.
I'm also skeptical of 'use more memory' and 'load less quickly'. Even the GNU C++ standard library on an x86-64 desktop is a less than a megabyte. I can't imagine that being significant in either of those problem areas.
C++ heavy apps on Android are larger, use more memory, and load less quickly. This isn't obvious if you're used to other worlds, but it is a side effect of how pervasive Dalvik is on the system.
Citation required, as this is entirely the opposite of every experience I've had actually building apps that use significant native code. What are you basing this claim on?
There really isn't anything magical about Dalvik (or ART) -- it is a per instance runtime. C++ code doesn't suddenly become heavier or slower to load because of Dalvik.
And of course the overwhelming majority of games are mostly built using the NDK.
It's my understanding that this counter-intuitive performance problem with Dalvik is what crippled the original UI for Android Firefox - they were using their native C++ UI stack (the one used on Windows, Mac and Linux) to implement the whole browser UI, but they found that in practice a UI stack written in Java running on Dalvik performed better because it wasn't subject to all the weird performance penalties from interacting with android frameworks.
VS has amazingly good debugging tools. Other coding features seem to be prettymuch standard, like showing you arguments for a function you're calling and good autocomplete and refactoring and jumping around to declarations. It's got all the typical bells and whistles - all manner of GUI designers, Source-control integration, test-integration, code-review/commenting, etc, although they're very mature. I mean, it's obscenely featureful and the features are generally sensibly designed, so the sum is more than its parts there. The one place I really feel it actually shines is debugging.
IntelliSense is the best C++ code completion/"jump to definition"/"find all callers" feature available on any platform. The Visual Studio debugger is the best C++ debugger I've used. That's pretty much it, but it's enough.
I tried many IDEs, I developed at lest one project in most of the common languages and I still have to find one IDE that get anywhere near VS. It is solid, with good extensions, tons of features but yet it's not scary and quite ugly like most of other IDEs. The only downside is that when you have 6 or more solutions open my computer starts to slow down.
At least one clear advantage is that Eclipse is horribly slow in debugging when compared to VS. I don't know how does IntelliJ compare to it because I haven't used that.
As the other poster responded, NDK is not limited to ARM. NDK makes it (mostly) easy to write C++ and then compile it to multiple ISAs (x86, ARM and MIPS) and then ship all the binaries in the same APK. When the APK is installed and run on the device, the device automatically picks the appropriate binary files in the APK.
If you have some code optimized for a particular ISA, say a function which uses ARM NEON, you also have APIs in the NDK which allow you to detect which ISA you are running on and dynamically load the appropriate for that particular architecture. However, this is an optional feature. For pure C/C++ code without ASM or platform-specific intrinsics, compiling for multiple ISAs is trivial using the NDK tools.
This is an interesting project for sure. WinGDB is quite similar.
From the rationale page:
"Large numbers of these developers world-wide use Visual Studio as their primary IDE. Either by preference, or other external factors."
I wonder if having fairly good tooling is one of those factors? And if so, will this encourage people to stick to Visual Studio?
I'd recommend developers to try Qt Creator for Android (there's no requirement to use Qt with it if you don't want to). IMHO, for native development it is already good, improving rapidly and has the advantage of being cross platform and Open Source, though it's build system (qmake .pro/.pri) is arguably worse than MSBuild. Once Qbs support is finished I'll happily retract that statement.
Interesting - but to quote from the Android developer website:
Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on. When examining whether or not you should develop in native code, think about your requirements and see if the Android framework APIs provide the functionality that you need.
In general, you should only use the NDK if it is essential
to your app—never because you simply prefer to program in C/C++.
Which continues to annoy me even now.
I recall the fireside android team chat one time (two years ago?) that went something like:
Question: So what about the NDK? You can't beat native for performance...
Android team member: *laughs* ... well, you can't beat java for portability
Comment from audience: Unless you want to use your code on another platform...
<awkward silence, discussion moves on to next question>
Don't forget games, the vast majority of popular games are likely running native code.
I don't have any stats on that, but you can check out the following games made using the open-source C++ framework Cocos2d-x that the developers asked to be featured:
What is like working with the NDK? C++ is the one language that can work on both iOS and Android (and Windows phone?)
Personally, I'd like to get some reuse out of my iOS code. I'd do more C++ if I knew that I could reuse it. Of course, Objective C could actually be portable too.
The most likely reason to use the NDK is when you are using existing C(++) code, for instance from your iOS or desktop versions of your app. For me the biggest advantage is building the app for Win64, using rich tools and a high power testing platform and just run a different make and now I have an Android app.
I used Xcode or the command line flow with (cgdb, the ndk command line tools, and sublime text as the editor). Xcode did ok for editing, syntax highlighting, and compiling but I could never get the debugging working in it. If I could have got the debugging and project setup working Xcode would have been really good, as it was it was a pretty bad experince.
ADT is java and works on all platforms Eclipse works on. Additionally, the NDK (Native Developer Kit) is downloadable for Windows, Linux and Mac. I've personally used Android developer tools with native development on OSX, it works fine.
[+] [-] corysama|12 years ago|reply
I hate to distract, but if this project is of interest to you, you should also check out https://developer.nvidia.com/tegra-android-development-pack It's a one-stop installer for the complete Android native development suite, a CPU profiler, a GPU debugger, Eclipse integration for native debugging and the best Visual Studio integration I've found yet (I have not yet tried Android++).
To my knowledge, Nvidia is doing more to improve the native development experience on Android than any other group on the planet (including Google). This is my plea to ask as many people as possible to try their package and give them feedback just so that they'll be motivated to put even more resources into the project.
It is quite awesome of Natural Motion to release Android++ to the public. Given their "No Hardware Restrictions" feature I understand their concern with relying on Nvidia. However, from working with Nvidia, I'm quite confident that Nv's primary concern is getting people to make high-performance games on Android at all. I would encourage Natural Motion and Nvidia to reach out and find ways to help each other reach their common goal -beyond simply providing friendly competition.
[+] [-] fidotron|12 years ago|reply
However, if you're using C++ for portability for any sort of non-realtime needs you've lost your marbles, and would be better off with JavaScript (no, really) and/or platform specific code to leverage the class libraries of the respective platforms. C++ heavy apps on Android are larger, use more memory, and load less quickly. This isn't obvious if you're used to other worlds, but it is a side effect of how pervasive Dalvik is on the system. Even if most of your app code is in C++ it's still easy to get screwed by a GC pause caused by where you have to interface with the framework.
Much of the underlying problem here is that speed-wise Dalvik just isn't very good. It wasn't even competitive with J2ME VM performance when it first appeared, and took a long time to get close.
With all that said, native debugging has been a sore point forever, and any improvement in that area is welcome.
[+] [-] realharo|12 years ago|reply
[+] [-] nly|12 years ago|reply
Maybe if you're starting from absolutely nothing. If I had non-trivial functionality already written in native code then I suspect I'd rather write JNI bindings than do a complete rewrite in Java.
I'm also skeptical of 'use more memory' and 'load less quickly'. Even the GNU C++ standard library on an x86-64 desktop is a less than a megabyte. I can't imagine that being significant in either of those problem areas.
[+] [-] corresation|12 years ago|reply
Citation required, as this is entirely the opposite of every experience I've had actually building apps that use significant native code. What are you basing this claim on?
There really isn't anything magical about Dalvik (or ART) -- it is a per instance runtime. C++ code doesn't suddenly become heavier or slower to load because of Dalvik.
And of course the overwhelming majority of games are mostly built using the NDK.
[+] [-] kevingadd|12 years ago|reply
[+] [-] fredgrott|12 years ago|reply
Obviously, there is the case where the code shop may have other project assets tied into the VS ecology-dev system but is that the only case?
[+] [-] Pxtl|12 years ago|reply
[+] [-] modeless|12 years ago|reply
[+] [-] duiker101|12 years ago|reply
Oh and has one of the best vim integrations.
[+] [-] piyush_soni|12 years ago|reply
[+] [-] dragontamer|12 years ago|reply
http://newsroom.intel.com/community/intel_newsroom/blog/2013...
I assume the Samsung Galaxy 3 Tablet is a big "x86-Android" platform, which would obviously be incompatible with ARM-Android.
[+] [-] xamlhacker|12 years ago|reply
If you have some code optimized for a particular ISA, say a function which uses ARM NEON, you also have APIs in the NDK which allow you to detect which ISA you are running on and dynamically load the appropriate for that particular architecture. However, this is an optional feature. For pure C/C++ code without ASM or platform-specific intrinsics, compiling for multiple ISAs is trivial using the NDK tools.
[+] [-] jevinskie|12 years ago|reply
[+] [-] RayDonnelly|12 years ago|reply
From the rationale page:
"Large numbers of these developers world-wide use Visual Studio as their primary IDE. Either by preference, or other external factors."
I wonder if having fairly good tooling is one of those factors? And if so, will this encourage people to stick to Visual Studio?
I'd recommend developers to try Qt Creator for Android (there's no requirement to use Qt with it if you don't want to). IMHO, for native development it is already good, improving rapidly and has the advantage of being cross platform and Open Source, though it's build system (qmake .pro/.pri) is arguably worse than MSBuild. Once Qbs support is finished I'll happily retract that statement.
[+] [-] bdfh42|12 years ago|reply
Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on. When examining whether or not you should develop in native code, think about your requirements and see if the Android framework APIs provide the functionality that you need.
[+] [-] shadowmint|12 years ago|reply
I recall the fireside android team chat one time (two years ago?) that went something like:
That's certainly how I feel about it.[+] [-] djh_|12 years ago|reply
I don't have any stats on that, but you can check out the following games made using the open-source C++ framework Cocos2d-x that the developers asked to be featured:
http://www.cocos2d-x.org/games/all?p=8&page=1
[+] [-] melling|12 years ago|reply
Personally, I'd like to get some reuse out of my iOS code. I'd do more C++ if I knew that I could reuse it. Of course, Objective C could actually be portable too.
[+] [-] corresation|12 years ago|reply
The most likely reason to use the NDK is when you are using existing C(++) code, for instance from your iOS or desktop versions of your app. For me the biggest advantage is building the app for Win64, using rich tools and a high power testing platform and just run a different make and now I have an Android app.
[+] [-] Zigurd|12 years ago|reply
[+] [-] leobelle|12 years ago|reply
[+] [-] jaegerpicker|12 years ago|reply
[+] [-] mox1|12 years ago|reply