Facebook SSO For Flash & Mobile AIR Apps

facebooksso

This implementation is taken from TrainLord as it runs on web (flash), android and iOS (AIR) platforms. Facebook’s authentication flows are based on the OAuth 2.0 protocol. Its recommended you have general undesrtanding of OAuth protocol prior reading this article.

If you run services on your own backend (like TrainLord does), the main point of whole thing is to securely pair a facebook id and user session. So later, whenever user does a request to your backend it automatically recoginzes the facebook id. In my case I used id and name to create an unique user record in my database so I can save some more user related data (score, etc.).

Read the rest of this entry »

Quick Tip: Key Hash For Facebook Android Application in AIR

facebookcert

It may be a little tricky to setup “Native Android App” section for your Facebook application. Especially the field “Key Hashes”. Facebook provides instructions for acquiring debug version hash but is not very clear about how to get one for signed application. There is a lot of valid answers around the internet, but the one I needed was still missing. Imagine this simple scenario where you export and sign (using .p12 cert) your AIR Android project, you have an .apk file and want to get a key hash for facebook. Then I finally found the answer:

Read the rest of this entry »

YCanvas Remote Controlled By Remotair

At the same time I released YCanvas, I have spotted an interesting starling experiment. I realized I can do this for YCanvas easily with Remotair. Remotair is a concept of transmitting device inputs (gestures, accelerometer, camera etc.) into receiving flash or AIR application. Consists of one transmitting app installed on a mobile device or a tablet and one receiving app running on a PC. In order to pair transmitting and receiving application, RTMFP protocol is used. Implementing remotair reciever into any flash application takes only a few minutes, I spent much more time on touch + multitouch implementation with transitions. At the end of the day, I was able to remote controll YCanvas application with BlackBerry Playbook.

Read the rest of this entry »

Useful links and market url schemas for Android, iOS, BlackBerry

After a few months off from mobile development, I realized I have forgotten all the necessary developer, application and market links for my Android, iOS, BlackBerry applications. Furthermore, it took me some time to gather them all back together as well as market deeplinks for all environments. So, I have decided to put the list together that will help me catch much faster next time.

Read the rest of this entry »

Quick Tip: Installing AIR Runtime To Android Emulator

After I have installed Android SDK on a new machine, I have almost forgotten the steps necessary to run AIR application on Android emulator. There has been some changes within android sdk e.g. adb.exe is no longer located in “tools” dir but rather in “platform-tools”, to create a new emulator you can use SDKManager.exe… and to install AIR runtime on Android emulator, you can take .apk file located in AIR SDK (airsdk/runtimes/air/android/emulator/Runtime.apk) and install it via…

Read the rest of this entry »

Remote Desktop With Remotair

A day ago I published a youtube video about remote Windows control from an Android device. I will try to clarify the process about how it is done. What you need to make this work for you is (1.) an Android device with Remotair application v 0.1.9 (or higher) installed, (2.) Windows with Remotair desktop .exe air application v 0.1.3 (or higher) and (3.) some capture-desktop softwer, VH Screen Capture works good.

Read the rest of this entry »

Remotair

Remotair is a concept of transmitting device input events (gestures, accelerometer, camera etc.) into receiving flash or AIR application. Remotair consists of one transmitting application installed on a mobile device or a tablet and one receiving application running on a PC. In order to pair transmitting and receiving application, RTMFP protocol is used. The receiver API is public and released under MIT license.

You can download Remotair application from Android market (link only works on android devices) or see the Android application details on AppBrain. For a receiving application you may use the demo application located on remotair.yoz.sk or you can build your own one using Remotair Receiver API.

Read the rest of this entry »

Geolocation + Accelerometer = Orientation

In order to get orientation of your android device you need to do “some” math, based on geolocation and accelerometer values. Working with Android native SDK, you are able to get orientation as easy as calling SensorManager.getOrientation(), but when it comes to AIR SDK, you have no access to the native SDK methods. However, thanks to open sources you are able to grab the original source and rewrite the thing into ActionScript. That is exatcly what I have done. The results are GeomagneticField and SensorManager classes. To make this happen you need both AccelerometerEvent and GeolocationEvent values as intput:

Read the rest of this entry »

Quick Tip: How to run Android application from browser?

For now I succeeded with general approach – Android market application. If you go through Publishing Your Applications you will notice there is a url (with market:// scheme) that can be used to navigate user to your application in Android market. Sadly this url works only from Android device not from desktop (404 not found)! So I came up with this code:

var isAndroid = navigator.userAgent.toLowerCase().search("android") > -1;
if(isAndroid && confirm("Do you want to run onBoard Android application?"))
    window.location = "market://details?id=air.onBoard2Android";

What it does is:

  1. it first test user agent if it is an Android device, if so
  2. it asks user to decide wheter to use Android and than
  3. it redirects user into Android market application showing details of your application

From here user can install or open the application. You may try it on http://onboard.yoz.sk (run from Android device).

I was also playing with the idea about how to run my Android AIR application from browser, well normaly for AIR apps you would use install badge or its customized version in order to check if the application is installed already and then run or install it. But I hit a major problem with air.swf not dispatching Event.INIT on Android flash player :-( … I will surely get back into this to discover more.

Quick Tip: stage.mouseX on Android

When working with AIR on Android, I felt into an issue with stage.mouseX (stage.mouseY) returning value 107374182. It seems I am not the only one who experience that, but also Michael Ritchie and Lex Talkington did. This happens after you release touch screen. You may expect that Event.MOUSE_LEAVE would be fired in the right moment, but that sometimes just does not (sometime it does). I did not found any better solution than testing returned values against the static number, so I came up with this piece of code:

if(stage && (int(Math.abs(stage.mouseX)) == 107374182 
    || int(Math.abs(stage.mouseY)) == 107374182))
    return;