Archive

Archive for the ‘AIR’ Category

Air Application Auto-Update

July 30th, 2008

There is a SDK at Adobe Labs with a beta of Air Application Updates. There are 2 ways, using the UI update and the headerless update. The headerless allows you to make updates and checks without the end-user knowing the checks.

Lets make a small example.

Short Description:
1.) Local AIR Application read local config file.
2.) The config file points to external (online) config file.
3.) Online Config file holds online released update and path to file.
4.) If file is never, download and upgrade

air-updater

1.) Download the SDK
1.1) Download the files from Adobe Labs AIR Update Framework.
1.2) Put the 2 *.swc file into your app-folder/sdks/3.0.0/libs/air

2.) Create a Project
2.1) Well, you know how to create a Flex AIR Project =)

3.) The Local Settings File
3.1) Create an XML file in the project (mine is config.xml)
3.2) Change the url path where the online pointer file is.
3.3) If using the GUI version of update change the settings in defaultUI

<configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0">
	<url>http://www.undefined-type.com/update-buxfer.xml</url>
	<delay>1</delay>
	<defaultUI>
		<dialog name="checkForUpdate" visible="true" />
		<dialog name="downloadUpdate" visible="true" />
		<dialog name="downloadProgress" visible="true" />
		<dialog name="installUpdate" visible="true" />
		<dialog name="fileUpdate" visible="true" />
		<dialog name="unexpectedError" visible="true" />
	</defaultUI>
</configuration>

4.) Create the Online Pointer File
4.1) Create the XML file, (mines called update-buxfer.xml) this is so that I put all my pointer xml file at 1 place on my server.
4.2) Fill the file with example code.

<update xmlns="http://ns.adobe.com/air/framework/update/description/1.0">
  <version>1.4</version>
  <url>http://undefined-type.com/apps/buxfer_1.4.air</url>
  <description>
           <![CDATA[
               This update enables automatic updates in the future.
           ]]>
   </description>
</update>

5.) The actual file
5.1) Don’t forget to put the actual new *.air file on the server where you are pointing =)
5.2) When building make sure as well to change the “version” in the application xml file.

6.) The Code
6.1) When you want to check the update just add this code.

import air.update.events.UpdateEvent;
import air.update.ApplicationUpdaterUI;
 
private var updater : ApplicationUpdaterUI;
private function check():void
{
	var confFile : File = File.applicationDirectory.resolvePath("config-template.xml");
	updater = new ApplicationUpdaterUI();
	updater.configurationFile = confFile;
	updater.addEventListener(UpdateEvent.INITIALIZED, onInit);
	updater.initialize();
}
 
private function onInit(event:UpdateEvent):void
{
	updater.checkNow();
}

AIR, Flex

Buxfer Sweden Bank Converter

July 22nd, 2008

I figured that I would start keeping track on my personal bank accounts. Where does my money go anyway, why is it always empty ???

So after a little surfing on the web I found http://www.buxfer.com

Wonderful site with its simple way of tracking, keeping metadata tags for grouping. Just so simple and I love it. Then the problem came. I want to import my accounts and not do it manually and buxfer doesn’t support my bank (but it supports a very long list of other banks).

Download and try the air application: buxferbankaccountconverter

So what happened I wrote my own little parser.

#1 Copy & Paste Bank Account data

buxfer-account

#2 Paste into the converter and run it. Has for now Handelsbanken & Nordea. Export to the csv file.

buxfer-convert

#3 Import into Buxfer

buxfer-import

———-
UPDATED: 2008-07-05
Added support for banks
- Handelsbanken
- Nordea
- Swedbank
Extras
- Added support for direct upload data into buxfer account.
———-
UPDATED: 2008-07-13
Added support for banks
- SEB
———-
UPDATED: 2008-07-22
Bugfix
- Sort order by date and lock columns

- Remove Saldo in descriptions, messes up saldo for buxfer.
———-
UPDATED: 2008-07-30
Added support

- Application auto-update.
———-
UPDATE: 2009-02-21 (Version 1.5)
Fixed Handelsbanken Copy/Paste linebreaks
———-
Note: seems like problems for recognizing income/expense when uploading data.
———-
UPDATE:2009-03-31 (Version 1.6)
Fixed MAC OS 10.5 Paste problem.
A confirmed bug in Mac os x 10.5 made it almost impossible to copy/paste the account data to the application. The fix is to hijack the text event:

textField1.addEventListener(TextEvent.TEXT_INPUT, input);
function input(event:TextEvent){
event.preventDefault();
 
var textField:TextField = event.target as TextField;
var currentText:String = textField.text;
var insertionPrefix:String = currentText.substr(0, textField.selectionBeginIndex);
var insertionSuffix:String = currentText.substr(textField.selectionEndIndex, currentText.length);
textField.text = insertionPrefix + event.text + insertionSuffix;
var caretIndex:int = insertionPrefix.length + event.text.length;
textField.setSelection(caretIndex, caretIndex);
}

more information about the bug can be found at adobe bugs.

Download and try the air application: buxferbankaccountconverter

AIR, Life , , ,

ColorPicker Apollo

September 11th, 2007

I’ve started to play around in Flex, AS3. When doing that why not add some Apollo to the mix.

One of my Art Directors wanted a tool for selecting colors in a specified range. So a made my first small Apollo application.

colorpicker-source

colorpicker-air

colorpicker

AIR , ,