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 »

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 »

Quick Tip: Compression in Flash

While working on one of my projects where I needed compression for transfered data, I hit some very interesting compression libraries. Also the ByteArray class contains compress method, using zlib algorithm in flash player or multiple algorithms in AIR. At the end I decided to use ByteArray.compress() method for encoding vs. PHP gzuncompress for decoding, what works correctly, fast and smooth.

Here is a list of 3rd party compression libraries and other good stuff:

  • AS3 Zip: ActionScript 3 based library for reading and writing zip files
  • FZip: FZip is an Actionscript 3 class library to load, modify and create standard ZIP archives.
  • ASZip: ActionScript 3 library to generate ZIP files
  • LZMA Encoder: AS3 class to compress data using LZMA algorithm.
  • LZMA Decoder: A part of the apparat framework.
  • GZIP: ActionScript GZIP compression library
  • Gzip for HTTPService/URLLoader: Adding Gzip support for Flex/AIR HTTPService/URLLoader
  • airxzip: Zip library for ActionScript3 on AIR

If you know some more, please let me know.

Quick Tip: ApplicationUpdater for Updating AIR Executables

Few days ago I red an interesting article about Auto update for Adobe Air executable. This article is pretty self-explanatory, it is important to notice, you have to use ApplicationUpdater instead of ApplicationUpdaterUI that was designed for .air apps. One thing I was missing there was to make the process even more dynamic by reading the update url from an update.xml file. Long story short here is a piece of code doing exact the thing:

// var updater:ApplicationUpdater;
var xml:XML = updater.updateDescriptor;
var ns:Namespace = xml.namespace();
var request:URLRequest = new URLRequest(xml.ns::url);
navigateToURL(request);

Read the rest of this entry »

Quick Tip: Debugging BlackBerry on Flash Builder 4

After successful installing Playbook simulator and BlackBerry Air SDK, you may wonder how to deploy your app on simulator. Now you have 2 choices. You can use command line and run something like this:

blackberry-airpackager -package -installApp -launchApp -device 192.168.44.129 MyApp.bar src/MyApp-app.xml -C bin-debug MyApp.swf icons/90x90.png blackberry-tablet.xml

… this command compiles .swf file into .bar file and installs on simulator. If you prefer click-and-deploy solution, just go into folder with your blackberry sdk:

.../sdks/blackberry-tablet-sdk-0.9.1/eclipse_for_FB401

and copy all content into your flash builder / eclipse directory.

.../Adobe/Adobe Flash Builder 4

Read the rest of this entry »

SystemMouse Moves And Clicks In Your System

SystemMouse is a class I managed to create for Remotair demo receiver, in order to show how can remote MouseEvent-s be projected into system. Long story short, you can use moveBy() function to move the system cursor and event() function to make clicks. The class is based on NativeProcess. The NativeProcess class and its capabilities are only available to AIR applications installed with a native installer (extended desktop profile applications) means .exe/.dmg file.

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 »

Quick Tip: AIR 2.5 & Security.loadPolicyFile()

After switching my AIR application into new AIR 2.5 SDK, boom! Every single URLRequest threw an IOErrorEvent. No other exception thrown. So I started digging in in order to find the cause and it appeared to be Security.loadPolicyFile() execution (I am reusing some libs containing these lines) that blocked it all quietly. First I tried to do try-catch block over it, but with no success. Than I just removed the lines for AIR project and voilà, everything back to normal again. URLRequests works again. It seems like AIR does not need loadPolicyFile() for URLRequests at all. Interesting that these loadPolicyFile() were targeting total different domain and were able to break any other requests.

Debug & Deploy Flash on Android

It is now a few weeks after I started experimenting with AIR for Android. While watching all the great tutorials about how to make things work (AIR for Android – Part 1, Part 2) and how to debug application running on device (Debug AIR apps on Android with Flash Builder 4, another in french and Flash), I have decided to attach some of my own findings and practices to build, deploy and debug apps.

To start, it is a good practice to setup your environment variable path to Android sdk and AIR sdk:

PATH: ...;C:/Users/Yoz/Work/Android/SDK/2.2;C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.1.0.16076-AIR2.5\bin

Next, the whole certificate thing does not make sense to me because you can/have to create one by yourself. The cert need to be valid for 25 years else Android Market will not accept your application (bye bye real signed certificate from PGP TrustCenter :-( )

Read the rest of this entry »