RSS
 

Design and World

10 Oct

Why do web designers who have mastered javascript and actionscript love the world of Flex and Flash compared to the world of HTML? The answer probably lies in the possibilities that the tools create. With Flex and flash, it takes a lot of effort to make things look bad. With HTML and javascript, it takes a lot of effort to make them look good. So the case of Flex and Flash is Faster, Cheaper and Better.

True HTML can do “most” of what Flex and Flash can do and by the same token, Flex and Flash can do “almost all” of what HTML can do. So when capabilities are alomst the same, the focus is on productivity and this is where Flex and Flash shine. The only drawback? Support on Apple portable devices, but with time that will come.

Speaking of design, I just came across a website that is a marketplace for designs and patterns in the textile and fashion world. A lot like iStockphoto or Fotolio that sells stock images, except that the focus of eDesignCafe is exclusively on vector images and CAD designs that are used in the textile design and fashion world. The model is the simple, freelance designers from all over the worls upload their designs at eDesignCafe. Whenever the design gets sold, they earn a commission on the sale. The seller program lists all the details. Buyers get a wide variety of choice as well and very competitive prices.

Share
 
 

Flex Mobile Time Picker component

07 Feb

One of the deficiencies in the current Flex Mobile Hero SDK is the lack of date and time component. The Flex Mobile Time Picker Component closes the gap with a nice user interface. The user touches on a date or input box to select. The time picker pops up and lets the user change time taking care of all time arithmetic from the touch interaction. When the popup is closed, you can listen to selected date in a callback handler and use the selected date in your mobile app. Supports 24 hour time format or AM, PM format.

You can download this component here

Flex AIR Android Time component for Flex Hero SDK

Share
 

Flex Mobile Date Picker Component

06 Feb

One of the deficiencies in the current Flex Mobile Hero SDK is the lack of date and time component. The Flex Mobile Date Picker Component closes the gap with a nice user interface. The user touches on a date or input box to select. The date picker pops up and lets the user change day, month or year taking care of all date arithmetic from the touch interaction. When the popup is closed, you can listen to selected date in a callback handler and use the selected date in your mobile app.

You can download this component here

Android and Blackberry Flex Hero AIR Mobile Date Picker component

Share
 

Using On-Device capabilities in Android AIR application

27 Jan

I recently completed writing my 5th Android AIR application. This one uses the Active.com database to display events and activities in your area like running, swimming, cycling, marathons, cheerleading etc. For those of you who do have an active lifestyle, Active has the best activities database in US.

Well on to more important things like using the on-device capabilities like email, sms, phone and web-link from your Android AIR app, it was ridiculously simple to do this. Everything is essentially a URL with a change in protocol (so instead of http for web, it is tel for telephone) and the data is passed as url variables aka request paramters in exactly the way you do with an http url.

Want to make a call to a contact whose phone number is in the eventContactPhone string variable?

navigateToURL(new URLRequest("tel:"+eventContactPhone));

Want to send email to xyz whose email is eventContactEmail with subject pouplated from variable subject and body from variable body?

navigateToURL(new URLRequest("mailto:"+eventContactEmail+"?subject=" + subject + "&body=" + body))

SMS takes the same form with a current limitation…you cannot populate the subject and body (come to think of it SMS does not have subject anyway)

navigateToURL(new URLRequest("sms:"+eventContactPhone));

Driving directions from maps.google.com are slightly more involved. You have to build a url that looks like this and call the navigate to the url method


var loc:String="http://maps.google.com/maps?f=d&hl=en&geocode=&saddr="+startAddress+"&daddr="+destinationAddress
navigateToURL(new URLRequest(loc));

The starting point for you map can be a lat, long geolocation. For this startAddress will be just a comma separated latitude and longitude obtained from your gps.

startAddress="32,73,-96.97";

So pretty much the last piece of the puzzle is how do you get the latitude and longitude from a gps enabled phone? Not too hard. The code below is pretty self explanatory and the lat long location gets updated every 5 seconds.


public static function locate():void {
if(Geolocation.isSupported==true){
geoLocation = new Geolocation();
geoLocation.setRequestedUpdateInterval(5000);
geoLocation.addEventListener(GeolocationEvent.UPDATE, handleLocationRequest);
}
}

public static function handleLocationRequest(event:GeolocationEvent):void {
lat=event.latitude;
long=event.longitude;
}

Drop me a note if you can think of any other on-device feature you have used from your Android Flex AIR application and I will add it to this post. Do not forget to send me sample code lines aka codelets as they go a long way in undertsanding. A few lines of code are worth a thousand words.

For those of you interested in getting the Active Android application built using Flex AIR, you can get it by following the url below on you Android phone
http://www.androidzoom.com/web/indice/qrLink?appCode=rgao&dwnId=14232265

Can also be downloaded from androidzoom.com url by scanning the QR code using the mobile phone
http://www.androidzoom.com/android_applications/sports/action_rgao_download.html

Share
 

Flex Android AIR Applications with Burrito

29 Dec

Flex Builder Burrito built on Flex Hero SDK and AIR 2.5 makes mobile application development easier. Those who have been doing Android development for sometime will realize that one of the most difficult tasks is writing apps for different screen sizes and maximizing the screen usage without limiting yourself to the lowest common denominator of screen density and size. The Burrito preview version of Flash Builder provides different devices simulators (not really actual android simulator, but more of an AIR simulator for the different screen sizes and densities) that makes the task of testing code for different screen sizes easier.

The second great thing about this release is performance optimization. You have to follow the strict guidelines and stay away from components that are not “mobile optimized” to reap the benefits. The code hint in eclipse lists the components that are not mobile optimized so good to check on it at the point you start using the component.

The third important area that this release addresses is the core or the essence of navigation or screen-flow of mobile applications. The Navigator is a singleton that manages navigation between different views and this makes writing mobile applications a lot more easier as you can focus on writing the views and leave the navigation to the SDK components.

Getting Started with Flash Builder Burrito

  1. At the time of writing this blog, the preview version of Flash Builder Burrito can be downloaded from the Adobe labs website at this link.
  2. If you have CS5 or any other previous version of CS installed, you might have to remove that before installing Flash Builder Burrito. We recommend trying out the install of Flash Builder first and removing CS versions only if you hit a problem.
  3. If you are ok with the 60 day trial license, great! if not, you can use your Flash Builder 4 license key. CS5 license key may not work.
  4. If you had uninstalled CS versions you can install them back now
  5. Start Flash Builder Burrito and use the default workspace. If you change the default workspace, you might hit issues (which disappear when you change back to the default workspace)

Samples and Tutorials

  1. Adobe has published some useful samples and tutorials which can be found at this link. The samples and tutorials are good to go-thru to learn about capabilities as well as limitations.
  2. An in-depth tutorial of the Employee Directory can be found here.

Understanding Mobile Applications with Flex Android SDK Burrito

The navigation pattern is at the heart of understanding mobile applications built with Android. The navigation is visually controlled by a navigation bar at the top (that you can choose to make invisible in certain views). The navigation contains place holders for actionContent and navigationContent. Loosely speaking, you can put your own graphics and buttons in these areas (any component) and define what happens when you click these. You can place more than one…but run the risk of making it look a bit ugly if you put too much.  You can even customize what happens when users click these buttons depending on what screens or views they are in. The way it works is it calls a method or a function on the view and you can make this function do different things in different views. You can even change what buttons appear in different views for a completely customized navigation and action bar. In essence there is enough capability to customize the navigation but there are certain limitations as well primarily

  • Limited skinning capability of the Navigation bar
  • Limited documentation on capabilities and usage around navigation. You pretty much have to dig into the Hero SDK code to understand how the navigation content and action content works if you want to customize. The samples and tutorials help a bit

The way navigation works is pushing a view into the navigator or popping a view from the navigator (back button). The navigator takes care of preserving the state of the view that is pushed into the background when a new view is pushed into the navigation stack. When you push a view into the navigator, you pass it a data object that seeds it with initial data or some config that can be used to populate the initial data. Views support a viewActivate function that is invoked when a view is created (when pushed in for the first time) or activated (as a result of some view being popped out of the stack). An apt one line description of the navigator management would be “A Last In First Out (LIFO) stack of views”.

Writing those Mobile Optimized Views controlled by the Navigator

The starting page of each mobile application is defined by the home page designated in the application startup mxml. You can choose not to have a home view and choose a more dynamic startup experience by choosing your view in the applicationComplete method. This is very useful if your users want to customize there startup page. At the heart of the mobile optimized views is the MobileIconItemRenderer list structure. This list structure is optimized to display

  • A title
  • An icon/image
  • A brief description

of each element in the collection. Want it to do more? Tough luck! Best would be to copy the code and change it to implement your customized structure. Some limitations around usage of this list structure are

  • Inability to use embedded fonts in the title or description. The code in the Hero SDK might make you think that embedded fonts work but we just could not make it work so likely some bug here.
  • Cannot use images/icons of different size. You have to copy the code and customize if you want to use images/icons of different size. Not a big task since the ley lies in making the IMAGE_WIDTH and IMAGE_HEIGHT properties instance variables (they are static).
  • Skinning the renderer background took some time to figure out. This can be done  by extending the MobileIconItemRenderer and implementing actionscript or mxml graphic fill utilities in a rect that is 100% width and 100% height…just like you would do in a Flex 4 component skin

Once you have perfected or adapted the MobileIconItemRender to your needs, you obviously need to take some action when a user clicks/touches an item in the renderer by taking him/her to a detailed view. You write a view for the details and push the view in the navigator using the click method handler. Back from the details view is implemented by popping the detail view. The neat thing here is that since the navigator back is integrated with android api you can jump from your app to a web browser abd be returned to you app when the use presses the back button.

One important thing we thought was missing was the popup menu capability when a user presses the menu button. Android users use this feature frequently and it would have been great to have a popup menu capability that can be customized for views, just like the navigator capability.

A small thing that is missing is integration with the Android notification API. A feature that informs your application of events that you subscribe to (sorry no “you got mail” type feature yet).

A small good feature is ability to use a splash screen instead of a preloader on startup.

Lessons Learnt

  • There is a learning curve since you have to understand new architecture pattern and new objects, primarily the navigator and view
  • Android app startup is slow. We suspect this is due to the time taken by AIR framework that runs it to warmup. Even the splash screen does not display for a few seconds when launched for the first time making first time users wonder “what on earth is going on?”
  • Once warmed up, the apps are decently fast. Especially impressive is the MobileIconItemRenderer.
  • There is still a lot of code to write in the views and passing data between the views. Setting up a singleton class that acts as the data mediator will be of great value in exchanging data was view get pushed and popped. I would stop shrt of calling it a view controller (since that is the navigator) and call it a data controller to augment the capabilities of the navigator.
  • Skinning is a pain to start off with since for performance reasons it is best not to use Flex 4 skinning. The good news is that you can use the graphic primitives and fill, gradient fill commands and once you master that your apps will look and feel better than android apps written in Java.
  • Test you app on different form factors. This is done in the Run>Run Configurations” menu option in Flash Builder

Where to go from here

Start off with a basic app and basic views. Iteratively refine the views to look better. I found some great 3D visualization components at FlexDownloads.com, the 3D Vertical Coverflow and 3D Horizontal Coverflow that made my apps look better by moving away from the typical 2D list layout. Once you get  a hang of the navigator, view and passing data back and forth complicate!

Some of my Android Apps

You can download three of my Android apps from the Android marketplace. One of them is free and the two others cost $0.99. If you cannot find them then most likely you do not have Android OS version Froyo 2.2 or Touchscreen capability since the marketplace filters apps based on these capabilities.  In the Android marketplace search for

  • News Blend – A free app that provides news from 6 different news sources
  • Entertainment Weekly – $0.99 with news from EW.com
  • Bollywood mirchi – $0.99 with latest news from Bollywood using RSS feeds

You can also navigate to some of then from the AndroidZoom links below and download by scanning the bar-code with your camera (you need a free app to scan)

If you have some development experiences to share, drop me a comment and I will update the post.

Share
 

Android AIR Snow Component

04 Oct

Need Snow for your Weather app? To show climate of a place? special effects? Christmas or New Year visualization?

The Snow component for mobile Android applications is very easy to use in your Flex/Flash/AIR mobile application and supports many customizable properties like
1. Height and Width
2. Wind speed
3. Random acceleration for a more realistic effect
4. Particle size
5. Max number of particles

This component brings the snow particle effect to your Android AIR app, Flex app, AIR app with many different possible configurations that create a realistic effect from a simple gentle snow fall to an active turbulent precipitation!

Android AIR Flex Snow Component

Android AIR Flex Snow Component

Share
 

Vertical Coverflow Layout

04 Oct

The Flex 4 Vertical Coverflow Layout is a spark layout for Spark Groups and Lists. It can transform the traditional 2D vertical display into a more interactive and appealing 3D display. Just like its Horizontal sibling, the Flex 4 Horizontal Coverflow Layout, this component uses the new 3D capabilities of Flash Player 10 along with the concept of layouts in Flex 4. The result is one very lightweight and action packed component that supports many configuration options making the display very versatile.

The basic plumbing of this layout is the matrix 3D representation of every object and its position in a 3D Cartesian space. The idea itself of the state and coordinate representation itself is not new, but what makes it interesting is the new capability offered by Flex 4 of defining custom layouts which gives the component a lot more flexibility.

This layout is very suitable for mobile android AIR apps since it is extremely lightweight, easy to use and interactive. You can preview this component by following this link or clicking the image below. Try out the different preset options and notice how the display changes.

3D Vertical Coverflow for Flex 4 and Android AIR Applications

Share
 

Coverflow Layout – Flex 4 and Android

04 Oct

The Coverflow layout has been around for some time in Flash and Flex. This interesting 3D Visualization of graphics and display objects mostly used Papervision 3D components in Flex 3 before the days of Flash Player 10. Flash Player 10 introduced better 3D support and Flex 4 introduced the concept of layouts that can be generically applied to containers. This has opened up possibilities of a whole new breed of 3D components that are extremely lightweight and easy to use.

To start off with, we reworked the all time favorite Horizontal Coverflow Component as a Flex 4 layout. The result was amazing. In one small light weight class, we were able to achieve an animated layout equivalent to its predecessors in Flex 3. What is equally amazing is that this component works in Android mobile devices too.

The family of coverflow components is big and there are many interesting variants possible. The variants for the most part play with perspective projection, depth, focus and rotation. The Flex 4 Coverflow component is versatile enough to accept these values as parameters and configure the display to meet your needs. This layout and its variants can be applied to any Display Object. If you want to try this component and see how the different properties affect its look and feel, follow this link to the Flex 4 Coverflow component and rate the component up or down.

Coverflow Layout

Share
 

Android 3D Tag Cloud

12 Aug

Form trumps Function many a time. Apple products are such a huge success primarily because of form (they are of course very functional too but the sucess can be attirbuted more to the display and user interactivity than to function). Android applications on the other hand are relatively weak on form and display. This is however changing with Adobe putting a lot of effort to incorporate Android development in there suite of products, Flash and Flex.

Flash is still many years ahead of HTML 5 when it comes to fantastic displays, dynamic behavious and user interactivity. Imagine now these Flash and Flex “components” ported to Android for use in Android applications. You can expect an entirely new breed of interactive Android applications powered by Flash. Take for example the 3D Flex Tag Cloud application from FlexDownloads.com. It took about a day to convert this Flex application to a multi-screen application that will work in Flash, Flex, AIR and Android.

Dynamic Rotating 3D Tag Cloud for android Apps

3D Tag Cloud for Android

This component is available at FlexDownloads.com

This is of course one of the many components that Flash and Flex developers are porting for use in Android apps. This reinforces the universal appeal for Flash as a multi-screen capable tool that can harvest an initial investment in many ways.

Share
 
Comments Off

Posted in Mobile & Android, User Interface

 

Flex Google Checkout Component

22 May

Google Checkout is a good alternative to PayPal for many businesses. If you own an eCommerce website, selling physical goods or digital downloads, you would in most cases want to support both if not more options. Other payments options that are popular are Moneybookers, Amazon Flexible Payments and of course Credit card acceptance through one of the many merchant processing options.

The Flex Google Shopping cart allows you to accept Google Checkout as a payment option from your Flex website. It uses the Google HTML Name-Value pair API to post the contents of your shopping cart to Google. The cart comes with a rudimentary Product display and examples on how call the Shopping Cart add/delete/update methods.

Clean effects and a lot of useful Ecommerce functionality make this one of the best Flex  Google shopping carts in the market.


Flex  Google Shopping Cart

Share