Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to create a plugin in Cocos2d for my SDK

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.

like image 700
Hardik Chauhan Avatar asked Dec 23 '15 14:12

Hardik Chauhan


1 Answers

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)-

  • Sample: hello-jni is the best place to start off with code at Github

  • Advanced Android: Getting Started with the NDK


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

  • Cocos2D-X Tutorial for iOS and Android: Getting Started

  • The Completest Cocos2d-x Tutorial & Guide List - Stackoverflow link


Some perfect references for plugin development-

  • How to use plugin-x in android

  • Plugin-x Architecture

  • How to write your own plugin for android

  • PluginX IOS IAP Integration

  • Third Party SDK Integration


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-

  • How to setup Cocos2d-x (Windows and Android)

  • cocos2d-x (iphone-android)/IDE installation and setup under mac os

  • How to set up the Android Cocos2d-x development environment on Windows 7

  • External Tutorials - Contains a bunch of helpful articles & tutorials.


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

  • Integration with Flurry Analytics SDK

  • We use Google Analytics with cocos2d-x extension

  • Countly SDK for Cocos2d-x apps

  • Cocos2d-x Extensions - Github repo

  • cocos2d-x-extensions - Another Github repo

  • List of Open Source Cocos2d Projects, Extensions and Code Snippets - Old but helpful


**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!

like image 127
bozzmob Avatar answered Nov 14 '22 19:11

bozzmob