Need help adding RakNet to Android Project

Need help adding RakNet to Android Project
0.0 0


I have spent over 40 hours of my free time trying to figure out how to get RakNet compiling and running on android. My lack of knowledge of and Gradle, as well as how the android NDK works, makes this a really hard task to accomplish.

I have tried: RakNet + Android + Cocos2d-x, using the actual source folder of RakNet.
It didn’t work, as there are dependencies that RakNet uses that Android Studio can’t find, and then I receive errors.

In short, if someone has gotten RakNet working with their Android Studio and is willing to make a quick step-by-step newbie guide to getting to working it will save me probably 100+ hours, because at this point I’m considering learning files and gradle files from the ground up so that I can know how to tackle this problem.



i want to know about this too


Hi i have done this, the file is easier than it looks.

you must list the source files and include directories for your app and RakNet. so you don’t have to list every cpp file you can grab all .cpp file in a directory and add them to a list.
Bellow is my for example.

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos/audio/include)

LOCAL_MODULE := MyGame_shared


FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../RakNet/*.cpp)

LOCAL_SRC_FILES := main.cpp 



LOCAL_STATIC_LIBRARIES := cocos2dx_static



$(call import-module,.)