Android NDK Development

jheanley
edited April 2013 in Native
I have already written a fair amount of code in C++ to use the native language on Android devices and help me keep a common game code base between the client and server. Is there any support for Linux/c++ on embedded devices yet?

Comments

  • An Andoid NDK SDK is in the making. It is in pre-alpha stage - but it is not high priority right now. It will take at least 2 months to be in beta stage.

    FYI - we just released a Meego SDK (https://meego.com/) and we are about to release an Airplay SDK (http://airplaysdk.com/).
  • Thanks for the fast reply, so if I was to start using the win32 sdk is there a way I can continue to use C++ while I wait for the NDK version to be released?
  • jheanley wrote:
    Thanks for the fast reply, so if I was to start using the win32 sdk is there a way I can continue to use C++ while I wait for the NDK version to be released?
    Yes. The C++ Client is available with, among other SDKs, the Win32 SDK and the API is the same for all C++ Client platforms (as long as you are using the same version of the Client on every platform). So you can start with the Win32 SDK and already do nearly all the work and then later you can just switch to NDK and the same code should work out of the box on both Win32 and Android NDK, as long, as you have updated to the most recent Win32 SDK (although you will have to set up your project-file for Android again, of course). The only work, you could not already do with the Win32 SDK, is performance checking on android devices.
  • Bump. Is this coming soon? That last reply was in May and I would love not to have to write unnecessary JNI wrappers.
  • Yes. Its coming soon. We target for a first release early next month.
  • Awesome. Timing couldn't be more perfect. Also will this include the ability to talk to the cloud servers with the load balancing algorithms like the recent iOS release?
  • Yes, it will.
  • Is android SDK v3 work on cloud?
  • See post above yours: "Yes, it will."
  • Here finally is the first release of our ndk clients:
    http://dl.dropbox.com/u/4296291/Photon- ... ud_SDK.zip
    http://dl.dropbox.com/u/4296291/Photon- ... a2_SDK.zip

    Known issues:
    - No support for older OS than Android 2.3.0, yet, however support for 2.2.x is in the making
    - unicode support only for ascii characters, encodet as unicode, not for other unicode characters, yet, full unicode support is in the making
    - realtime demo port to ndk is in the making, but not 100% finished, yet
  • Hi !

    i still got this error message when trying to ndk-build the demos :
    Cannot find module with tag 'photon-cpp-prebuilt' in import path    
    Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
    
    any way to resolve this ? thanks

    note : i'm using Photon-AndroidNDK_v3-0-4-4_SDK
  • Hi rhapsodixx.

    Thats the typical error message, that the NDK will print, when there is a problem related to paths.

    Please navigate into pathToTheDemoOfYouChoice\android\jni and open Android.mk in a text editor.
    Near the end of the file their should be entries containing "import-add-path-optional". Change them to instead contain "import-add-path". Afterwards rebuild the demo. The build output should now give you some more info about which path can't be found.

    If you setup your app, please make sure, that the paths to Photons' Android NDK client libs in your apps Android.mk match the actual relative position of those libs to this Android.mk on the filesystem on which you try to build.
  • Thanks Kaiserludi !

    however i still encounter an error like this :
    Photon-AndroidNDK_v3-0-4-4_SDK/Demos/demo_advanced/android/../../../Photon-cpp/photon-cpp-prebuilt/../inc/LitePeer.h:10,
                     from ../inc/Listener.h:1,
                     from ../inc/Photon_lib.h:1,
                     from jni/../../src/AdvancedApplication.cpp:2:
    

    it seems the build process couldn't find the required header ?
    and it still ignoring some files :
    /Photon-AndroidNDK_v3-2-1-1_SDK/Demos/demo_advanced/android/../../../Photon-cpp/src/android    
    
  • Have you changed the location of the demo or of the libs inside the SDK?
    If not, then please don't change the paths to those files in the Android.mk makefile.

    In an unchanged 3.2.1.1 SDK the makefile of demo_advanced contains the line "$(call import-add-path, $(shell pwd)/../../../../Photon-cpp/src/android)" If I drop one of the "..", so that its just "$(call import-add-path, $(shell pwd)/../../../Photon-cpp/src/android)", without replacing the lib accordingly, then I also get the NDK_MODULE_PATH undefined issue and those warnings for ignored paths.

    Maybe its best when you start with an unchanged SDK and then document your changes that make it not building anymore so that we can see where the problem lies.