27 Aug 2014

Debugging on Mobile with Weinre

There is no substitution for actually testing on the device. Between all the different iOS and Android configurations, not to mention the cloud of other manufacturers and OSes, you’re bound to discover some peculiar behavior that only occurs on the device. What to do?

read more
Share this
02 Oct 2013

Adobe AIR on Android – Reading Files from SDCard

Today, I ran into a use case where I needed to access a video file that had been saved by an external application to a subdirectory of the SDCard. At first I thought, hey, no problem, for that I have File.getRootDirectories(). Problem is, on Android…this doesn’t work too well.

read more
Share this
07 Dec 2011

RealEyes Your Holiday!

This year, the RealEyes Media crew has turned into Androids for our annual Holiday card. Not only do we look awesome, but we’re celebrating all the mobile work that we’ve done this past year … and not just for Android, but for iOS and Blackberry, too.

read more
Share this
18 Nov 2011
18 Nov 2011
08 Sep 2011
17 Jun 2011
16 May 2011

Mobile Flex: View Data

From the previous post you should know how to navigate from 1 view to the next using the ViewNavigator.  Now, you want some data in that view right? No problem, this is where the View object’s ‘data‘ property comes into play. Setting the data property is accomplished by passing the data object, in addition to the View’s class name, into the pushView() method on the navigator object.

Example:

navigator.pushView(MyNewView, dataObject);

This effectively calls the setting for the data property of the new View (MyNewView) object that is created.

Managing View Data

You could work with the data property on the View object directly. For instance, if the data object passed into the View via the pushView() method was a simple user object that contained a name property, you could bind the name property to a label control.

Example:

<s:Label id="name_lbl" text="{data.name}" />

Overriding the Data Property Setter

Usually though, you’d want to override the setter for the data property. Then you can type your object and work with it in a better manner.

Example:

protected var user:User;
override public function set data(value:Object):void
{
 super.data = value;
 user = value as User;
}

 

<s:Label text="{user.name}" />

So now we’ve got the data in the view. The next step is to manage the state of each view. With mobile apps you can’t count on the view staying around, so we’ll need to keep a tight control on the state of each view. That way we can bring the user right back where they expect to be when they come back to the app after a call for example. In the next post we’ll look into how to do this. Stay tuned.

Share this
20 Mar 2011

© 2017 RealEyes Media, LLC. All rights reserved.