Introducing the SPAS 3.0 Mobile API

Introducing the SPAS 3.0 Mobile API

Developing for mobile devices

As the Flash Player is supported by Android and since Android is the number one smartphone platform in the world, we have decided to provide SPAS developers the oportunity to create desktop applications for mobile devices. So now, we are working on the SPAS 3.0 Mobile API, which is a specific extension of the SPAS project, especially designed to let Flash developers take advantage of the SPAS 3.0 workflow.

SPAS 3.0 core and Mobile APIs

The Mobile API is based on, and share many functionalities with, the SPAS 3.0 core API. All Mobile controls are subclasses of the SPAS 3.0 UIObject class. It means that SPAS developers will use the same coding conventions and methodologies for working with both APIs. Moreover, the Mobile API provides its own Look and Feel, called Neon, which is adapted to mobile devices specific screen resolutions.

SPAS 3.0 Mobile API extended packages

Developing for mobile devices is clearly different form Web developement because of the huge variety of available devices. That is why the SPAS 3.0 Mobile API also provides tools to create applications for specific devices (e.g org.flashapi.mobile.android package) and tools for working with as many devices as possible (e.g org.flashapi.mobile.phone package).

Comparing core and Mobile APIs

The following sample applications shows how these API are really similar in their use. Both examples create the same application by using either the core or Mobile API:

SPAS 3.0 Mobile sample application

Get Adobe Flash player

This sample application has been compiled from the following code:

package {
	
	import org.flashapi.mobile.*;
	import org.flashapi.mobile.phone.htc.*;
	import org.flashapi.swing.constants.*;
	
	public class TestMobileAPI extends MApplication {
		
		public function TestMobileAPI():void {
			super(onInit);
		}
		
		private function onInit():void {
			this.addSize(Hero.getScreenSize());
			
			var panel:MPanel = new MPanel();
			panel.fixToParentHeight = panel.fixToParentWidth = true;
			panel.layout.orientation = LayoutOrientation.VERTICAL;
			panel.layout.horizontalAlignment = LayoutHorizontalAlignment.CENTER;
			
			var bar:MButtonBar = new MButtonBar();
			bar.addItem("Left");
			bar.addItem("Center");
			bar.addItem("Right");
			
			var inp:MTextInput = new MTextInput();
			inp.fixToParentWidth = true;
			
			var box:MBox = new MBox();
			box.fixToParentHeight = box.fixToParentWidth = true;
			
			panel.addGraphicElements(bar, inp, box);
			
			this.addElement(panel);
		}
	}
}

SPAS 3.0 sample application

Get Adobe Flash player

This sample application has been compiled from the following code:

package {
	
	import org.flashapi.swing.*;
	import org.flashapi.swing.constants.*;
	
	public class CompareMobileAPI extends Application {
		
		public function CompareMobileAPI():void {
			super(onInit);
		}
		
		private function onInit():void {
			this.bodyVisibility = this.gradientBackground = true;
			
			var panel:Panel = new Panel(250, 300);
			panel.layout.orientation = LayoutOrientation.VERTICAL;
			panel.layout.horizontalAlignment = LayoutHorizontalAlignment.CENTER;
			
			var bar:ButtonBar = new ButtonBar();
			bar.addItem("Left");
			bar.addItem("Center");
			bar.addItem("Right");
			
			var inp:TextInput = new TextInput();
			inp.fixToParentWidth = true;
			
			var box:Box = new Box();
			box.fixToParentHeight = box.fixToParentWidth = true;
			
			panel.addGraphicElements(bar, inp, box);
			
			this.addElement(panel);
		}
	}
}

Where to go from here

SPAS 3.0 Mobile API pre-release

The SPAS 3.0 Mobile API pre-release will be availabe with the SPAS 3.0 alpha 5.5 release. The current SPAS 3.0 documentation is built from SPAS 3.0 alpha 5.5 and regularly updated.

Help us to improve the SPAS 3.0 Framework

You can use the SPAS 3.0 team contact form to send us some wishes for the upcomming releases and the SPAS 3.0 Bug Manager page to submit bugs.

More information on the SPAS 3.0 API globalization needs are available on the SPAS 3.0 Globalization page.

Share this article:

Comments:

There are no comments yet for this article.

Leave a reply

Your email is required but will not be displayed.

To prevent abusive emails, please enter the numbers you see in the image below:

Security code