Running on Android
Prerequisites
These software packages are required to run and build the APEX Android projects:
* Android SDK
* Android NDK
* JDK
* Ant
* msys/cygwin (Windows), make (Linux, OSX) - (dos2unix is required as well)
Location of sample libs
The Android sample libs are found in:
Location of sample APKs
The sample debug APKs are found in:
* /samples/AndroidActivities/SimpleClothing/bin
* /samples/AndroidActivities/SimpleDestruction/bin
Running the samples
- Connect the Android device in debug mode and ensure that you can connect to it with adb (the adb logcat command is a good connection test)
- Copy the /media folder to the device’s /sdcard folder (there are extra files than what is required, it has not been pruned to just the sample files)
- Install the apk file: adb install SimpleClothing-debug.apk
To pass command line arguments to the samples, create a /sdcard/media/APEX/1.3/SimpleClothing/commandline.txt file and add different args
- For SimpleClothing: –scene 1 –numactors 5
- For SimpleDestruction: –hallmark –numactors 10
Building the samples
To rebuild the Sample APKs
- Define NDKROOT (path to the NDK supporting NEON instruction set), NXPATH (PhysX path), JAVA_HOME, and ANT_TOOL in /samples/compiler/android9/Makefile
- Makedefs.ANDROID9.mk file contains logic which tries to setup build environment to use latest possible gcc found in the NDK path supplied. You might want to change that logic to reflect your specific cases.
- Run make profile to generate the profile samples (‘make’ utility could be found in msys/mingw package. Add its bin to the $PATH). You can also add ‘-jN’ (N = number of cores/CPUs) option to speed up the build process.
- Edit the /samples/AndroidActivities/Simple[Destruction, Clothing]/local.properties file and change the sdk.dir line to point to your Android SDK folder (forward slashes or double back-slashes)
To install the APKs
- From the /samples/AndroidActivities/Simple[Destruction, Clothing] folder, run ant release install
- The sample should be installed on the device at this point, simply find the NVIDIA PhysX icon and click to run
Note
The sample manifest is set to build an apk file with the profile configuration. To build an apk with a different configuration you will need to edit the manifest.