How to add Raknet to Cocos2d-x - android

I try to add Raknet to Cocos2d-x game engine for android games but I don't know how .
I couldn't find good tutorial about this integration . I can compile and run both of them separately as well , the problem is integration of them .
I think that I should change my Android.mk .
I see these links and some more but I couldn't find them useful :
http://www.jenkinssoftware.com/forum/index.php?topic=5069.0
http://www.jenkinssoftware.com/forum/index.php?topic=3744.0
The Completest Cocos2d-x Tutorial & Guide List
https://code.google.com/p/fellz/source/browse/trunk/cocos2dx?r=7
my cocos2d-x version: 3.2, raknet : 4.x, ndk : r9d

I use Visual Studio and a document about compiler setup in RakNet tutorials. I followed this doc and finally created a DLL form the Raknet sources, put it next to the my game's .exe file, and it worked well.
You should also add Raknet sources to included header files of Visual Studio.
Update:
RakNet is not the best way; try another way like WebSocket or Socket.io. Socket.io is highly recommended and is already used in cocos2d-x sources, but it's not compatible with socket.io 1.X. You can make some changes to Socketio.h and Socketio.cpp to use it with socket.io version 1.X. Also, cocos2d-x says they will consider this issue in the next releases.

Related

Nuget Libray in Unity for other platform

I have a project that used Nuget Libraries and I implemented in Unity using C#. The program worked if I run Unity in Windows, but I wonder is it possible to port this project to another platform using Nuget library inside the code? because Nuget Library is a library for .NET in Windows. I actually want to implement this Nuget Library to LuminOS which can run the application from unity.
If I use Nuget Library in Unity? Is it possible to deploy the games on another platform besides Windows for example for Android, iOS, or LuminOS? Is it gonna work because Nuget package is libraries we use for Windows?
hi i have the same problem except i want to build for android and i have searched for an answer this is what i got:
you should reach to .dll files and put them in package folder and this is the only way it will work on android here is an example:
https://answers.unity.com/questions/743400/database-sqlite-setup-for-unity.html
I managed to make it work some thing you should keep in mind is i think the only way to make it happen is by set your player build settings -> other settings -> scripting Backend to Mono and Api Compatibility Level to .Net standard 2.0

Creating a Xamarin Form Library in Visual Studio Mac

I want to develop a library for Xamarin Forms just like how we do in native iOS and android, like .framework or .a for iOS and .aar and .jar for Java Android.
I researched a lot and saw that we can create a nuget Packages based on Platform dependent environment .. But In my case I want to create a SDK which will only make HTTp calls and hence I don't want to use any platform dependent code .
I also found that we can create .Net Standard Library, but didn't get any useful material or Link to work Forward.
My Requirement is to create a SDK which can be used in Xamarin Forms Project . Can SomeOne Please guide me.
Thanks in advance

how to make a cordova android plugin using external non-builded lib (OpenCV)

I'm trying to create a cordova plugin to use OpenCV on android and iOS.
I am for the moment at the android part.
I downloaded the OpenCV android package, and create a test application with android. That work, so I just need to put that in the plugin.
But I have absolutly no idea about how to import the OpenCV library in the plugin.
Someone know how to do that ?
Thanks in advance
Have you written a cordova plugin in the past? If not, this is probably not the easiest place to start (if you haven't start with the plugin guide from the Cordova team.).
Including JNI (native code) in Android in Cordova plugins is a bit of black art, but you are lucky that someone has gone there before (and abandoned) a
Cordova OpenCV plugin for Android. Study that, and then for iOS it is a lot easier, since you can CocoaPods or just include the library and don't have to worry about C/Java bridge. If all of this is making your head hurt and you have no idea what JNI is then you might want to farm out the writing of this kind of plugin to someone else.
EDIT
I was going to add this in a comment but it was too long:
An apk is a complete App and not a Library.you need to include the various .so files (shared objects) for openCV. If you want to learn how to link a C++ file into an Android app (first step of creating a Cordova Plugin with JNI check out this tutorial. However, since half the work has already been done for you, what I would do is just download the OpenCV Plugin into a directory and then
cordova plugin install
and fix what you need (if you get everything working, think about forking the original project and contribute back to the community :) ).
As stated the plugin for iOS will be similar to other IOS plugins, maybe look at the cordova-cocoapods project, the other cordova-cocoapods project and the OpenCV CocoaPod.

Android NDK with Visual Studio

I'd like to build some native libraries for android using the NDK (native development kit), but i'd like to use Visual Studio 2010 to do it. I've googled quite a bit but haven't found any information on it. Does anyone have any experience with this and know the steps necessary to make this happen? I have CYGWin installed, made sure i get Make (per the NDK instructions), but i'm not really sure of the next steps in terms of setting up the project, compiler in visual studio, etc.
If anyone knows of any write-ups, tutorials, or links to sample projects, that would be awesome, as there isn't much on google yet.
thanks!
Here's another solution, which integrates the NDK fully within Visual Studio. No makefiles. It behaves like a proper Win32 project:
Here's an excellent blog post about how you can configure your environment to debug android NDK code using Visual Studio.
Visual Studio is officially not supported.
Some problems (but not limited to):
MSVS cannot create the proper ARM binaries
Android makefiles (.mk) are not supported by MSVS
There are however, third party solutions:
vs-android
VisualGDB
You might want to check out DS-5 as well, though it's not Visual Studio.
The answer depends on what kind of integration you require.
To just build the native Android code from Visual Studio you can create a new Makefile project, and make it run ndk-build.cmd when you press "build". If you would like to get the error messages mapped as well, you will need to parse the output of ndk-build.cmd and convert it to a format that Visual Studio can udnerstand.
If you want to debug your native Android code from Visual Studio, you will need a third party tool that will control ndk-gdb on behalf of Visual Studio and provide workarounds for several bugs (e.g. rebind breakpoints when libraries are loaded).
You can try our VisualGDB for Android tool that does exactly that - creates projects that wrap ndk-build and controls NDK debugger on behalf of Visual Studio. If you need more information, there is a step-by-step tutorial available.
I have not found a direct clean solution, here is my workaround.
I develop my native code on VS as a static library, and use some test project to try it as a console aplication.
When it is ok, from cygwin I use a little bash script that copies all needed files to the jni folder and launch the standard android ndk make command. (also copy some file to assets folder when needed), producing the executable in the right folder.
To use the pthreads I have linked my projects to pthreads-win32.
The only files I do not compile in VS are the jni code.
I hope this can help you.
There's also a couple of other third party alternatives for developing ANdroid apps with VS in addition to those above. There is the open source dot42 located at http://www.dot42.com and Remobjects, http://www.remobjects.com , which allows you to program in c#, Pascal, and Swift. I have played with the trial of Remobjects and am now starting to play around with dot42.
My use of the remobjects trial allowed me to recreate in c# the first five chapter projects in the textbook of the Android course I took. I haven't had the same success with dot42 so far but I need to find some time to really give it a chance.

Integrating basic android source code into Ecplise

I downloaded the Android SDK and the Eclipse Plugin and installed them. When I however use the "Open Declaration" in Eclipse on basic Android functions and classes such as setOnClickListener or ListActivity it gives me an "Source not found"-Error.
The total Android source code seems to be 2.1 GB. Where do I get the source code of those functions that I call with the API to integrate it into Eclipse?
Check this issue. There is a lot of links explaining how to do it.
The source code is not included with the sdk. If you wish to debug/use android source you need to download it separately from the sdk. It can be found on google's official site here. This site also contains important information about using their source code that you should read.
Was this helpful?
You can see the source code by installing a plugin in Eclipse: http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update/

Categories

Resources