Android NDK?

Added by Steve Sharp over 4 years ago

Has anyone made any rules for the jni -> apk step ?

I have patched up the latest nextgen code to the point im generating shared libs and was about to embark on building something to generate the full apk step, but if someone has done the leg work... :)

I'll send through the changes I had to make to get it to compile once ive cleaned these bits up.

Steve.


Replies (1)

RE: Android NDK? - Added by Steven Craft over 3 years ago

I have shipped a few games on Android using some Jamfiles that handle the entire build process for Android. I have attached them here. I am not sure how ready they are for full time production or merging into the mainline JamPlus tree, but feel free to use them yourself. For your reference, here is some of the Jam on the project side:

#######################################################################################
  1. 1. Game Java project. #######################################################################################

JAVA_SRCS =
com/company/game/global/Game.java
com/company/game/global/GameLauncher.java
;

#######################################################################################

SubDir Root Engine Android Java Game;

#######################################################################################

Java.SourcePath GameJava : src ;
Java.Resources GameJava : res ;
Java.Assets GameJava : assets ;
Java.Manifest GameJava : AndroidManifest.xml ;
Java.Package GameJava : com.company.game.global ;
Java.LinkJars GameJava : SharedJava ;
Java.NativeLibrary GameJava : Game ;
Java.Sign GameJava : $(PiRoot)/Engine/Android/company.keystore password name ;
Java.Application GameJava : $(JAVA_SRCS) ;

####################################################################################### ####################################################################################### #######################################################################################

The above is using native code from 'Game' which is the target on the native side.
The above is using another Java project 'SharedJava' which is defined something like the below:

#######################################################################################
  1. 2. Shared Java library project. #######################################################################################

SHARED_JAVA_SRCS =
com/android/vending/billing/IMarketBillingService.aidl

com/android/vending/licensing/AESObfuscator.java
  1. Loads more files here
com/facebook/android/AsyncFacebookRunner.java
  1. Loads more files here
com/localytics/android/Constants.java
  1. Loads more files here
com/company/shared/AppRater.java
  1. Loads more files here
com/tapjoy/TapjoyAwardPointsNotifier.java
  1. Loads more files here
    ;

#######################################################################################

SubDir Root Engine Android Java Shared ;

#######################################################################################

Java.JarDirectories SharedJava : libs ;
Java.PrebuiltJars SharedJava :
acra-4.2.3
AdWhirlSDK_Android_3.0.0
FlurryAgent
GoogleAdMobAdsSdk-4.1.0
GoogleAdView
libGoogleAnalytics
MMAdView
scoreloop-core
twitter4j-core-android-2.2.5
;
Java.SourcePath SharedJava : src ;
Java.Resources SharedJava : res ;
Java.Manifest SharedJava : AndroidManifest.xml ;
Java.Package SharedJava : com.company.shared ;
Java.Library SharedJava : $(SHARED_JAVA_SRCS) ;

####################################################################################### ####################################################################################### #######################################################################################

You can note I've put attempted supported for:
- Building Java files
- Building Aidl files
- Packaging resources (both from Java libraries and Java application projects)
- Linking in native code (for both arm and x86)
- Dependencies (almost certain this isn't 100%, but it works for the cases I have thrown at it)
- Generating final APK (there is actually a bunch of steps to get an APK)

I don't know if I have provided enough information for this to be helpful; if not let me know.

(1-1/1)