Flash mobile) how to use flash builder "burrito" to develop Android applications

Source: Internet
Author: User

Adobe updated the flash builder on the 25 th. The flash builder code is "burrito". The main change is that the mobile phone (Android system) application can be directly developed using flash builder, let's look at my introduction to the new feature in another article:



Software)

Adoebe

Released

Flash Builder

New Version

-Adobe Flash builder "burrito"

(Figure)

Http://hi.baidu.com/taotao5453/blog/item/7835c11b94725cf5ae51332a.html




This article describes how to use the latest flash builder to create and release a simple Android Application. Here we will explain how to create a flex mobile project, of course, you can also "create Action Script mobile Project". These two items are newly added to the "new" menu in the new flash builder version. Refer to the above section.


Start now.

Assume that you have installed Adobe Flash builder "burrito"

(Hereinafter referred to as"

Flash Builder

"Is"

FB

"), And has a simple understanding

Flex

Or

ActionScript

The development process does not describe the meaning of the Code.




I. Project Creation stage




1. Select "file"> "new"> "flex mobile project" from the FB menu, as shown in.

Note: Because I chose the Simplified Chinese version during installation, the FB menu is in Chinese. If you have installed the English version, select the corresponding "flex mobile project.

-

(Figure 1)


-


Enter the Project Settings, enter the project name, and select the project directory. The latest sdk4.5.0 (codenamed "hero") is built in FB "burrito "), this is integrated with the latest mobile phone Development API. We need to select This SDK, for example.

-

(Figure 2)


-


Click "Next" to go to the second interface of Project Settings. For example, currently, flex mobile development only supports Android. You can select the default settings for this interface.


-
(Figure 3)

-

As we do not need network communication in this example, click "finish" on the Interface above. The project structure generated afterwards is as follows:


-
(Figure 4)

-

We can see that there are two mxml files in the project,

The default code for myandroidproject. mxml is as follows:


-
(Figure 5)

-

_ Myandroidproject. mxml
The Default Code is as follows:


-
(Figure 6)

-

Here, the project creation process has been completed, and the code of this example is written below.

 

Ii. coding stage

To test the function, run the following command in _ myandroidproject. add a button and a label to mxml, and add an event to the button. When a button is clicked, a random number is added to the text of the other label to verify that the click event is triggered.

_ Myandroidproject. mxml
Complete code, for example, marked in red, is added:
-

-
Simple code writing is complete. Next we should start debugging and publish it to the Android mobile app. ^
-

Iii. debugging

Click the debugging button of the "small crawler". The pop-up debugging interface is as follows. Pay attention to the two options in the "Startup method,

Directly generate the androidsystem execution file .apk format on the desktop to your hard disk.

"On the device" is displayed on your mobile phone. You need to connect your mobile phone to the development computer by using USB.

On the desktop,

However, if you want to debug your phone directly, you need to connect your phone to your computer using USB. Here we only introduce the debugging method "on the desktop", that is, debugging on the local computer,


-

-
After selecting "on the desktop", click the drop-down box on the right to select the Simulator model you need. Because I am an HTC Desire, my selection is as follows:

-

After the selection, click "application"> "debug". Wait a moment to see the debugger interface, as shown in figure


(Click to see the big picture)
-
The Interface contains a button and a label. When we click a button, the label content changes as follows to prove that our click event is triggered instantly.

-

Iv. Project release stage


After successful debugging, we began to release our project into a program that can run directly on the mobile phone.

Click "project"> "export release" in the menu of FB, as shown in figure

-


Click it to bring up the release page, as shown in,

In the export to folder, you can set where you want to publish the final file. The default value is null, that is, your project folder cannot be published. (Note that the default value is not the bin-Debug folder, it is the folder where your project is located. Generally, it is at the top-level folder level of your bin-Debug. Here we will describe this to avoid failing to find the generated file)


-

Click "Next". The following page is displayed.

This interface selects digital certificates. If you have previously worked in the air project, you should be familiar with this interface. If you have created a certificate in the air project before, use that certificate, instead of re-creating,

If the local machine does not have a digital certificate, click "CREATE,


-


Click "CREATE". The following page is displayed. after entering the project marked by "*", click "OK" to generate your digital certificate,

Then, return to the interface in the previous step and click "finish.

-


The following interface is displayed when the release is successful:


-


The release process ends here.

After the release is complete, a"
Myandroidproject.apk
"File is our final project file,


-

V. Others-advanced


1,

This .apk file can be opened in a RAR compressed package. The opened content is as follows,


-

We will see a .swf file in the assetsfolder. In short, we are still releasing SWF, but FB will pack and shells for us so that the Android system can recognize our SWF file as a desktop application.



-


2,

If you want to run .apk on your Android system mobile phone, you need to download the latest Adobe AIR file from the Android app store, that is, the air running time (AIR runtime) that we often call and install. In this example, the minimum Android system requires Android 2.1. (Some people say that the 2.2 system is required, but my mobile phone is android2.1. Therefore, this argument is unnecessary and facts prove everything)
-

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.