Wednesday, July 27, 2011

Build a multi-platform mobile RSS reader with Flash Builder 4.5

In one standard 8 hour day, from start to finish, I wrote a SlashDot RSS reader that works on multiple platforms.  This is an attempt to share how easy it is to make a cross platform mobile application.  Using Flash Builder 4.5.1, you can build this entire application for almost any RSS feed in a few hours and it will run on iOS, BlackBerry Playbook and Android powered devices.

License: You may reproduce, modify, and use these materials for just about any purpose as long as you respect the copyrights of the owners involved (including Slashdot and Adobe). You may use this to teach courses in mobile development.

In order to complete this tutorial, you will need Flash Builder 4.5 or later.

Setting up the project and the service calls

In this section, you will learn about the various components that comprise a Flex/AIR Mobile application as well as how to:

• Set up a new mobile project
• Test the project in various views
• Set up a service call
• Set up a remote data connection, parse RSS (XML format), and bind it to a visual component
• Configure the service call return type

Flash Builder 4.5 is an efficient IDE for developing mobile Flex applications. As opposed to coding native mobile applications for each platform, the portable coding approach allows developers to keep one code base and target multiple mobile and desktop platforms. The applications themselves are AIR applications compiled to look like native applications. This tutorial will show you how to target the Google Android platform but using the new builder, you can target iOS and BlackBerry too.



The following steps should take about 8-10 minutes to complete.

1. With a browser, navigate to http://rss.slashdot.org/Slashdot/slashdot. View the source of the RSS feed to inspect the complex raw source of the RSS format.  View the source to see the XML structure.

2. Copy the URL from the browser window.

3. In Flash Builder, choose File > New > Flex Mobile Project and type SlashdotRSS for the name.


Figure 1. Flex Mobile New Project Wizard.

4. Click Next and the mobile project wizard will provide a multitude of choices for your project as shown in Figure 2.




Figure 2. Configuring the new Flex Mobile Project.

5. Under Target Platforms, by default you will have iOS, BlackBerry Playbook and Android selected.  Note that within each of these platforms, you also have multiple devices supported.  For example, if you select iOS, it supports the iPhone 3G, 4 and tablet.



Keep the application a View Based Application and leave Automatically Reorient selected.

6. Click on the Permissions tab to bring up the permissions screen.



Figure 3. Flex Mobile applications must request permissions they require.

7. To build an RSS reader you must ensure that the Internet permission is selected for each platform you target. Ensure the Platform selector is set to Android and that the Internet access permission is requested. Click Finish.

8. Flash Builder will create a new project. The SlashdotRSS project has a different structure than Flex 4 and earlier versions and is worth exploring. The SlashdotRSS.mxml file under the default package is the main entry point into the application. The views package contains the first default view, which is shown as SlashdotRSSHomeView.mxml below. The application descriptor file contains metadata about the project.



Figure 4. Flex Mobile application structure

9. To begin setting up the data service, ensure you are working on the SlashdotRSSHomeView.MXML file and choose Data > Connect to XML.

10. In the Connect To Data/Service dialog box, ensure URL is selected as the XML Source, and then paste the Slashdot URL (http://rss.slashdot.org/Slashdot/slashdot) in the URL text box. Click Invoke.


Figure 5. The Connect to Data/Service dialog box.

11. After Flash Builder introspects the service, select item as the Node. You may have to scroll down quite a ways to find it. You should see that Is Array? is checked and the default service and package names have been provided as shown in Figure 5.

12. Click Finish.

13. After Flash Builder creates the service, open the Data/Services view (Window > Show View > Data/Services) and locate the newly created service getData() function. Right-click it and select Configure Return Type (see Figure 6).




Figure 6. Selecting Configure Return Type for getData().

14. In the Configure Return Type dialog box, ensure Auto–detect The Return Type From Sample Data is selected and click Next.

15. On the next screen, select Enter A Complete URL Including Parameters And Get It. Paste the Slashdot URL in the URL To Get box (see Figure 7) and click Next.


Figure 7. Specifying the URL to use in configuring the return type.

16. On the next screen, type Item as the name of the new data type and select item as the Root node (see Figure 8). Note: If you are using another RSS feed, you will need to figure out which property is the root node.



Figure 8. Selecting the root node.

17. Click Finish.

18. Back in the Data/Services tab, right-click getData() again, and this time click Generate Service Call.

19. In Source View, add a List component and with the following properties: top=”0”, left=”0”,right=”0”,bottom=”0”.

20. Alternatively, you can add the List component in Design View. Then, select it and scroll to the bottom of the Properties tab until you see the Constraints controls. Set them as shown in Figure 9.




Figure 9. Binding the List control to the four corners.
Constraining the List control in this way ensures that the application has a consistent appearance when switching between landscape and portrait orientations.

21. Inside the <list> element set the labelField value to "title". Then add <s:AsynchListView list="{getDataResult.lastResult}" /> as shown below.

 <s:List left="0" right="0" top="0" bottom="0" labelField="title">
    <s:AsyncListView list="{getDataResult.lastResult}" />
 </s:List>



Note: The list property of the AsyncListView instance, which holds the data to be displayed in the List, is set to the data returned from the service call. Using lastResult will cause the list to expand to match the number of items returned.

22. Add a call to getData() on the viewActivate event in the root element.

23. In Design View, change the Chrome (#666666) and Content Background (#336666) colors to match the Slashdot home page. These settings are found on the Appearance tab.

 24. Test your application by running it! Right-click the project in the Package Explorer and select Run > Run As > Mobile Application. When you first run it, you will be asked if you want to launch it in an emulator ("On Desktop") or on a remote device. Use the emulator for now. If you get asked if you want to auto-deploy the model to the server, select No and click OK.




Figure 10. Launching the application (top) and the application running in the emulator (bottom).

In Figure 10, notice the entity reference (&mdash;) that appears in the third element in the list. To get rid of this you’ll have to write some code to handle entity references, which is explained in the next section.

Working with List data
In this section, you will learn how to:
• Set up an event handler for a CollectionChange event and pass the event in
• Use labelFunction to call a special function that accepts a custom data type (Item[]) and returns a String.
• Set up a regular expression variable
• Use the String replace() method to replace an entity reference with another character
This section should take about 10 minutes to complete.
1. If it’s not already open, open the SlashdotRSSHomeView.mxml file.

2. In Source View, set the List control’s id to myList.

3. Position the cursor within the element. Add an event handler for the collectionChange event that invokes a function named fixEntityReferences() when the list values change.

4. Next, add the following code to the <fx:Script> tag to implement the event handler:
import mx.events.CollectionEvent;
import valueObjects.Item;

protected function fixEntityReferences(event:CollectionEvent):void
{
   myList.labelFunction = replaceEntity;
     
   function replaceEntity(item:Item):String
   {
      var p1:RegExp = /(&mdash;)/ig; // perhaps add more here later
      var thisString:String = item.title.replace(p1, "-");
      return thisString;
   }
     
}


The event handler function accepts the event of type CollectionEvent. It adds a labelFunction to the list. Named replaceEntity(), this function accepts an object of type Item. (Item[] is the array that is returned from the getData() service.)
The replaceEntity() function sets up a regular expression variable (p1) that detects the entity reference &mdash;. After creating a String variable named thisString, it calls the replace() method on the item.title, substituting a dash (-) for the entity reference &mdash;. Lastly, it returns the string thisString, which will be reflected as the new item label.
5. Run the program and you will see that any &mdash; entity references no longer exist (see Figure 11).
          



Figure 11. The application before the entity reference fix (left) and after (right).

Note: The technique used in this section to remedy the entity reference problem is a quick hack, not a best practice. The best practice would be to handle this in the value objects.

Adding the Details view

In this section you will learn how to work with views and the ViewNavigator component, which manages the views in your application as the user navigates through it. Specifically, you will create a new view that shows the details for a single RSS item. This section should take around 20 minutes to complete.
1. To add a new view, right-click the Views package in the Package Explorer and select New > MXML Component. Type DetailsView as the Name, leave the other settings at their default values, and click Finish.
2. Back in SlashdotRSSHome.mxml, position the cursor just inside the end of the <s:List> element in Source View and start typing "change". When Content Assist highlights the change event, select it and then select Generate Change Handler (see Figure 12). This will set up your event handler.



           Figure 12. Generating a change handler for the list.
The newly created change handler function will push a new view that shows a detailed view of the specific item that the user clicked in the list. In Flex mobile projects, views can be pushed and then popped (see Figure 13).


Figure 13. Pushing and popping a view.

3. Update the list change event handler code as shown below.
protected function myList_changeHandler(event:IndexChangeEvent):void
{
   var RSSItem:Object = myList.dataProvider.getItemAt(event.newIndex);
   navigator.pushView(DetailsView, RSSItem);
}

The pushView() method takes two parameters: the view you want to push and a data object to pass to the view. In this case, the RSSItem variable is the data that will be passed to the DetailsView view.
4. Run the application. When you click on an RSS item, the new (and currently empty) details view will be displayed.

Configuring the Details view

In this section you will learn how to access the data object passed when the Details view is pushed by the Home view and display various attributes of the RSS item.
This section should take about 20 minutes to complete.
1. Open the DetailsView.mxml file in Source View.
2. Create an <fx:Script> block and add variables for the title, date, creator, link, and description of the selected RSS item.
<fx:Script>
   <![CDATA[

      [Bindable] private var rtitle:String;
      [Bindable] private var rdate:String;
      [Bindable] private var rcreator:String;
      [Bindable] private var rlink:String;
      [Bindable] private var rdesc:String;
   ]]>
</fx:Script>

3. Switch to Design View, and ensure the details view colors are the same as the home view colors. Use #336666 as the Content Background color and #666666 as the Chrome color to match the Slashdot.org colors.

4. Back in Source View, set up the Details view by adding the following MXML to the content area of the view (below the </fx:Declarations> tag).
<s:BorderContainer top="0" bottom="0" left="0" right="0"
                   backgroundColor="#336666">
     
   <s:Label left="10"  top="20" width="70" fontSize="18" text="Title:"
                textAlign="right"/>
   <s:Label left="90" right="20" top="15" height="45"
                backgroundColor="#FFFFFF" color="#666666" fontSize="18"
                paddingBottom="5" paddingLeft="5" paddingRight="5"
                paddingTop="5" text="{rtitle}"/>

   <s:Label left="10"  top="75" width="70" fontSize="18" text="Date:"
                textAlign="right"/>
       <s:Label left="90" right="20" top="70" height="40"
                backgroundColor="#FEFDFD" color="#666666" fontSize="18"
                paddingBottom="5" paddingLeft="5" paddingRight="5"
                paddingTop="5" text="{rdate}"/>

       <s:Label left="10"  top="125" width="70" fontSize="18" text="Creator:"
                textAlign="right"/>   
   <s:Label left="90" right="20" top="120" height="40"
                backgroundColor="#FFFFFF" color="#666666" fontSize="18"
                paddingBottom="5" paddingLeft="5" paddingRight="5"
                paddingTop="5" text="{rcreator}"/>

       <s:Label left="10"  top="175" width="70" fontSize="18" text="Link:"
                textAlign="right"/>     
  
   <s:Label left="90" right="20" top="170" height="45"
                backgroundColor="#FFFFFF" color="#1C05FB" fontSize="18"
                paddingBottom="5" paddingLeft="5" paddingRight="5"
                paddingTop="5" text="{rlink}" textDecoration="underline"
                click="navigateToURL(new URLRequest(rlink))"/>

   <s:Label left="10"  top="230" width="70" fontSize="18" text="Item:"
                textAlign="right"/>  
       <s:Label left="90" right="20" top="225" bottom="304" color="#666666"
                backgroundColor="#FFFFFF" fontSize="18" paddingBottom="5"
                paddingLeft="5" paddingRight="5" paddingTop="5"
         text="{rdesc}" maxDisplayedLines="10"  />
     
       <s:Button left="50" right="50" bottom="101" label="Go see on Slashdot"
         click="navigateToURL(new URLRequest(rlink))"/>
     

       <s:Label left="15" right="15" bottom="23" fontSize="11"
         text="All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the Poster. The Rest © 1997-2010 Geeknet, Inc."
         textAlign="center" verticalAlign="middle"/>
  
</s:BorderContainer>


In addition to several Label elements that display the RSS item details, this view includes a button that loads the full RSS item URL in a browser when clicked. This is done using click="navigateToURL(new URLRequest(rlink))".
5. Switch to Design View. In portrait mode, the components fit nicely in the view (see Figure 14). Change to landscape mode. The components adjust to a new layout.
            

Figure 14. The details view in portrait mode.
Since raw RSS feeds often have HTML markup and entity references, the application will have to replace some characters in the RSS feed data. Architecturally, it would be better to handle these substitutions in the value objects package. However, for this application it will be done in the view, even though it is not a best practice.
6. Create a new function in the DetailsView called getDetails() and add the following code.
   import valueObjects.Item;
   private function getDetails():void
   {
      var p:RegExp = /(&mdash;)/ig;
      var h:RegExp = /<p(>|(\s*[^>]*>)).*?<\/p>/ig;
      var thisItem:Item = data as Item;


      rtitle = thisItem.title;
      rtitle = rtitle.replace(p, "-");
      rdate  = thisItem.dc_date;
      rcreator = thisItem.dc_creator
      rlink = thisItem.link;
      rdesc = thisItem.description;
      rdesc = rdesc.replace(h, "");
      rdesc = rdesc.replace(p, "-");


   } 

The keyword data is a variable reference to the data passed to this view.
The title, dc_date, dc_creator, link, and description attributes of the RSS Item object are used to set the variables. The calls to replace() use the regular expressions to replace entity references in the title and the description, as well as to eliminate HTML markup in the description.
7. Add viewActivate="getDetails()" to the root <s:View> element. This will invoke getDetails() when the view is activated. While you’re there, insert a space between "Details" and "View" in the title attribute.
8. Run your application. Click on an item to see the Details view (see Figure 15). Click the button to launch the Slashdot story in a browser.




Figure 15. The completed details view.

Fixing an architectural mistake

In this section you will learn a best practice for mobile development. This section should take around 10 minutes to complete.
Although you may not have noticed it as you used the application in the emulator, each time the home view is shown, a new call is made to the RSS service. This consumes CPU cycles (and battery charge) and also incurs unnecessary data bandwidth charges for the user. Needless to say, this is not the best way for the application to behave.
To get a better understanding of this architectural mistake, it helps to enable the network monitor.
1. In Flash Builder, choose Window > Show View > Other and then select Flash Builder > Network Monitor to open the Network Monitor view.
2. Enable the Network Monitor by clicking the Enable Monitor button (see Figure 16). (It is disabled by default.)



Figure 16. Enabling the Network Monitor.

3. Run your application again in the emulator and watch the network calls as you navigate between the Home view and the Details view. (To return to the Home view from the Details view in the emulator, choose Device > Back or press Control+B.) 
As you can see, there is a service call each time the Home view is displayed. Luckily, this is easy to fix.
1. Open the SlashdotRSSHomeView.mxml file.
2. In the root element, remove the call to getData() on the viewActivate event (see Figure 17). Set the destructionPolicy attribute to "never". While you’re there, set the title attribute to "Slashdot RSS".


 Figure 17. Remove the getData() function call on the viewActivate event.

The destruction policy defines the policy that the view's navigator will use when this view is removed. If set to "auto", the ViewNavigator component will destroy the view when it isn't active. If set to "never", the view will be cached in memory. For items such as an RSS feed that do not update very often, it is best to allow the user to manually refresh the list or to update the list periodically.
You still need to call getData() at the launch of the application. This can be done from the main application file.
3. Open SlashdotRSS.mxml, the file for the main entry point into the application. This is located in the project’s default package. In the Package Explorer it has a blue dot and green triangle beside it (see Figure 18).


Figure 18. Locating the main application file.

4. Add applicationComplete="getRSS()" to the root element of the application (<MobileApplication>). After the application has been initialized, the applicationComplete event is dispatched and getRSS() will be invoked.
<?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"
                               firstView="views.SlashdotRSSHomeView"
                               applicationComplete="getRSS()">
    
5. Now create the function that will make the initial service call to get the RSS items. After deleting the empty <fx:Declarations> element, add the following code:

<fx:Script>
   <![CDATA[
   private function getRSS():void
   {
    Object(navigator.activeView).getData(); 
                  }
]]> </fx:Script>

The code Object(navigator.activeView).getData(); can reference the getData() function directly if it has been made public.  If you generated the function, it will be protected by default and that will have to be changed. Since this only gets called once, we do not have to test to see which view is active.
6. Back in the SlashdotRSSHomeView.mxmlfile, change the access modifier for the getData() function from protected to public as shown below.
    //service call
   public function getData():void
   {
      getDataResult.token = slashdot.getData();
   } 
7. Run your application. Verify that getData() is getting called when the application launches.

Adding a manual refresh capability
Now that you have removed the service call that was invoked each time the Home view was shown, it’s a good idea to give the user a way to refresh the list of RSS items manually. In this section you will learn about:
• Action content
• Making calls from the application to functions contained in views
• How to embed icons within buttons
There are basically four main areas for a Flex mobile application built for the Android OS: navigation content, title content, action content, and the view (see Figure 19). Action content is usually on the right-hand side, and that is where you’ll position the icon that will be used to refresh the list.



Figure 19. The main areas of a mobile Flex application.

1. To create a refresh icon, you will need an icon approximately 48 x 48 pixels with a transparent background in PNG format. Locate the refresh48x48.png and info48x48.png files in the icons package of the starter project for this tutorial.
2. Right-click the src folder of your application and select New > Package. Type icons as the package name and click Finish. This will set up a folder for your icon images.
3. Copy the refresh48x48.png and info48x48.png icon files into the new package.
4. Open SlashdotRSSHomeView.mxml and insert the following code, which adds an action content area to the Home view (the File should be named “SlashdotRSS.mxml”) with a button that embeds the refresh icon image.
<s:actionContent>
   <s:Button icon="@Embed(source='icons/refresh48x48.png')" />
</s:actionContent>

5. Run the application to verify that the button is displayed (see Figure 20).



Figure 20. The new refresh button.

6. Switch back to Source View and add the following function:
private function refreshList():void
{
 if (navigator.activeView.name.slice(0,19) == "SlashdotRSSHomeView")
 {
      Object(navigator.activeView).getData(); 
 }
}

7. Within the button declaration, add click="refreshList()" to capture the click event and make a call to the newly created refreshList() function.
   <s:actionContent>
      <s:Button icon="@Embed(source='icons/refresh48x48.png')"
                click="refreshList()"/>
   </s:actionContent>

8. With the Network Monitor on, run the application. Each time you click the refresh button it should invoke another service call.  Ensure that this only happens while in the view where the list is.
The application no longer automatically refreshes. Instead, the addition of a user controlled Refresh button places the power into your users’ hands, which is a best practice. They know their data plan and battery life, and it is a good idea to enable them to control this functionality.

Adding the Info view  

Now that the architecture is solid, it is time to add another view to allow users to see information about the application. The Info view will be relatively simple to add, and it will give users information about getting the source code for the application (pay it forward!).
This section will take about eight minutes to complete.
1. If you have not already done so, copy info48x48.PNG from the starter project to the icons package of your project.
2. Since this icon should be visible from all views in the application, it can be added to the entry point into the application, in this case the SlashdotRSS.mxml file. Add the following code to set up the button and a click event handler named showInfoView() (yet to be written).
<s:actionContent>
   <s:Button icon="@Embed(source='icons/info48x48.png')"
                 click="showInfoView()" />
</s:actionContent>

3. To create the new view, right-click the views package in the Package Explorer and select New > MXML Component.
4. In the New MXML Component dialog box, type views as the Package and InfoView as the Name. Make sure that the new component is based on spark.components.view (see Figure 21) and click Finish.
         


Figure 21. Adding the InfoView component.

5. Open InfoView.mxml in Source View and change the title attribute in the <s:View> element to "About RSS Reader". Then add the following code.
<s:Label left="0" right="0" top="0" bottom="0" textAlign="center"
        paddingBottom="175" paddingLeft="40" paddingRight="40"
               paddingTop="30"  backgroundColor="#336666"
                text="This application was built to demonstrate how easy it is to create mobile applications using Adobe Flash Builder and Adobe AIR. Slashdot was chosen as a site because it has complex RSS formats and offers an open feed for all to consume. Please consider supporting Slashdot!
The source code for this application is freely available and can be found at
http://technoracle.blogspot.com/2010/12/mobile-slashdot-rss-reader-tutorial.html."/>
   <s:Button left="50" right="50" bottom="140" label="Get Source Code" click="navigateToURL(new URLRequest('http://technoracle.blogspot.com/2010/12/mobile-slashdot-rss-reader-tutorial.html'));"/>
   <s:Label left="15" right="15" bottom="23" fontSize="11"
                text="All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the Poster. The Rest © 1997-2010 Geeknet, Inc."
                textAlign="center" verticalAlign="middle"/>  

 Note: The text and navigateToURL link can be changed for each project.
6. Open the Home view file (SlashdotRSSHomeView.mxml) and add a function named showInfo() in the <fx:Script> block.  This function will be used to push the  InfoView.
   public function showInfo():void
   {
      navigator.pushView(InfoView);
   } 

7. Repeat the previous step for DetailsView.mxml.
8. Open the SlashdotRSS.mxml file (the entry point into the application) and add a showInfoView() function, which calls the showInfo() function from the active view.
   private function showInfoView():void
   {
        Object(navigator.activeView).showInfo();
   } 
 If you run your application now, you’ll notice the Info button in the InfoView, where it is not needed.
9. To remove the Info button from the Info view, open InfoView.mxml and add an empty <s:actionContent> element.
<s:actionContent/>
10. You'll also notice that the Info button does not appear on the list view where it belongs. This is because the actionContent element in view overrides the one in the main application file.  Open SlashdotRSSHomeView.mxml and add the following to the actionContent element:

<s:Button icon="@Embed(source='icons/info48x48.png')" 
 click="showInfo()" />

Adding a splash screen

You’re almost done building this Flex mobile application. One final thought is that on some devices it might take the application a while to load. A splash screen will let the user know something is happening as the application starts up.
In this section you will learn:
• What a splash screen does and why it is a good idea
• How to add a splash screen
Mobile applications must always strive for efficient use of the CPU and battery. When an application takes time to load, it can give the user the impression that the entire application is sluggish. One way to show the user that the application is reacting quickly to user actions is via the view (in this context, view refers to the MVC pattern concept of view). Adding a splash screen is fortunately quite easy. The splash screen is shown while the main parts of the application load and disappears as the main application has finished initializing.
This section will take less than five minutes to complete.
1. Create a new package under the src folder of your project and name it splash.



Figure 22. The slashscreen.png file in the splash package.

2. Copy the splashscreen.png file from the starter project into the splash package (see Figure 22).


Figure 23. The splash screen image for RSS Reader is 400 x 400 pixels square.
Keep in mind that a user might open your application in landscape mode. To account for this, you can either restrict the application to open only in portrait mode, or set the width and height of your splash screen image so it will not matter; for example, use 400 x 400 pixels (see Figure 23).
3. Open SlashdotRSS.mxml and add splashScreenImage="@Embed('splash/splashscreen.png')" to the root <s:ViewNavigatorApplication> element of the application, as shown below.
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                            xmlns:s="library://ns.adobe.com/flex/spark"
                       firstView="views.SlashdotRSSHomeView"
                            applicationComplete="getRSS()"
                 splashScreenImage="@Embed('splash/splashscreen.png')"> 
4. Run your application. The splash screen image will appear momentarily while the application is loading.

Packaging your application for the Android Market
Now that you have a fully functioning application, there are a few remaining tasks to complete before you can publish your application to the Android Market. If this is your first time publishing an application, visit http://market.android.com/publish/signup to set up an account.
After you register, you will find list of requirements for publishing your application. Complying with these requirements will help your application look more professional and will also allow people to find it easier. Among the most important requirements are the icons, which are required in multiple sizes from 512 x 512 pixels to 16 x 16 pixels. It is best to develop the largest size first, and then scale down the rest.
Once you have developed a base icon, save it in the following sizes under the /src/icons/ folder in your project:
• icon32x32.png
• icon36x36.png
• icon48x48.png
• icon72x72.png
• icon128x128.png

Ensure you keep the 512 x 512 pixel PNG original as you will need it for the Android Market. Example versions of these icons can be found in the starter project.
Additionally, you will need a PKCS12 digital certificate that is valid until after October 22, 2033. This may surprise you, but it’s not hard to create one. For details on creating your own digital certificate, see Generating a PKCS12 certificate for Android Market.
Follow these steps to place your application in the Android Market.
1. Locate the application descriptor file, which you will find in the project’s src folder (see Figure 24). For this project, it is named SlashdotRSS-app.xml. This XML file specifies parameters for identifying, installing, and launching AIR applications. You will need to make a few modifications to this file.
  


Figure 24. The application descriptor file.
2. Do not open the file by double-clicking, that would open it with the XML editor. Instead, right-click the file and select Open With > Text Editor.
3. Provide a valid name and version for your application. The name can be changed by editing the <name> element near line 25.
4. Type some descriptive text that identifies your application. For example, you might type Slashdot RSS Monitor or something similar (see Figure 25). Note: The exact line number and comment text may differ from those shown.


Figure 25. Changing the <name> element.
5. Next set the version number for your application. If you decide you are a great coder and there is no chance of any bugs, you might choose version 1.0. Set this value in the <versionNumber> element near line 30 (see Figure 26).


 Figure 26. Changing the <versionNumber> element.

6. Next, you’ll want to define where the main application can locate the proper PNG application icons. Near line 109, find the <image16x16> element, which begins a set of six similar elements (see Figure 27).

Figure 27. The icon elements before editing.
7. Insert the name of the appropriate icon file in each element (see Figure 28).


Figure 28. The icon elements after editing.
There are many other items that may be set in the application descriptor file including descriptions, copyright, and more. For more information, refer to the Adobe AIR documentation.
8. Save your changes.
9. If you have not already done so, copy the necessary icon PNG files from the starter project into your project’s src/icons folder.
10. Right-click the project in the Package Explorer and select Export.
11. In the Export dialog box, select Flash Builder > Release Build (see Figure 29).


Figure 29. Exporting the release build.
12. Click Next.
13. On the next screen, ensure you’re exporting the correct project and leave the other options at their default values (see Figure 30). Click Next.


Figure 30. Specifying the export folder.
14. On the next screen, specify the location of your digital certificate and type the password. Make sure that the certificate you created complies with the requirements of the Android Market. Again, for instructions on creating such a certificate, see Generating a PKCS12 certificate for Android Market.
15. Click Finish.
That’s it! When you see the success confirmation (see Figure 31) you will have a new *.apk file (which is the native installer package for Google Android devices).


Figure 31. Confirmation of a successful release build export.


Where to go from here

Congratulations! You are now a mobile developer!
I encourage you to try your hand at developing your own mobile applications using Flash Builder and the techniques you’ve learned in the article.
For more information on Flex mobile development see the following resources:
• Flex Test Drive for Mobile: Build a mobile application in an hour
• Mobile Application Development with Flex
• Video of this tutorial:  Part 1  Part 2

Thursday, July 21, 2011

Announcement: Adobe’s biggest CEM event of the year

In conjunction with Adobe MAX 2011, there will be a new event. The Adobe Digital Enterprise Summit 2011 will take place October 3-4, 2011 at both the JW Marriott and L.A. LIVE in
Los Angeles, California, USA.  The Adobe Digital Enterprise Summit is the first dedicated Customer Experience Management (CEM) conference where attendees will learn about new architectural disciplines and product innovation, as well as understand the latest industry trends and core principles of CEM.  We have filmed an earlier bit on CEM to describe it from an architectural perspective.  This is a new discipline of EAI that will affect every Fortune 1000 company in the next decade.

Top reasons why you should attend
· Learn from industry thought leaders on delivering multichannel experiences using cutting edge technologies.
· Understand Adobe's roadmap into the next era of enterprise architecture and why it matters.
· Gain exposure to new product innovation, insights into the latest industry trends, and access to key personnel from Adobe including CEM experts.

What you will take away
· Insight into the new world of the digital consumer and how to engage them
· An ability to understand how to generate ROI based on great customer experiences
· Understanding how to create an army of positive advocates for your brand by delivering the best experiences for your employees, users, and customers.

To learn more about ADEP and CEM, follow these twitter accounts:
http://twitter.com/#!/eptechies
http://twitter.com/#!/duanechaos
http://twitter.com/#!/AdobeCEM
http://twitter.com/#!/ADEP_Developer

Early-bird pricing is available ONLY in July, 2011 (Expires July 31).
· Contact me (dnickull at adobe dot com) and register by July 31st and you can attend for only $1,195, which is $300 off the price of a full conference pass and an additional $100 savings off of the published Early Bird price.
· Return registrants (Loyalists): A Loyalist is any Digital Enterprise Summit attendee who has attended a previous Adobe MAX, Day Ignite, or Omniture Summit. Loyalist pricing  is the lowest available for any attendees.

Education, government, and international attendees can attend for an equally low rate.  Oh yes - I will be there!

Tuesday, June 21, 2011

Adobe Digital Enterprise Platform

There are two new announcements from Adobe that are the most exciting products I have ever seen us release.   Flash Builder 4.5.1 brings a new model for portable development for mobile, meaning you can use a large portion of the same code base for desktop, laptop, tablet and smart phone targets.  This tool along with the Flex 4.5.1 framework is a complete game changer.

Flash Builder 4.5.1 outputs applications for Android, RIM PlayBook, and Apple iOS devices, including the i(Devices).   All of us have been busy writing several applications and will roll some out in the coming weeks as well as leading a large hands-on mega lab at Adobe MAX this October in Los Angeles, CA.  Last year, two instances of this class sold out in advance so if you want to immerse yourself in mobile development, strongly consider reserving your spot ASAP.  Several other evangelists from Adobe including Greg Wilson, Michael Chaize, Ryan Stewart, Kevin Hoyt, Serge Jespers, Ben Forta, Mihai Corlan, Anne Kathrine Petteroe, Mike Jones, Paul Trani and more will be diving deep into all the subjects.   See the blog roll for a list of all evangelists.

We are also introducing the new Adobe Digital Enterprise Platform (ADEP), which embodies multiple functionalities formerly offered by Adobe LiveCycle ES, Day Software, and more.  ADEP is a bold platform, which solves a major issue emerging in modern enterprise architecture.  The architectural discipline of Customer Experience Management (CEM) is important for modern enterprises to grasp and act upon.   CEM is described from an architectural perspective within the blog post and video here.

ADEP offers customers many choices (such as HTML5 or SWF), which I believe is best decided on a per requirements basis.  A further explanation from the Adobe website reveals some of the problems ADEP solves:

"Companies that want to differentiate themselves from the competition realize that they must deliver applications that engage customers as they access information and interact with the business and its frontline employees. And customers want access on
any device or across any channel. Central to accomplishing that goal is simple, yet engaging, interfaces that enable customers to access information and processes, even if they are contained in corporate systems. Efforts to merely extend access to such systems have not proven successful due to the complexity of user interfaces that have been designed for specialists, not customers and the frontline employees who serve them."
The obvious enrichment a platform can deliver is a common pipeline for data and processing, designed from the bottom up with Cloud and Social Media DNA.  The data modeling capabilities also offer enterprise developers some really cool new features.

Over the next few weeks we will continue to post articles to expose bits of the platform and explain what it means in terms of existing LiveCycle ES customers.

Hope to see you at Adobe MAX 2011!

Thursday, June 16, 2011

Tutorial: Accessing Microphone on Android in Adobe AIR


This video is the latest in a long series of tutorials on how to use the new Flash Builder for Flex Mobile Development.  This particular exercise targets Android however the same code can be run on iOS (cross compiled using 4.5.1) and BlackBerry Tablet OS.  Here is the video:



The project will be released shortly to the Android marketplace along with the full source code and some great new graphics thanks to my brother Paul Trani!  If you want the project source code for Flash Builder 4.5.1 + in the meantime, please email me direct dnickull at adobe dot com.

This will be part of the AIR Mobile Code Camp at Adobe MAX 2011 in October!  Sign up now!

Monday, June 06, 2011

Intro to programming with ActionScript 3

Are you a designer or just curious and want to learn programming? Already a coder but would like to learn about ActionScript 3? Could your team benefit from this workshop?

The approach will be relaxed and fun (and effective): attendees will build a simple game from scratch in this ONE DAY INTENSIVE WORKSHOP, and will learn several advanced concepts and useful tricks along the way. No previous coding (or even Flash) knowledge needed at all. No scary technical jargon will be used to make things sound complex, because they are not.

ACTIONSCRIPT 3 is the ideal language to learn how to program, thanks to how easy it is to use and manipulate images and graphic elements, and add interactivity. The approach used will be very accessible, actually without computers in the first hour, using attendees on stage to explain in a practical way how a program works and enact concepts like variables, objects, functions, loops and conditions. Then, it's hands-on and the pace will progressively get more and more interesting.

Everything you will build can be deployed on your computer, the web, and even on MOBILE DEVICES (iPhone and Android). You’ll take all that code with you so you can experiment further on your own. And you’ll be guided on how to go further and presented with a lot of useful resources.

Duration: About 9 to 11 hours, depending on the group rhythm, no-one is left behind. Everyone will learn A LOT about Flash & Flex, and of course, coding, which can be applied to other languages apart from AS3.

Friday, June 03, 2011

Preparation Guide for Hands on Workshop

Flash and the City is next week in New York.  If you are registered and taking the course to learn Flex/AIR mobile development, you will need to do some preparation in advance of walking into the room.  This blog post outlines the steps necessary to be ready on Thursday, June 9.

If you have any trouble with the setup, please send an email to me at dnickull at adobe-dot-com. I also plan to be in the lab room 20 minutes before the session to answer any questions or help out.

See you there! This is going to be the best workshop I have ever had the pleasure of teaching!  An expanded version of this course will be taught at this year's Adobe MAX in Los Angeles.

Sincerely,
Duane Nickull
Adobe Senior Technical Evangelist

System Requirements for BYOL lab

Mandatory:

1. Bring your own laptop.  Operating System: Windows or Mac OS X.
2. Bring a power cord.
3. If you have a Google Android Device running the 2.2 or later operating system, please bring that and;
4. A cable to tether it to your laptop. It is not required that you bring your Android Device but it is highly recommended.

If you have more than one laptop, please bring one with a touch pad that supports transformation gestures (most newer Macs support this) and a camera and microphone.

Mandatory Software required.
Flash Builder 4.5 - http://www.adobe.com/go/try_flashbuilder

Flash Builder may be installed as a trial. This will also install the AIR runtime and SDK.

Optional Software
If you plan to build for the BlackBerry Tablet operating system, please follow the instructions here: http://technoracle.blogspot.com/2011/02/getting-your-flash-builder-ide-set-up.html

Mandatory Courseware:
All courseware will be distributed at the venue itself. If you have time in advance, please download the zip archive from http://www.22ndcenturyofficial.com/ForBlogDoNotDelete/FATC.zip

Notes:

Windows
• 2GHz or faster processor
• Microsoft® Windows® XP with Service Pack 3, Windows Vista® Ultimate or
Enterprise (32 or 64
bit running in 32‐bit mode), Windows Server® 2008 (32 bit), or Windows 7 (32
or 64 bit running
in 32‐bit mode)
• 1GB of RAM (2GB recommended)
• 3.5GB of available hard‐disk space for installation; additional free space
required during
installation (cannot install on removable flash‐based storage devices)
• 1024x768 display (1280x800 recommended) with 16‐bit video card
• DVD‐ROM drive
• QuickTime 7.6.2 software required for multimedia features
• Eclipse 3.4.2 or 3.5 (for plug‐in installation)
• Java™ Virtual Machine (32 bit): IBM® JRE 1.5, Sun™ JRE 1.5, IBM JRE 1.6,
or Sun JRE 1.6

Mac OS
• Multicore Intel® processor
• Mac OS X v10.5.7 or v10.6
• 1GB of RAM (2GB recommended)
• 4GB of available hard‐disk space for installation; additional free space
required during
installation (cannot install on a volume that uses a case‐sensitive file
system or on removable
flash‐based storage devices)
• 1024x768 display (1280x800 recommended) with 16‐bit video card
• DVD‐ROM drive
• QuickTime 7.6.2 software required for multimedia features



Tuesday, May 31, 2011

Video Tutorial: Using Transform Gestures in Mobile Development

This is a quick video that shows the code to control zoom gestures when developing mobile applications with Flash Builder 4.5.  The source code is available if anyone wants it.  Just ping me at dnickull at adobe dot com.



Code Explained:

Line 9: The init() function is called on the viewActivate event for this example as it is a mobile application based on views.  You could queue it from other events.

Line 11:  the Variable myBC is a Spark BorderContainer.
Line 16: The BorderContainer is cast into a sprite and the event passed to the onZoom function is used to scale the sprite on the X and Y planes on lines 19 and 20.  If you want to keep the user from shrinking the sprite below a specific size, the test is done on line 17 to detect the scale.  You only need to test either X or Y and the proportions are constrained.  The best practice for most cases will be to put some sort of minimal scale on such items as it will be possible the user scales it too small and can no longer use a two finger zoom gesture.


To learn more about this topic, make sure to attend Adobe MAX 2011 in Los Angeles and register for the Hands on Mobile AIR camp I will be leading.  Registration is open now and even though we had two mega-labs last year, they both sold out very early.

I am also teaching a similar course next week at Flash and the City in New York City June 9 from 9:00 AM to 2:00 PMN local time.  There are some spaces still available.  Mobile developers are in high demand.  Increase your skills!

Saturday, May 28, 2011

Free Adobe CS 5.5 Web Premium (Flash and the City 2011)


Buy tickets to Flash and the City and win Adobe CS 5.5 licenses (retail value of $1,799), 
VIP seating at the #FATC keynote! http://bit.ly/mzSswF

FlashAndTheCity is only two weeks away and they are giving
something back to all attendees registering for the event in the next
three days, starting from today, May 25, 2011 through Friday, May 27,
2011. It is a free Web Premium Master Collection CS 5.5
(retail value of $1,799), courtesy of Adobe.

This is the full retail version and you can select either the license
for PC or for a MAC. Additionally, the winner will receive a premium
VIP seat at the FATC keynote.

Rules

I will pick a number, between 1 and whatever
number of tickets have sold, and announce the number on Twitter.  
To win you have to follow all three of us on twitter. We
will match that number with the person who bought the winning ticket
number and give away the free license that day. The winner will be
announced on Twitter. HURRY UP and REGISTER NOW!!


Remember, once the event sells out you will miss a chance to attend
one of the most exciting events this year, so do not delay, purchase
your ticket now!

My Twitter is @duanechaos

Friday, May 20, 2011

Adobe MAX 2011 - A Special Deal for Loyalists!

Have you attended Adobe MAX in years past?  If so, you should know about this special promotion for our loyalists (defined as people who have attended MAX previously).  Until May 31st, 2011, you can use this special URL and token to register for Adobe MAX 2011 here.

Please help us spread the good word via twitter too!    Here is a cut and paste tweet (below) or just use the tweet button on this page.  We need help to reach all the loyalists.

Previous #AdobeMAX goers, register before 5/31 for a discount! http://adobe.ly/maxloyal

What is cool about Adobe MAX this year is the fact there is a second event running in parallel with MAX.  The Adobe Digital Enterprise Summit 2011 will take place October 3rd and 4th. Why should you attend?  For starters, I will be speaking at this event.  Second, staying at the forefront of enterprise architecture requires constant exposure to new technical innovations and an understanding of industry trends.   Come to this event and connect with a thriving ecosystem of thought leaders, partners, and technology solution providers. If you are a business decision-maker, technology leader, or marketing professional interested in deepening customer intimacy and extending brand value within your organization, this event is for you.

See you there!

ciao!

Wednesday, May 18, 2011

Club Intrawest Points for Sale

This blog post has been removed to reflect a status of an impending offer. Sorry for any inconvenience.

Tuesday, May 10, 2011

I love my Galaxy S Android Phone's Battery Life!

At Technoracle, we regularly test out devices for long term reliability, performance, and durability.  Mobile devices often vary dramatically from the manufacturer's claims and real world tests reveal the true nature of a specific device.  For example, some smartphones have claimed 4-day standby time.  No device I have ever used has ever met such a claim while we were using it.  Most users we know are happy to get 24 hrs out of their devices with real world uses.

Four days of use from a single charge might be possible if you disabled all functions other than sitting idle and left the phone in a cool room with no magnetic interference.  For most users, add in email account monitoring, some web browsing, navigation and a few calls and the time goes down significantly.  The major reason I went from iOS to Android is that I hated the idea of someone sealing my battery into the phone.  I want two batteries and the ability to swap them out as they get tired. Nevertheless, the Samsung Galaxy S has amazed.


The above screenshot clearly shows that the Samsung Galaxy S smartphone has amazing battery life very close to what the manufacturer claims.  The approximate 65% charge is after 1 day 3+ hours between charges with cell standby and use.  What I have noted is the following tips work well on Android for saving battery life:

1. Reduce screen brightness.  Do this manually.  The auto-detection itself uses energy when woken up.
2. Configure email not to push automatically or synch.  Do this manually.  What point is there for you to have email pushed to you that you will not read?  Wait until you want it, then fetch it.
3. Disable GPS when not in use.
4. Disable Bluetooth when not using.
5. Regularly check the application and memory manager and clean out programs that you are not actively using.
6. Disable notifications from applications (Twitter, Facebook, news, weather, etc.) that you do not need.  When I go on my boat, I do require that severe weather be pushed to me.
7. Disable auto-orientation.  The listener that detects position changes runs the accelerometer, a piece of hardware that consumes battery life.  Luckily the feature can be disabled from the pull down menu.

End result?  

Thursday, May 05, 2011

Flex/AIR Mobile Color Picker

I have been writing a new application the last few days and ran into an issue.  The old mx color picker has no counterpart in Flex Mobile Development.  After some quick research, I decided to make a view that can be reused by others.

The source code can be downloaded from http://www.22ndcenturyofficial.com/ForBlogDoNotDelete/ColorPickerView.mxml
 (right-click on PC, Control-click on OS X and select "Save Target as..." or something like that).  PS - this is my band's official web site so while you're there take a listen to our music!

The controllers are simple Spark Horizontal Sliders that have ranges from 0-255. Each slider has a change event handler registered to the same function.


The logic is included to lay these out for both portrait and landscape modes.  A visual reference to the current color is represented within a Spark rect.  The Button calls a blank function to be used to take whatever action you want to set a color.


As you move the sliders, the color changes.

  


The setColor function does not return anything.  All it does is grab the values and convert them to be used either as Hex (for example, "0X0f3eff") or uint formats.  A click handler is registered against the button to set the color, which can be done from the setLineColor() function.


A small utility class is used to prevent incorrect values from being written when ranges are less than one character long.  The checkLength() function has comments and is self explanatory.  This is to prevent '0f0f0f' from returning "fff" if the values are all 15.


If you use this and find any way to improve it, please consider sharing via this blog post.

Tuesday, May 03, 2011

Duane's World #33 - Ben Watson on CEM/CX

This episode of Duane's World was filmed in Barcelona, Spain with Ben Watson.  The talk focuses on Customer Experience Management (aka CEM) which is an emerging architectural discipline focusing on a customer experience view.  While previous user experience (UX) work has been done by architects in the context of a single application, Customer Experience Management spans the experience over the complete lifetime of a relationship and over multiple channels of interaction (examples: telephone, email, web, in person etc).



If you are not yet convinced that CEM matters, here is some great additional reading on the topic:

"How to Approach Customer Experience Management". Gartner.com. 2004-12-27.

Debor, Jessica (2008-02-20). "CRM Gets Serious". CRM Magazine.

Peppers, Don and Martha Rogers, Ph.D. (2008), Rules to Break and Laws to Follow, Wiley, pp. 24, 164, ISBN 978-0470227541

Strativity Group (2009), 2009 Global Customer Experience Management Benchmark Study, Strativity Group, Inc.

Peppers, Don and Rogers, Martha; Don Peppers, Martha Rogers (2005), Return on Customer, Doubleday, division of random House, Inc., ISBN 0-385-51030-6

Shaun Smith and Joe Wheeler.; Shaun Smith, Joe Wheeler (2002), Managing the Customer Experience: Turning customers into advocates, Financial Times Press, ISBN 978-0273661955

Rae, Jeananne (2006-11-27). "The Importance of Great Customer Experiences". Business Week.

Bernd H. Schmitt.; Bernd H. Schmitt (2003), Customer Experience Management: A Revolutionary Approach to Connecting with Your Customers, Wiley; 1 edition, ISBN 0-4712-3774-4

Lopez, Maribel D. (2007-11-12). "Operators Thrive by Building and Enabling Experiences". Forrester.

Monday, May 02, 2011

Adobe MAX 2011

The new site for Adobe MAX 2011 is now live at http://max.adobe.com/.  You can already register and will get a substantial break by doing so this early in the game. The early bird pricing ends July, 2011.

Adobe MAX awards:

If you have done something really cool in the last year using Adobe technology, consider applying for an Adobe MAX award.  The MAX Awards provide an opportunity to gain industry visibility for you or your clients' projects. The contest will open on Wednesday, June 1, 2011 and close on Friday, July 29, 2011, at noon (Pacific Time).

The categories for 2011 are: Advertising and Branding, Digital Publishing, Enterprise, and Entertainment. Finalists are selected in each category by the Adobe Judging Councils. The top three finalists in each category will be invited to showcase their work prior to and during MAX 2011 to support online voting for the category winners. Online voting will open one week prior to MAX, and the category winners will be announced live at MAX. Award entrants are also eligible for Honorable Mention recognition.

The information you provide in your MAX Awards application will be used internally by Adobe for purposes of judging the awards and may be reproduced, publicly displayed, or used in press releases by or for Adobe for the sole purpose of promoting the MAX event and MAX Awards. Your contact information will be used by Adobe only and will not be distributed or shared.

There is also a Community Pavilion this year again.

Community Lounge

The Community Lounge offers a comfortable forum where designers, developers, and others in the Adobe community can mingle with peers, share ideas, and network. This is your opportunity to spend one-on-one time with these product experts.
Unconference discussions

Unconference discussions are participant-driven presentations and discussions centered on a theme that are open to all. Attendees have the opportunity to sign up and present on topics of their choice. Last year these discussions were very popular. From project post-mortems to open panels, these discussions provide an opportunity for sharing and receiving information and connecting with your community. Multiple discussion themes similar to last year are in planning stages — stay tuned for more details on the Unconference discussions.
MAX Playground

Hang out in the MAX Playground and try your hand at the latest video games. If you prefer classic games, check out the retro area featuring cool games from the past.

I'll be there!  See you there!

Thursday, April 21, 2011

What is Customer Experience Management?

Customer Experience (CX a.k.a CEM) is the sum of all experiences a customer has with a supplier of goods or services, over the lifecycle of their relationship. This covers several phases including awareness, discovery, attraction, interaction, transaction, use, service, cultivation and advocacy.
These are not simply sequential, but rather a continuum of phases existing within the context of CX.

CX is not something you just bolt on to your existing enterprise architecture.


So why does CEM/CX matter? The simple answer is for retention of your existing business customers. Your competition is a click away and studies show people are 3 times more likely to tell others about a bad experience than a good one.  People declaring a bad experience with you are ripe for your competition to steal.
With social media, bad CX stories can escalate virally and ruin the reputation of a business in weeks or even days.  People notice BAD experiences and get emotional!  They want a good customer experience.






Wednesday, April 20, 2011

Adobe Resource Synchronizer CS5.5

Yesterday I installed the 5.5 version of Creative Suite Master Collection. To my dismay, there was no 5.5. version of Soundbooth, which I had uninstalled as per the instructions. To recap, on Mac OS X it is very important to use the Uninstall feature for earlier versions of CS instead of merely dragging them into the trash.

After installing CS 5.5, I grabbed the media to re-install the previous version of Soundbooth (CS 5), which I use regularly for Duane's World. During the installation, an error message came up stating something like "Unable to continue - close the following applications: AdobeResourceSynchronizer". I searched for a while and did not find any application with such a name but did find the process.

If you run across this issue on a Mac, launch the "Activity Monitor" (it is under /Applications/Utilities/Activity Monitor.app). By default, the activity Monitor will only show Active Processes and you will not see the AdobeResourceSynchronizer. In order to stop it, you have to select "All Processes: (Step 1 below), then highlight the process "AdobeResourceSynchronizer" and then hit Quit Process (Step 3 below).


After that you should be able to resume the installation of Soundbooth.  When done, restart your Mac and the AdobeResourceSynchronizer will heal its wounds and restart.

Tuesday, April 19, 2011

Flash and the City - NYC Better than Ever!


This year once again I will be speaking at Flash and the City in New York, June 9-12.  This year I will be teaching a 6-hour hands on code camp for anyone wanting to become a Flex or AIR developer.  

The event website is here.  Please register early to ensure you get a space.
In addition, Flash and the City will be part of Internet Week NY, a very popular and highly marketed festival that attracts citywide attention. Internet Week is a week-long festival of events celebrating New York's thriving Internet industry and community.   Internet Week New York is presented by the International Academy of Digital Arts and Sciences in cooperation with the City of New York and The Mayor's Office of Media and Entertainment.


Monday, April 18, 2011

Extending LiveCycle ES 2.5 for Java Developers

The full courseware that Scott MacDonald, Gary Gilchrist and I delivered during MAX 2010 is now available online.  Anyone may use this material as a self-paced tutorial to understand how Java Developers can extend the native capabilities of Adobe LiveCycle ES.

The course is available as a ZIP file here (right-click and then select Save target as ...")

http://www.web2open.org/courses/LCES4JavaDevs-CourseArchive.zip

This course covers the following topics:

Extending LiveCycle ES for Java Developers

TABLE OF CONTENTS
OVERVIEW
EXERCISE 1: UNDERSTANDING CUSTOM COMPONENTS

EXERCISE 2: DEVELOPING THE CUSTOM COMPONENT .
Task 2‐1: Start Eclipse and create a new project
Task 2‐2: Add the required Java library files
Task 2‐3: Defining the service interface
Task 2‐4: Defining the service implementation
Task 2‐5: Defining the component XML file

EXERCISE 3: DEPLOYING YOUR COMPONENT
Task 3‐1: Package your component into a JAR file
Task 3‐2: Importing the component using Workbench ES2

EXERCISE 4: USING THE COMPONENT WITHIN A PROCESS
Task 4‐1: Create the EncryptManyDocuments/EncryptManyDocuments process and invoke it from
Workbench.
Task 4‐2: Programmatically invoking the EncryptManyDocuments process.

Solution code is provided as well as extra notes on the code for the programmatic invocation: 

Friday, April 15, 2011

New Open Source Mobile Application

This mobile application demonstrates how to retrieve XML data from a server, return the results, and work with the data objects and display them.  There will be a video posted on this blog post very shortly with the instructions for building it along with best practices.  In the meantime, you may download the source code directly from http://www.web2open.org/adc/XMLService.fxp (On a PC, right click and select "Save link as..."; on a MAC, control-click and select "Save link as...").

Now for some words of caution.  First, loading XML into a mobile application is generally a bad idea.  It is far better to use AMF with a 3-tier architecture (hello LiveCycle Data Services!!).  Nevertheless, small XML files can be worked with in this manner!  Enjoy.

Tuesday, April 12, 2011

One Most Excellent book on Ontology Science

It is a pleasure to be able to write to announce what I consider to be the premier book on
the Suggested Upper Merged Ontology (SUMO).  I also wrote the forward for this book and thought I would share it via this blog.  This is a great practical guide to applied ontology projects. Click on the book to see the TOC and to purchase!



Normally within the forward of a book,  writers use generic terms like “fascinating” and
“intriguing” coupled with an array of positive compliments. After all,
the purpose of a good introduction is to set the stage for the reader in
a manner that the reader is highly motivated to read the rest of the
book. While tempted to follow this scripted behavior, I found myself
wanting to take an alternative route for the forward.

Before talking about the book itself, I would like to introduce the
author. My first personal experience with Adam Pease was at an industry
event around 2003 where we sat together on a panel and discussed the
impact of semantics on various industry standards. I was intrigued by
Adam’s knowledge and his enthusiasm to share with others yet there was
something else that made him easy to listen to. He carried with him
wisdom, yet he did not force it upon those in the room. He merely
revealed the knowledge, bit by bit, as the conversation allowed it to
enter. This is very unique in a computer science discipline where
zealotry prevails. He modestly imparted his opinions on the roomful of
people only to the degree it answered the specific question before. This
inevitably brought up another question that Adam usually had an answer
for too.


The result of this behavior was quite infectious. Adam, Kurt Conrad and
I ended up in a late night sushi restaurant somewhere near Menlo Park,
CA discussing how to map SUMO concepts to Mandarin, Japanese and
Cantonese, how WordNet can reference SUMO and why First Order Logic
(FOL) constraints are generally a cool concept to have in advanced
computer systems. An upper-level ontology, such as SUMO, is a common,
shared conceptualization of a domain. SUMO itself, being an upper
ontology, conceptualizes our existence in our three dimensional,
sequentially temporal lives largely bound by gravity upon one major axis
(I think the geographical and geo-spatial extensions to SUMO actually
acknowledge the moon’s secondary axis of gravity which can be seen
manifesting itself as tidal behavior in large bodies of water). During
this discussion, the simple and beautiful truth came to me. SUMO, or
something akin to it, is one of the missing pieces of a large segment of
technical work I have done in my life. If it had been explained any
differently, I would have missed it. Adam’s delivery was the key for
understanding and seeing the value in ontology work. This missing piece,
the shared conceptualization, was the cause of many a failure to design
a proper XML dialects or the resultant mess the old Electronic Data
Interchange (EDI) formats represented. It was not specifically the SUMO
format that was lacking, it was the general lack of an upper ontology
that could provide the basis for mid level ontologies and other domain
specific metadata dictionaries or lexicons.


Up to that point, I had largely worked as a software systems architect
who inevitably ended up dealing with the meaning of some XML dialect.
Defining XML dialects for just about everything under the sun had been a
relatively popular activity in our industry for the 5 or 6 years leading
up to my meeting with Adam. During the entire time I had been in
standards meetings either creating a dialect, analyzing someone else’s
or thinking about software that could work with it, I had never seen
anyone approach the problems from a place of a common shared
conceptualization of the domain prior to embarking on writing the
language. In retrospect, the advent of XML has both benefited humanity
as well as stifling it by allowing people to create specific XML based
languages who could instead benefit from the discipline required to do
the formal modeling work using an upper ontology.


Before my work at Adobe, I had founded such a company, XML Global
Technologies, in 1997. This company proceeded to work with a wide
variety of XML languages and it was evident that reconciling the
semantics between data elements of those languages was a monumental
task. When XML Global was acquired by the Xenos Group in 2003, some of
the original founders and I began a new company called Yellow Dragon
Software in Vancouver, British Columbia. This company had a metadata
registry-repository where we attempted to work again on the
reconciliation of disparate semantics in XML languages. This effort was
Herculean and the need for an ontology was apparent. SUMO was the
logical choice due to its compact size and the fact it has been reviewed
and tested by multiple experts. When Yellow Dragon was acquired by Adobe
Systems in late 2003, I went to work for Adobe (where I still work today!) and have been able to
continue my research into ontology, semantics and enterprise
architecture in that capacity. SUMO has given me the basics for seeing
logic in a multitude of applications and the gaps where software vendors
like Adobe can benefit from the adoption of an upper ontology. Adobe’s
XMP (XML Metadata Platform) is in fact extendible by nature and could
embrace SUMO at some future stage. This is but one example of the
application of SUMO that would potentially be then used by those who
work with common software applications such as Acrobat and Photoshop.


SUMO gives those who use data modeling techniques a common footing to
stand on before they undertake their tasks. It provides a level setting
for our existence and sets up the framework on which we can do much more
meaningful work. SUMO provides order for one level of our chaos.


In 2008 I finished writing a book for O’Reilly Media on Web 2.0
Design Patterns with co-authors James Governor and Dion Hinchcliffe. We
wrote some material about the impact of semantics and ontology within
that book. One such part discussed the phenomena of folksonomy, a loose
and informal set of declarations about resources using largely natural
language tags. While professors and other academic types toil in the
abstract world of ontology, the general population races to set tags to
things. While not a formal approach to creating a semantic web, it has
seemed to work well amongst the multitude of sites implementing the
Collaborative Tagging (folksonomy) pattern


We felt that SUMO could potentially offer a huge amount of guidance to
folksonomies. Imagine folksonomies coupled to an upper-level ontology to
classify tag terms that represent multiple concepts? By mapping SUMO to
terms in WordNet, ambiguities are avoided in cases where words have
multiple meanings. Imagine searching for the term Washington. You would
get results for George Washington (a president), Denzel Washington (an
actor), Washington, DC (a city), the Washington Monument (a large
monument), Washington State University (a school), and more. If
folksonomies can be mapped in a similar manner it might be a valuable
mechanism to advancing semantic web interests. Of course, disambiguation
is only one of the benefits of using SUMO and there are hundreds of
other applications that can embrace it.


Now that I have covered the bases, it is time to bring about the
compliments for the book.  This is going to be short by contrast!


Chances are if you’ve already picked up this book, you have an immense
interest in the topic. This book represents the finest body of knowledge
on SUMO and will be a valuable reference for decades to come. It is a
pleasure to be chosen to introduce the book and it will remain one of my
nearest reference materials while I continue to work in the field of
computer science. I hope you share this view and become involved in the
official SUMO list server (at http://sigmakee.sourceforge.net) where
discussions on SUMO continue. Enjoy the book and keep it nearby for
reference for once you have crossed the chasm of knowledge, you will
start relating everything to ontological terms.

My final word?  If you are interested in this subject matter, you owe it to yourself to pick up a copy of the book and consider the sheer genius of Adam Pease.  You will not be disappointed.