Archive

Archive for the ‘Mobile Application’ Category

Create and handle button with flex mobile application

November 24th, 2011 No comments

Today we start with basic control of any development, a Button. Button is main control to take actions from user and respond to it.

First create new application as described in this post.

I choose Blank Template so I only get application file. Now add one view to src. I have added it to my package. Name it Buttons. To create new package, right click on src folder and then select New – >Package. Give name of package and click Finish.

Create New Package

 

 

Now create new view in this package with name Buttons. For that, right click on package we just created and then choose New -> MXML Component follow on screen instructions. This will create new view file for you.

Now replace content of application file with this:

<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160" firstView="com.macymind.views.Buttons">
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
</s:ViewNavigatorApplication>

This will instruct that our fist start up view is Buttons.mxml

Now open Buttons.mxml from project explorer. Switch to design view and add one button from Components panel. If Components panel is not visible then display it from Window -> Show View -> Components

Rename text of button by double clicking on it. Now run your app. It should display button on view.

Now its time to handle tap event form that button. Select button in design view and from Properties panel, click on button beside of On Click label and choose Generate Event handler. This will crate black event handler function and add that button to click event of button.

Now place some trace in that event handler function, debug application and tap on button and see results in Console.

Do comment if you have any problem.

How to create first mobile application with Adobe Flash builder 4.5

November 24th, 2011 No comments

I have started learning Mobile Application Development with Adobe Flash Builder. The reason behind using it is that it is platform independent. You just need to do code at once and then make a build for each platform.

Now for working for all platforms, you need to apply Flash Builder Patch 4.5.1. ┬áIf you don’t have applied it yet then get it from here for your operating system and install it.

Once installed, start Flash Builder. Now follow below steps to create new application.

  1. Go to File->New->Flex Mobile Project
    File Menu Create New

     

  2. Give name to your app. I name it FirstApp.

    Give App Name

  3. Click on Next. Now choose platform you want develop for and Template for your app. NOTE: if you don’t have installed Flash Builder Update 4.5.1 then you can only create app for Android platform.

    Choose Template Type

  4. Clic on Finish. This will create project for your in Flash Builder and create initial required files for your project. if you want to test your project then Right click on your project from project explorer and select Run As -> Mobile Application. Then select proper mobile platform and startup device or desktop simulator.
Post comment if you have any query. Stay on to get more tutorials about mobile application development.