|By Rich Tretola | December 9, 2010|
OK, start your clocks!
Full source is at the end of the post.
Here are the steps to build it.
- First create a new Flex Mobile Project
- Name this project “AIRonMobile”
- Make sure you have BlackBerry Tablet OS selected as a Target platform
- As we won’t be editing any of the additional screens, just click finish
- Your new project will open automatically. Switch to the view named AIRonMobileHomeView.mxml in your editor.
Add a Label to this file. Your file code should now look like this:
9<?xml version="1.0" encoding="utf-8"?>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:Label text="Hello World" fontSize="24"
- Save the AIRonMobileHomeView.mxml file
- Now open your Blackberry simulator and ensure it is ready for you to run your application.
- To prepare the simulator, you must do the following:
Open the simulator and click on the gear in the upper right corner
Select the Security menu item and enable Development mode
Now click on the hammer menu item at the top of the simulator and make note of your simulator’s IP Address
- Switch the editor to the AIRonMobileHome.mxml file
- Click on the play button and select Run As -> Mobile Application from the menu
- Enter the appropriate information on the runtime configuration including the IP Address and password
- Bam! There it is. AIR on PlayBook.
- Now, lets compile the same application to Android.
- If you have a device, plug it in, if not, you can use the emulator.
- Again, hit the play button and open the run configurations.
- Select the AIRonMobile config and click the duplicate button at the top.
- Change the Target Platform to Google Android and choose either to run On Desktop to use the emulator or On device if you have a device plugged in.
Thats it, you now have an application that can deploy to both Android and PlayBook.
In the next installment, we will make this a Tabbed application!