31 July 2010

Android Fragmentation

I talked about it last times, Android's fragmentation is a shame because your mobile will be updated to the last android version only when manufacturers want to.

I found an 'official' reply of Google about this problem during Google IO. Something like
Sorry, it's a shame but we can't do anything about this

So bad... :(

27 July 2010

Debug a Mobile Flash project using Flash Builder, Flash CS5 & Device Central CS5

Despite the poor bridge implementation between these 3 products, I HAD to find a way to debug Flash 10 mobile code using Flash Builder. Debugging using Flash CS5 is just insane ;)
I finally found 2 ways to do this, based on the same discovery but dependant on the project type.
I'll first explain for a Flash professional project, ie based on a .FLA/.XFL file

the Flash part
Create a Flash project using the previous method (and throught Device Central)
On Flash CS5, select File > Publish settings
on Flash tab, be sure to check "Permit debugging"
On Flash Builder, publish the project (Alt+Shift+F12 or the first Flash icon in toolbar)
You now have a Flash professional project on Flash Builder, which generate a SWF with debug data but doesn't launch Flash CS5
(reminder : don't forget to uncheck the option before deployment !)

the Device Central part
Create a debug.bat batch file on your Flash project folder with this line :

"C:\Program Files (x86)\Adobe\Adobe Flash CS5\Device Central\adcdl.exe" "<mobileSettings><testDevices><testDevice id="%1" selected="yes"/></testDevices><contentType id="HTMLembedded"/></mobileSettings>" %2

Edit Flash CS5 folder path if needed and remove any line break (it MUST be one full line)
This is the command line (used by Flash CS5) to open an SWF on Device Central CS5 with a specific mobile
%1 is the first parameter and is the mobile profile ID
%2 is the full path to the SWF file
open C:\Users\<you>\AppData\Local\Adobe\Adobe Device Central CS5\Devices\<your_device>_Main.xml to get the mobile profile ID
for example, the Nexus One id is 1494, retrieved from Google_Nexus_One_Main.xml :

<adp:deviceProfile xmlns:adp="http://ns.adobe.com/devicecentral/profile/" id="1494" modelVersion="3.0" ....>

Still on Flash builder, add an External tool with Run > External Tool > Open external tools Dialog...
Add a new program (DC for exemple) with these info
In Location, Browse workspace up to your debug.bat
=> this will result in something like ${workspace_loc:/<projectname>/debug.bat}
Define Working directory to ${workspace_loc:/<projectname>} if you load external assets
In Arguments, add the mobile ID (first arg) and the full path to the generated swf file (second arg)
=> this will result in something like 1494 ${workspace_loc:/<projectname>/<file>.swf}
Congratulations! You are now able to open the SWF on Device Central directly from Flash Builder!
(reminder : you'll need one external tool per Flash project since I didn't find a way to make it dynamic using variables)

The final tricky part
Import this Flash Builder project : DebugLauncher.zip
Build the project, which will create the needed files in bin-debug
On project properties, add a new Run/Debug > Web Application
Do not use the default value (bin-debug\DebugLauncher.html) but bin-debug\fake.html
fake.html is an empty HTML (ie w/o Flash) so if you try to debug DebugLauncher, Flash Builder will be in debug mode, waiting for a Flash with debug informations to be loaded.
(reminder : you'll only need one DebugLauncher, not one per Flash project)

Mix the 3 parts
Always open these 2 projects (DebugLauncher and <your fla project>)
When you want to debug, publish your flash (Alt+Shift+F12) -> this will generate a debug swf file
open DebugLauncher.as in editor (mandatory else it will try to debug your flash project file)
launch a debug session of DebugLauncher -> this will put Flash Builder on debug mode
close the browser this will open
Launch the external tool -> this will launch the swf file on Device Central
Close Device Central when finished (mandatory since Device Central finally crashes when you try to launch while it is alread launched !)

Final notes
The process is a hack, it's not that easy to handle and you need to go throught 3 steps to debug (against one : "debug") but it's, for me, easier and less buggy than the 'official' process
I tried to make a better external tool but I wasn't able to find a way to retrieve the full swf file from the current project.
External tool location and arguments can't use double quote, so I had to use a batch file....sorry for Mac users but I don't know how to do this on Mac (using a shell?)
EDIT : find a way on Actionscript project mode

Coming soon See also the Actionscript project way

26 July 2010

Flash game portals ready for Froyo ?

From Emanuele, an interesting review of the Flash game portal ready for Froyo.

I was so happy that I tried myself on the HTC Desire and, suddenly, the dream disappears : almost every game avaible on ArmorGames are old flash web games, not optimized for mobile (using cursor, small text, drag'n'drop! ....)

It's everything but not serious!
"He! look! We have a lot of games for mobile!...well...a lot of games which kinda work on mobile..."

Hopefully you'll find a lot more games in end september, thanks to the current contests...

How to use Flash Builder + Flash CS5 + Device Central CS5 ?

To code on Flash Builder, design your asset on CS5 and test on Device Central CS5, you need to follow these steps from DevNet

Just keep these in mind to make a DeviceCentral valid file
To create a new file, use File>New and select 'Adobe Device Central' template, then select your mobile targetted (Nexus One)
Be sure to check Debug>Debug animation>in Device Central (yes, you'll need to check it EVERYTIME you'll open the fla....)

The first time I tried, I was unable to make it works on my own computer :
Flash CS5 knows Flash Builder is available (since the dialog box to create the document class name has the Flash Builder option) but it is unable to open it.
It also tried with Flash Builder already opened without success.
I retried several times with success but I met a lot of the problems I list below....
This method makes it easier to create the fla + project + document class but, unfortunatly, it breaks something else :(

Problems you'll probably meet:
- If I follow these steps one by one, sometimes it works sometimes no. Why ? I'm pretty sure it's because FlashCS5<->FlashBuilder bridge is buggy as hell!
- the SWF is launched 2 times on DeviceCentral => close everything and retry
- FlashBuilder keeps coming on front while debugging => close everything and retry (sometimes only DeviceCentral is enougth)
- Flash Builder opens SWF on projector not Device Central => launch the debug at least one time from FlashCS5 and check Debug>Debug animation>in Device Central on Flash CS5 (it seems FlashCS5 doesn't know if a FP10.1 file is for mobile or web)
- Flash CS5 complains my Fla doesn't contain AS code => check fla document class
- Flash Builder keeps trying to 'Publish Flash professional file' on Progress window => Flash CS5 doesn't inform Flash Builder back (who say buggy?)
- When debugging using breakpoint, debug session occurs on Flash CS5 not Flash Builder => I didn't find a workaround on this one, hC)las :(
- Why not create the fla from Flash Builder ? => I would be very interested in finding how ?! Why Adobe doesn't let us create a fla with correct document class is a mystery for me...
- DeviceCentral crashes often when I launch debugging => yeah...I know :(
- if you don't follow this method and try create the project yourself, you'll need to add link to the classes yourself

Personnaly, I was REALLY waiting for this feature....but I don't see any difference with the several hacks available for Flash CS4 (using JSFL or Ant).
Even worst! you can't adjust it for your own needs!

24 July 2010

When your Android phone will support Flash 10.1?

From Computerworld, something like an up-to-date list of the future update of each Android phone to Froyo.

This is linked to my previous post about contests : there is actually NO release date of Flash 10.1 (via Froyo) for each Android phone.
This point another problem about Android : Google lets phone manufacter (even HTC!) make their own OS, or at leat GUI, BASED on Android.
It means everytime Google launches a new version of Android, these manufacters must patch their own version....which mean times and money.
After the screen fragmentation which came with Android 2.0, we now have the OS fragmentation...very bad!
The solution will be a classic Androis OS for every phone (no HTC sense nor Motorola Sensor) but, in that case, what will make the (marketing) difference between a Sony and a HTC ? What will make you buy a Motorola over the latest Samsung ?
Design, power, memory, dedicated Android apps,... ?
I doubt it will be enought for marketing...(only Apple could succeed to sell a phone only using its design)

I personnaly bought a HTC Desire over the Google Nexus One because of HTC Sense (UI is VERY important for my wife)....it seems developer should ALWAYS buy one Google phone to be up to date...
So sad I don't live in USA to get free Nexus One at some Adobe event :(

22 July 2010

Optimizing Flash 10.1 swf

From Thibault, an eseminar recording about optimizing Flash for FlashPlayer 10.1 (memory, weight...)
A must seen if you want to produce/convert optimized Flash game

Contests to move Flash web game to mobile

I think you already knew, but there are actually 3 contests supported by Adobe.

It seems Adobe is ready to spend some money to answer to Steve Jobs :
"There are more games and entertainment titles available for iPhone, iPod and iPad than for any other platform in the world"

"Flash was designed for PCs using mice, not for touch screens using fingers"

I was pretty busy fighting with Flex4 and LCDS these months, so I'm more than happy to spend some times on Mobile games!

2 things to keep in mind :
1- It's for Flash Player 10.1 and, right now, there isn't a lot of devices updated to Android Froyo yet (apart Google Nexus One) so it will be hard to test on real device. On Kongregate, you could even increase your chance to win if you release an AIR version...using the private beta one available (read 'not public released yet'
I don't know why Adobe doesn't wait 2 or 3 months more to launch these contests...the egg or chicken dilemna ?
2- It's AS3 (at last!) and, right now, Flash builder 4 is the best tool to code on AS3...but, unfortunatly, the so waited "Flash Builder integration" in CS5 is very hard to use (it's more a hack than a feature!)

18 July 2010

Pro Android Flash Games books

It seems a book related to AIR games on Android is coming soon.
Pro Android Flash Games: Developing Flash Game Apps for Android-based Smartphones and Tablets

Author : Scott Janousek, Jobe Makar
Release date : December 2010

More related to RIA (apps), another book will be released one month before
Pro Android Flash: Building Rich Internet Flash and JavaFX Apps for Android Smartphones and Tablets

Author : Stephen Chin, Oswald Campesato, Dean Iverson
Release date : November 2010