Had a little doodle in photoshop. If you ever wanted where cloud computers come from:
Updated egg timer air
Nothing to exciting but I notice I had a bug in my egg timer app. Unfortunately for me i wrote the app using Flash Builder burrito, and I've since moved the final version. So updated/rewrote the app and gave it a little face lift. The android version has been updated however the playbook version wont be updated until Flash builder 4.5.1 so i'm not writting more beta code :-/
TabbedViewNavigatorApplication tabBar location
One of the Application types available in Flash builder 4.5 is the TabbedViewNavigatorApplication. Its a pretty simple but useful starting point which gives you, your navigation for free by creating a button bar at the bottom of the application.
As seen here:
As i'm mostly developing apps for android i'd like to keep it consistent. Although not simple the tab bar can be moved quite easily by creating an Application skin and adding the following code:
/**
* @private
*/
override protected function createChildren():void
{
tabbedNavigator = new TabbedViewNavigator();
tabbedNavigator.id = "tabbedNavigator";
addChild(tabbedNavigator);
tabbedNavigator.addEventListener(FlexEvent.UPDATE_COMPLETE,onChange);
}
/**
* @private
*/
override protected function measure():void
{
super.measure();
measuredWidth = tabbedNavigator.getPreferredBoundsWidth();
measuredHeight = tabbedNavigator.getPreferredBoundsHeight();
}
/**
* @private
*/
override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
{
super.layoutContents(unscaledWidth, unscaledHeight);
tabbedNavigator.setLayoutBoundsSize(unscaledWidth, unscaledHeight);
tabbedNavigator.setLayoutBoundsPosition(0,0);
}
private function reDrawTB():void
{
tabbedNavigator.y = tabbedNavigator.tabBar.height;
tabbedNavigator.tabBar.y = -tabbedNavigator.tabBar.height;
}
Bottle Rocket Dash approved for playbook
The playbook version of Bottle Rocket Dash got approved last night. The best thing about writing an application in Adobe air is I can release it on multi-platforms with very little effort.
You can download the app here
Simple Android Air Highscore (database) example
Flex builder 4.5 makes it pretty simple to persist data within an app.
Air provides the ability to create a SQL lite database, which could be useful for various uses in an application.
In the following example we use the db to score a number and date time stamp. Bit like a high score table.
The example is pretty simple and all the important logic is handled with in a few functions. The init function is called on load, which then calls two more functions. createdb and updatelistresult. The Create db function checks if the database exists. If not it simply creates a new database.
The update list result function runs a simple command and uses the result as the data provider for the list.
You can download the apk here and the source here
protected function init(event:FlexEvent):void {
createDb();
updateListResults();
}
private function createDb():void {
sqlConnection = new SQLConnection();
sqlConnection.open(File.applicationStorageDirectory.resolvePath("hs.db"));
var stmt:SQLStatement = new SQLStatement();
stmt.sqlConnection = sqlConnection;
stmt.text = "CREATE TABLE IF NOT EXISTS highscore (highscoreid INTEGER PRIMARY KEY AUTOINCREMENT, score INTEGER, date DATE)";
stmt.execute();
}
private function updateListResults():void {
var sqlStatement:SQLStatement = new SQLStatement();
sqlStatement.sqlConnection = sqlConnection;
sqlStatement.text = "SELECT * FROM highscore ORDER BY score DESC";
sqlStatement.execute();
var result:SQLResult = sqlStatement.getResult();
listData.source = result.data;
}
private function addRecord():void {
if(Number(num.text) is Number) {
var sqlStatement:SQLStatement = new SQLStatement();
sqlStatement.sqlConnection = sqlConnection;
sqlStatement.text =
"INSERT INTO highscore (score, date) " +
"VALUES (:score, :date)";
sqlStatement.parameters[":score"] = num.text;
sqlStatement.parameters[":date"] = new Date();
sqlStatement.execute();
updateListResults();
}
}
Android fragmentation? what fragmentation
On a lot of new/geek new websites I read a lot about android fragmentation. Some people suggesting it is a bit problem?
My Bottle Rocket Dash game has been live on the android market for less than 48 hours although I pleasantly surprised to see it had been downloaded over 400 times. Although only just over half are active installs. (I’ll just hope they plan on reinstalling it).
Any how I found the graphs that the android market creates quite interesting. Weirdly no devices appear to have an android version of less than of 2.2. Admittedly this is no way near the amount of data to draw any conclusions from. But I thought I would share it:
Bottle Rocket Dash released!
Finally got round to finishing my first Android Adobe Air game. You can download a free and paid version from the marketplace:
https://market.android.com/details?id=air.com.indecentmonkey.BottleRocketDash

https://market.android.com/details?id=air.com.indecentmonkey.BottleRocketDashFree










