Can an android app be written 100% in C++?

51 views
Skip to first unread message

Vladimir Florentino

unread,
Dec 6, 2010, 5:16:04 PM12/6/10
to android-ndk
With the new release of the NDK, is it now possible to build an
android game using 100% C++, or is some Java still need?

Also, this page:
http://developer.android.com/sdk/ndk/index.html

Says this:
"C++ Exceptions and RTTI are not supported in the default STL
implementation."

I'm not very familiar with the NDK, and only very little of the SDK,
but should I interpret this as meaning that there is no support for C+
+ exceptions, or that only the STL implementation does not support
exceptions? In other words, are C++ exceptions supported in the NDK?

Gregory Ray

unread,
Dec 6, 2010, 6:13:30 PM12/6/10
to andro...@googlegroups.com
The community has kinda adopted the use of crystax for STL NDK support. I haven't checked out the latest NDK yet but I doubt it has changed from previous versions regarding the Java VM dependency. As far as I know all C++ must be done via the JNI which means a 100% c++ android game would not be possible via the NDK.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.




--
Gregory Ray
Co-founder, Seek Mobile Interactive, Inc.

---

This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential and protected by law from unauthorized disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

Futumsh

unread,
Dec 6, 2010, 8:01:22 PM12/6/10
to android-ndk
It is now possible, but only if you don't care about running on
Android versions prior to 2.3.

See http://developer.android.com/reference/android/app/NativeActivity.html

Also, the latest ndk release does support rtti and exceptions, just
not when using stlport. To enable them, in your Application.mk, set
APP_CPPFLAGS += -fexceptions -frtti
APP_STL := gnustl_static

Gregory Ray

unread,
Dec 6, 2010, 9:59:31 PM12/6/10
to andro...@googlegroups.com
Android versions prior to 2.3 is still the majority of handsets out there right?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Doug Schaefer

unread,
Dec 6, 2010, 10:46:42 PM12/6/10
to andro...@googlegroups.com
Yes, there's a nice chart on the Android site showing the numbers.
Since 2.3 isn't actually release yet, on the SDK, the number is zero
at the moment. But I'd expect the picture to change a lot in a year.

Mike Kasprzak (Sykhronics Entertainment)

unread,
Dec 6, 2010, 10:37:35 PM12/6/10
to android-ndk
> Android versions prior to 2.3 is still the majority of handsets out there right?

Nope! All legacy devices have magically disappeared! :D

But seriously, it certainly looks like I could (some day in the
future) write an Android game completely hands-off of the Java, and
not be worried about some 3rd party maintaining it. Thanks for the
xmas gift Google. :)

Regards,

Mike Kasprzak
Sykhronics Entertainment

Brad Davis

unread,
Dec 7, 2010, 11:55:39 AM12/7/10
to android-ndk

> Android versions prior to 2.3 is still the majority of handsets out there
> right?

About all of them. At least until mid-month...

Dev Eloper

unread,
Dec 7, 2010, 4:11:55 PM12/7/10
to andro...@googlegroups.com
Looking at this native activity stuff, how do you compile the code that they referenced?


--

Dianne Hackborn

unread,
Dec 7, 2010, 5:59:44 PM12/7/10
to andro...@googlegroups.com
On Tue, Dec 7, 2010 at 1:11 PM, Dev Eloper <whydeve...@gmail.com> wrote:
Looking at this native activity stuff, how do you compile the code that they referenced?

That is the native-activity sample in the NDK.

--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Reply all
Reply to author
Forward
0 new messages