tag:blogger.com,1999:blog-4534678275694985108.post5530353641752068111..comments2023-06-28T01:36:38.831-07:00Comments on RazzleGames Graphics and GameDev Blog: Development on Android NDK Tutorial - Gluing C++ Native Code to JavaKyle Lucehttp://www.blogger.com/profile/02064286719528528074noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-4534678275694985108.post-91221263994176968112013-06-15T08:09:14.177-07:002013-06-15T08:09:14.177-07:00FYI, the same restrictions apply to using a pure N...FYI, the same restrictions apply to using a pure NativeActivity (must be API >= 9 and all that).Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-6137895427312632072013-06-15T08:08:34.169-07:002013-06-15T08:08:34.169-07:00Hey, I found a way to get access to the AAssetMana...Hey, I found a way to get access to the AAssetManager in a pure native activity!<br /><br />I guess you can access it from the android_app structure, which is passed to android_main.<br /><br />Pretty cool! Just something like this:<br />AAssetManager* am = app->activity->assetManager;<br /><br />Check out the gamekit android sample for more usage info:<br />http://code.google.com/p/Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-49342753460041036662013-06-01T08:55:13.811-07:002013-06-01T08:55:13.811-07:00Yes, you can use NativeActivity, which is availabl...Yes, you can use NativeActivity, which is available in API level 9 and you can do everything in C++. I was targeting older devices also, so I opted not to go that route also for a few other reasons.<br /><br />There have been small bumps in the road going full Native on Android. E.g. getting access to assets in the APK is one issue. To solve it, most examples I have seen use JNI (either Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-70496848804362615432013-06-01T08:30:14.131-07:002013-06-01T08:30:14.131-07:00I thought that in the new NDK updates JAVA or JNI ...I thought that in the new NDK updates JAVA or JNI wasn't necessary at all and we could port directly from C++.<br /><br />And yes like someone else said previously, the information about this topic is scarce. Thank you for the info.Javier Pajuelohttps://www.blogger.com/profile/04398143595742388618noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-46725827511928448942013-01-01T23:01:51.851-07:002013-01-01T23:01:51.851-07:00The stuff you are writing blows out my mind.
get t...The stuff you are writing blows out my mind.<br /><a href="http://www.oneclickroot.com/how-to-root-android/" rel="nofollow">get the facts</a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-81006322893728196312012-10-21T22:22:27.783-07:002012-10-21T22:22:27.783-07:00This blog is truly awesome in all aspects.
a total...This blog is truly awesome in all aspects.<br /><a href="http://corrinseligman.tripod.com/is-rooting-essential-for-android-phone.html" rel="nofollow">a total noob</a><br />Cool boyhttps://www.blogger.com/profile/04454772363979643088noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-15498273595823995962012-09-30T13:36:59.488-07:002012-09-30T13:36:59.488-07:00Thanks Kyle, I understand it now.
I suppose ther...Thanks Kyle, I understand it now. <br /><br />I suppose there's no harm in renaming certain API calls to make your code a little easier to handle too. Good stuff! :)<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-2123203264907689742012-09-25T20:44:41.087-07:002012-09-25T20:44:41.087-07:00BTW, there are not two code bases. I just want to ...BTW, there are not two code bases. I just want to be extra clear about that. They are the same code base. You don't want the develop, merge back, develop, debug, etc headache! :)Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-66659034839952070512012-09-25T20:44:02.620-07:002012-09-25T20:44:02.620-07:00This comment has been removed by the author.Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-54807672755275700082012-09-25T20:42:41.008-07:002012-09-25T20:42:41.008-07:00I also do this for some functions that are not nam...I also do this for some functions that are not named conventionally in OpenGL ES on android:<br /><br />/// Function name remappings from OpenGL to OpenGLES<br />#ifdef ANDROID_NDK<br />#define glOrtho glOrthof<br />#endif // ANDROID_NDK<br /><br />// Now here the orthographic projection acts as expected <br />// with the correct function name mapping:<br /> glOrtho(0, aspect*40.0f, 0, 40.0f,Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-36658039984416193642012-09-25T20:38:31.775-07:002012-09-25T20:38:31.775-07:00No, I mean develop both at the same time. It real...No, I mean develop both at the same time. It really isn't too much extra effort. I do a joint GLUT/SDL (I am switching to SDL) and Android game. The opengl calls are kept very standard so they work with Opengl ES and for any JNI parts, I ifdef them in for the Android version only.<br /><br />E.g.:<br /><br />// All JNI call back declarations<br /><br />#ifdef ANDROID_NDK<br />#ifdef Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-12037290593383286842012-09-25T14:48:32.076-07:002012-09-25T14:48:32.076-07:00"However, I recommend doing parallel PC port ..."However, I recommend doing parallel PC port if doing graphics"<br /><br />You mean doing your game on a PC then converting it to Android?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-15234442819020805792012-09-13T16:50:23.418-07:002012-09-13T16:50:23.418-07:00Sound = doing. on a phone, auto correct. lolSound = doing. on a phone, auto correct. lolKyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-88339170141814239362012-09-13T16:43:54.710-07:002012-09-13T16:43:54.710-07:00No problem! Let me know if you have any questions...No problem! Let me know if you have any questions. <br /><br />I am meaning to do a gdb tutorial for android. However, I recommend sound parallel PC port if doing graphics. A little more work but way easier to debug Game logic locally. Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-10566401566662809512012-09-12T18:20:31.237-07:002012-09-12T18:20:31.237-07:00This info is rare, I have been searching the web f...This info is rare, I have been searching the web for over an hour for GCC + C++ and Android, thanks Kyle, this has been worth the all the searching!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-2271603860259898342012-09-09T11:22:06.721-07:002012-09-09T11:22:06.721-07:00Ah, thanks again. Looks like a bug in GCC. Any tim...Ah, thanks again. Looks like a bug in GCC. Any time you get an internal compiler error or the like, it is indicative of an internal problem. Else, you'd get a productive error message on the source code we were trying to compile. <br /><br />http://stackoverflow.com/questions/11980870/error-on-building-android-ndk-assets<br /><br />I suggest holding off on that r8b compiler, looks like there Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-68893418569982895702012-09-08T19:49:40.877-07:002012-09-08T19:49:40.877-07:00Compile thumb : png <= pngrtran.c
/extra/home/...Compile thumb : png <= pngrtran.c<br />/extra/home/love/Android/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -MMD -MP -MF ./obj/local/armeabi/objs-debug/png/libpng/pngrtran.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscaleAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-28502998445190672952012-09-08T00:37:54.302-07:002012-09-08T00:37:54.302-07:00Thanks anon. Could you post the compile error?Thanks anon. Could you post the compile error?Kyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-33830172127660531802012-09-07T21:10:28.999-07:002012-09-07T21:10:28.999-07:00Very informative post. As an FYI, this breaks the...Very informative post. As an FYI, this breaks the compiler in the r8b version of the Android NDK, but works fine in the r8 version.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-41947646827441856262012-08-20T06:09:51.570-07:002012-08-20T06:09:51.570-07:00very informative post indeed .being enrolled in ht...very informative post indeed .being enrolled in http://www.wiziq.com/course/5776-object-oriented-programming-with-c<br />i was looking for such articles online to assist me and your article helped me a lot. i really like that you are providing such information.sarahhttps://www.blogger.com/profile/00012164643720802818noreply@blogger.comtag:blogger.com,1999:blog-4534678275694985108.post-44819598806740763562012-06-03T16:23:12.866-07:002012-06-03T16:23:12.866-07:00Thanks Jack! Please be sure to see my repository ...Thanks Jack! Please be sure to see my repository example code too, you can download and play with the code from these posts :) <br /><br />http://code.google.com/p/razzlegames-android-ndk-tutorial/source/browse/#svn%2FtrunkKyle Lucehttps://www.blogger.com/profile/02064286719528528074noreply@blogger.com