Want to create a plugin in Cocos2d for my SDK - android

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.

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!

Related

Can you work with Kotlin Multiplatform Mobile (KMM) using Windows for Android part?

I wanted to enable one of my Android project to the new KMM but will deploy only for Android platform for the time being. According to this FAQ page it seems that the plugin works only for macOS. But was confused on the next paragraph stating
The good news is that you can work with cross-platform projects on
Android even without the Kotlin Multiplatform Mobile plugin. If you
are going to work with shared code or Android-specific code, you can
work on any operating system supported by Android Studio.
I am not planning yet to run the iOS part as I am still learning it, all I want for now is to prepare my project so when I am confident with my iOS skill starting it would be easy. I do not have a good Mac device as of now that is why I prefer to use my Windows machine for now which is more reliable for heavy stuff like Android development.
I just found the right place and reference and it is possible according to this documentation

Compile Android app to iOS

Is it possible to create a new iOS app with exsisting sources?
I am working with xamarin in Visual-Studio. I've got a project, an app that runs on Android devices. But can I make a new project for an iOS app with those existing sources? I have a Macbook that I can use to do this. I also have a PC with windows 10 on it. So the hardware/software requierments shouldn't be a problem.
Getting to the point..
Is it possible to transform the project from an Android app to an iOS app without writing any code extra? And how can I accomplish this, any tutorials that I can watch/read?
The code language is C#. The programs that I am using are Visual studio and the xamarin extention.
I've read something about Platform Abstraction and Divergent Implementation on the xamarin ducomentation page, but this couldn't fully answer my question.
Short answer: NO.
Long answer:
There are a quite a few cross platform developing tools out there. Xamarin, like the one you are using, or Cordova. They simplifies the development by "A LOT" but you can't just convert one app to another without writing 0 code. Some of the libraries in one platform do not exist in the other. So, the long answer is that cross platform shortens the development cycle as you do not need to start from scratch on other platform, that does not mean it can completely convert.
P.S. Youtube is your friend, but the difficulty of the transformation solely depends on the scope of your project, as they vary a lot.
I second the other answers.
Furthermore, I'd like to propose to have a look at Flutter.
Flutter is based on Dart language . The framework and your application get compiled from Dart to the Android and the iOS target platform.
Flutter is a product of Google and likely to get the base development environment for Fuchsia, a new OS from Google.
My own experiments with Xaramin ended up kind of frustrating. The development was slow, several times problems with Xamarin itself or plugins made me stop the effort.
At the other side, I created an app with Flutter quite fast. While Dart and Futures might seem at first quite different compared to other concepts/languages, after some time things turn out to be very natural and well designed.
While Flutter originally was based on Material design, Google added an iOS theme using CupertinoWidget.
A simply great feature is the enormous quick development turnaround time: The app under development very ofter adopts within just a second your source-code changes. Flutter/Dart hot reloads changed classes often instantly.
Android Studio is a great and free IDE for Flutter development. Plugins enhance to IDE with Flutter development tasks.
If you have android application written in Java you can use Migeran Analyzer to understand how much % of the code could be reused between android and iOS: https://analyzer.migeran.com/
Once you have the % you can use Intel Multi-OS Engine (free product) to create cross-platform application in Java: https://software.intel.com/en-us/multi-os-engine. It will have module with cross-platform shared code, android specific code module and iOS specific code module

Tips to shift from App Inventor to Eclipse

I am very good with AppInventor to build Android apps. I have good knowledge of C++ and little knowledge of Java and GUI building in Java. Suggest me how should I shift from App Inventor to Eclipse to build Android apps? Which path should I follow? Is building in Eclipse similar to building in AppInventor like defining different components and then handling their events? Or is it much more than that? Please guide me.
There is also the AppInventor to Java Bridge project at java.appinventor.org, details see below
About:
The AppInventor to Java Bridge project is an addition to
AppInventor that creates a Java written version of the application
from an existing application created through AppInventor. After
creating an application through AppInventor,the user can download a
version of the application that is written in Java, which uses the
JavaBridge* library .
What Our Application Can Do:
Create an Android project in JavaBridge using AppInventor
Applications that use texting, internet and/or sound are supported
Limitations:
- Location aware applications not yet supported
- Nested lists are not yet supported, and will produce incorrect code
UPDATE: the newest version of that tool can be found here: java.appinventor.org
Definitely you should check out the "ALTERNATE Java Bridge". The regular one, built originally by the app inventor team has long since been abandoned. Another programmer picked up the torch and has steadily been using, and improving the bridge for some time. I have been using it myself for 2 years and it is fantastic.
The google project is at: https://code.google.com/p/alternate-java-bridge-library/
and the google discussion group is at : http://groups.google.com/group/alternate-java-bridge-library-discussion
I would just go to the google project site above and ready the tutorial. It is very easy to get started, and he is really good about answering questions for newbies (and i can assist with that as well).
You could take a look at the App Inventor Java Bridge. Check out the link for lots of information, also see here...
The Google App Inventor Java Bridge The App Inventor Java Bridge helps
make a transition from developing Android applications with App
Inventor for Android, to developing with Java and the Android SDK. It
lets you incorporate App Inventor components into apps that you create
in Java with the standard Android SDK tools. If you’ve been using App
Inventor and know some Java, then the Java Bridge is a good way to get
started with the SDK, because building with App Inventor components
hides many of the complexities of the Android framework. As you gain
experience, you can switch over to regular SDK development and create
apps that harness the full power of Android.
Here another link:
http://code.google.com/p/apptomarket/ and you also find videos about the Java Bridge on Youtube, for example this one

Is developing an application for Android using Lua only possible?

So I read this article on Mobile Orchard and, as I'm planning on having my first steps in Android development, it got me thinking: is it possible to develop for Android in Lua only? I Googled the topic but found no definitive answer. I know Java is the "base style" for Android but for the coding newbie which I am (elementary Python, basic C++), Lua seems somehow clearer and more friendly. Then here goes my question: can one develop an Android app using Lua only? If so, could you please show me some directions to move from here?
I've been developing a mobile application in Lua to control robots remotely from iOS and Android phones. The app is in pure Lua and runs on top of Mosync platform using MobileLua. There is still some plumbing required, but it's not too complex.
I also have a debugger and a Lua IDE (ZeroBraneStudio) that support debugging of Lua scripts running remotely (including MobileLua scripts running on Android or iOS devices). I provide a demo app you can use as a client to run simple scripts and check remote debugging in action.
[Update] If you are interested in more game oriented options, there are several available: (1) already mentioned Corona SDK, (2) Moai, and (3) Gideros Mobile. There is also Marmalade Quick and Cocos2d-x Lua bindings (for example, quick-cocos2d-x). All these toolkits/frameworks allow to develop in Lua.
Here is a detailed comparison of Moai vs. Corona.
I know this is an older question, but just to correct some misinformation (in the comments) for people who come later, Corona SDK (as of spring 2013) has a Starter Edition which is free -- no splash screen or anything. The main difference between it and the "Pro" version is you can't do in-app purchases in the Starter Edition. But you can use it to create apps for sale, etc. No expiration date on it or anything.
And in answer to the original question, learning Java may allow you to write Android apps, but if you then also want to target iOS you don't have any great options. By choosing something that's cross-platform from the beginning you can target Android or iOS or both. Lua (in any of the flavors already mentioned) is a great base language to learn for mobile development.
The question is what kind of app do you want to build and what skills do you have. If you are already familiar with JavaScript there is Phonegap/Cordova. If you are building games there are a number of frameworks for 2D and 3D which use Lua. Some are free, others have licensing fees but are worth it if it provides a solution to your problem. All have pros and cons. For example I'm not sure if I would want to build an RSS reader in a game framework. Java is just another language, I would recommend just learning Java and the Android framework to start and knowing what is there before adding another application specific framework layer on top.
Corona SDK allows you to write iOS and Android apps in Lua. Its very easy to learn, but its not free.
Edit:
I saw you posted that you found Corona just after I sent my post...
You can try http://scormpool.com/luastudio
Develop and run code on your device including iOS, Android, Mac, Win.
Exporter can help you to make standalone app on listed above platforms.
This may not be useful to the OP, however for other people interested in using lua to write their apps, I'd share my thoughts. So to answer the question:
Yes, you can use only lua to write apps for android using LuaJava from the kepler project (though I don't believe its being maintained anymore). You can create and manipulate Java objects seemlessly, and interact with the Android APIs through lua. You can even create UI elements dynamically using just lua. However, a small amount of java bootstrap code is needed to start the lua VM from your app. The AndroLua project is a great place to start for Android. The creator has done a lot of work making lua work with Android and packaging it all into an app. From experience I can say it works great! However, I would in no way recommend this to a beginner, as it requires a lot of knowledge about java and lua to make things work, meaning more work not less.
For AndroLua, just clone the repo and use that as a base for your own app. Last time I used it, I just imported it into android-studio, and after fixing a few problems with my own setup, had it compiling and running on my device.
If only pure Lua then the answer is no.. unless you want to use a lot of libraries
If you want to make little Android app/games then use a game engine, learning is a step by step process, don't dive straight into the hard part.

Code generation for iOS and android

I'm searching for a framework to create apps for both Android and iOS from one codebase. I'm aware of Appcelarator and PhoneGap etc. However I need a different kind of product. I'm not sure if it exists. I can't find it here or on google.
We are a team of Android and iOS developers and aren't afraid to build natively. What I want is a tool to help me jumpstart development. Preferably a tool where I can create the basic UI and Models and generate native code to use as basis for further development.
Does such a tool exist?
Have you seen Mono??
iOS
Note: Make sure you following the instructions on the MonoTouch website re installation
Development tools (Free): XCode + Interface Builder (http://developer.apple.com/devcenter/ios)
MonoTouch ($399USD): http://monotouch.net/
Register for developer program/app store ($99USD): Register
Android
Note: Make sure you following the instructions on the MonoDroid website re installation
Development tools (Free): Java JDK, Android SDK
MonoDroid (public beta): monodroid-download
Register for developer program/market ($25USD): Register
Don’t forget for the iOS component you’re going to need to go buy a Mac to use.
Have a look at LiveCode 5 from RunRev.
http://www.runrev.com/
Have you checked out DAPP? I like it quite a bit.
http://dapp.kerofrog.com.au/
Yes you can Generate the code for both Android/ios and many more languages using the Tool Swagger
Please Check the tool,this tool gives the basic UI and Models and generate native code to just like your Requirement.
But You have to right the Swaggger Specification file(it will be on Json or Yaml) for that. And after Writing Swagger Specification file You can downlaod the code for Android/ios and other language as well. So kindly follow the document of swagger. You will get clear idea about that.
Here i list down usefull links of swagger :
https://swagger.io/
https://github.com/swagger-api/swagger-codegen
https://editor.swagger.io/
https://swagger.io/docs/
There's a tool called Genexus for Smart Devices, which is a code generator that supports iOS, Android, Blackberry and Windows 8.
However, you need to learn the tool, and I've found it useful only for simple CRUD apps. It does enable extremely fast development of said apps, it's a good fit for simple LOB apps. I've tried it and deployed to Android (haven't tested on iOS or other platforms).
http://www.genexus.com/SD/mobile-application-development?en
If you're experienced with iOS and Android, you'll probably get frustrated though (and I'm sure the code it generates isn't pretty).
I've used the generator for desktop and web .NET and Java, and works reasonably well (with those caveats), so I'm sure the Smart Devices generator will continue evolving.
Take a look at Flutter, from their docs:
Flutter transforms the app development process. Build, test, and deploy beautiful mobile, web, desktop, and embedded apps from a single codebase.

Categories

Resources