Android


How to create a Native Android Plugin for Unity

Building a Unity plugin for Android in Java is pretty straightforward, although if you have never done it, this is what you need to know. Assuming that you have Unity installed on your machine and you have already started a project, download and install the Android SDK with the ADT Bundle, this also contains Eclipse which will be used to create the JAR file. – Set up the project Open up Ecplise and create a new Android Application Project, name it as you wish, make sure to use the same package name you used in Unity Player Settings. * Just as in Unity: And include the “classes.jar” that you can find in this folder: “C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androiddevelopmentplayer\bin\classes.jar” To include a JAR right click on the project and click “Properties” then… [Read more »]

Android_Unity_Plugin

Create an Air ANE for Android to dispatch background tasks

If you are using DIRECT or GPU mode with Adobe Air you probably have already noticed that once the app goes in background it stops firing any kind of Event. This means that any task that dispatches Event will stop working. Luckily it is still possible to dispatch Events from an ANE. In this post I am going to create an ANE for Android that dispatches an Event every second which triggers a callback on the AS3 side. Assuming that you have already downloaded the Android SDK, open Eclipse and create a new Android Application Project naming it BackgroundTasker, also if you want change the Package Name, I changeds mine to com.lorenzonuvoletta.backgroundtasker. Click Next a bunch of times and you should have your project setup. You can also go ahead and delete… [Read more »]

flash-air-android

Create a cross platform game with Cocos2DX and C++

If you like to code in C++ and you are interested in building a cross platform game, there is a library out there you can use, it is called Cocos2DX. The cool thing about it is that “theoretically” you write the code once and it should work on any platform… In practice it gets a little complicated, but with a bit of stubbornness anything is possible. There is a big list of games already using it and I guess now one of the most famous is Hero Academy (which I am not sure why they have not released on Android), also Glu mobile seems to like using it. You will not be able to find huge amounts of tutorials online, and the official website is confusing at best, although there is one that is pretty… [Read more »]

cocos2dx_portrait

Air Android/iOS – Launch your App from the browser

Adobe Air gives you the opportunity on iOS and Android to create a personal URL that if called from a normal browser will launch your app instead. This is particularly useful if you are redirecting your users from your App to a website, and then you want them to return on your App after they have completed a particular operation. The cool part is that if you are listening for the INVOKE event on your App you can also catch some arguments that the website is sending back.

How to do it Lets say your personal URL is “awesomeapp“, every time you use that name instead of the usual “http” it will open your App. For example, if you write “http://www.google.com” in a browser, it will redirect to the… [Read more »]