diff --git a/README.md b/README.md index d68299c87..e738f2b9e 100644 --- a/README.md +++ b/README.md @@ -191,45 +191,7 @@ Depending on what version you target, you may have to change two defines to not Android ----------------------------------------- - -You will need the latest CYWGIN and the android SDK to build native code on the android. Under CYWGIN, you will need to run ndk-build on a directory for RakNet. - -1. Under cygwin, create the RakNet directory somewhere, such as under samples. -For example, if you create the path `\cygwin\home\Kevin\android-ndk-r4b\samples\RakNet` - -2. I copied the Android.Manifest.xml and other files from another sample - -3. Under jni, you will need the following Android.mk - - LOCAL_PATH := $(call my-dir) - include $(CLEAR_VARS) - LOCAL_MODULE := RakNet - MY_PREFIX := $(LOCAL_PATH)/RakNetSources/ - MY_SOURCES := $(wildcard $(MY_PREFIX)*.cpp) - LOCAL_SRC_FILES += $(MY_SOURCES:$(MY_PREFIX)%=RakNetSources/%) - include $(BUILD_SHARED_LIBRARY) - -This version of Android.mk assumes there is a directory called RakNetSources, for example -`cygwin/home/Kevin/android-ndk-r4b/samples/RakNet/jni/RakNetSources` - -Under RakNetSources should be the /Source directory to RakNet. Rather than copy the files I used junction.exe -http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx - -The command I used to create the junction was: - - D:/cygwin/home/Kevin/android-ndk-r4b/samples/RakNet/jni/junction.exe -s D:/cygwin/home/Kevin/android-ndk-r4b/samples/RakNet/jni/RakNetSources D:/RakNet4/Source - -To unjunction I used: - - D:/cygwin/home/Kevin/android-ndk-r4b/samples/RakNet/jni/junction.exe -d D:/cygwin/home/Kevin/android-ndk-r4b/samples/RakNet/jni/RakNetSources - -From within the CYWGIN enviroment, navigate to home/Kevin/android-ndk-r4b/samples/RakNet. Then type - - ../../ndk-build - -Everything should build and you should end up with a .so file. - -You should then be able to create a project in eclipse, and import cygwin/home/Kevin/android-ndk-r4b/samples/RakNet +Android project with build instructionsis is located in RakNet_Android_NDK folder. Native client ----------------------------------------- diff --git a/RakNet_Android_NDK/README.TXT b/RakNet_Android_NDK/README.TXT new file mode 100644 index 000000000..c1be44ce5 --- /dev/null +++ b/RakNet_Android_NDK/README.TXT @@ -0,0 +1,31 @@ +Android project for Oculus RakNet library. +Initial project version: Viktor Korsun, bitekas@gmail.com + +Copyright (c) 2015, Oculus VR, Inc. +All rights reserved. + +This source code is licensed under the BSD-style license found in the +LICENSE file in the root directory of this source tree. An additional grant +of patent rights can be found in the PATENTS file in the same directory. +--------------------------------------------------------------------------- + +To build Android native libraries run "ndk-build" from THIS directory, or +merge the content with your project. + +Windows build command example: +D:\Soft\android-ndk-r10e-64\bin\ndk-build + +Linux/OS X build command example: +$ ~/soft/android-ndk-r10e-32/ndk-build + +This will produce "libs" folder with shared libraries for platforms: + armeabi + armeabi-v7a + x86 + +The project uses android-9 API, that covers almost 100% of Android devices +by the end of 2015. To raise API (and possibly build additional ABIs) +please edit jni/Application.mk. + +The project has been tested with Android NDK 10e both 32- and 64- bit +versions. \ No newline at end of file diff --git a/RakNet_Android_NDK/jni/Android.mk b/RakNet_Android_NDK/jni/Android.mk new file mode 100644 index 000000000..27b060e7e --- /dev/null +++ b/RakNet_Android_NDK/jni/Android.mk @@ -0,0 +1,8 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) +LOCAL_MODULE := libraknet + +FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Source/*.cpp) +LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%) + +include $(BUILD_SHARED_LIBRARY) \ No newline at end of file diff --git a/RakNet_Android_NDK/jni/Application.mk b/RakNet_Android_NDK/jni/Application.mk new file mode 100644 index 000000000..8ffe14073 --- /dev/null +++ b/RakNet_Android_NDK/jni/Application.mk @@ -0,0 +1,3 @@ +APP_STL := c++_static +APP_ABI := armeabi armeabi-v7a x86 +APP_PLATFORM := android-9