8

I have created an SDK, currently its for both Android and iOS. But now i also have to give the support in cocos2d platform.

Does any one how to achieve this? I already have working this SDKs working in native. But i am going through the some blogs but cant find any easy tutorial of a documentation or blog to do that.

One thing i know that it requires the knowledge of NDK and JNI, which i have very less knowledge of it.

So can please anyone guide me or give me some link or tutorial about how to create an extension in cocos2d for my SDK.

Thanks.

Hardik Chauhan
  • 2,750
  • 15
  • 30

1 Answers1

7

First of all, I very much agree that finding some thing w.r.t. cocos2d is pretty tough! :)

Having said that, here are some pointers/information on how you can take this forward.

Android Native Development Kit (NDK)

Android apps are typically written in Java, with its elegant object-oriented design. However, at times, you need to overcome the limitations of Java, such as memory management and performance, by programming directly into Android native interface. Android provides Native Development Kit (NDK) to support native development in C/C++, besides the Android Software Development Kit (Android SDK) which supports Java.

  • An amazing and yet simple article with code examples can be found on Android NDK

Best place to start off with NDK JNI(considering you know what they are basically)-


It's better to start off by kicking off with some basic learning of Cocos2D-X-


Some perfect references for plugin development-


Earlier there was a way to Integrate 3rd party SDK into Plugin X, but, recently I see they have moved away from this approach and are using SDKBOX which is supposed to simplify the same.

Here is the best and probably only good reference that we can get for now from the cocos2d official programmersguide.

"SDKBOX is more like a upgraded version of plugin-x, so in short it's just a plugin it's not something runs on a cloud. the reason it starts is because we want to provide a better plugin integration solution for cocos2d-x, but the fact is plugin-x always gets the low priority compare to other shinning new 3D features, so we decide to change that." - Cocos2d-x developer said.

But, SDKBOX is where they develop plugins for you. I think its something like npm for nodejs.


Anyway, Some reference web links that will help you even more-


**Helpful Examples ** to learn SDK development or support from-


**Articles on SDKBOX ** which may help you if you looking for officially hosting your SDK-

Cocos2d-x Solves SDK Fatigue with New SDKBOX Initiative

The Best Way to Integrate SDKs into your Mobile Game

Hope it helps! :)

Happy Coding!

Community
  • 1
  • 1
bozzmob
  • 12,364
  • 16
  • 50
  • 73
  • Thanks for your reply @bozzmob. As i come to know that cocos2d is not as cross platform as phonegap or cordova. it just supports multiple platforms thats it. Is this true??? cant i directly integrate the SDK in android project of cocos2d and use it?? and if it is true than do we need to create a extension of plugin for my SDK to give support? – Hardik Chauhan Jan 04 '16 at 05:17
  • Yes. It's not like phonegap. It just supports multiple platforms. As per the tutorial given above, try using the current Android SDK once for a sample project. If it works as expected, then I guess, there is no transformation to your SDK needed. Else, you may have to follow the architecture defined here - http://www.cocos2d-x.org/wiki/Third_Party_SDK_Integration – bozzmob Jan 04 '16 at 05:28
  • Yes thanks, For now i have done the same thing, I have integrate the SDK directlly in one sample app and it is working just fine. so i guess no need for transformation. – Hardik Chauhan Jan 04 '16 at 05:30
  • Awesome! :) That's good to know. But, going forward, you may have to transform to start using SDKBOX. Hope my solution was useful :) – bozzmob Jan 04 '16 at 05:31