Archive for the ‘Mobile’ Category

Flash Lite Quick Tips

Saturday, November 22nd, 2008

Memory Management:

  • Read “Memory Management and Optimizations in Flash Lite” at http://www.adobe.com/devnet/devices/articles/memory_management.html
  • Watch the memory usage in the Emulator’s Memory window.  If you are unfamiliar with memory management and fragmentation, read page 6 in the link above.
  • Set no longer needed local vars to null.
  • Delete class references when you are done with them.
  • Use MovieClipLoader, loadClip, loadMovie and loadMovieNum so that you can use unloadMovie and unloadMovieNum to free memory as much as possible.
  • Divide your app into multiple swfs to distribute the load.  This is the key to distributing load in a large mobile application.
  • Remember that MovieClips exported using Linkage in the Library add additional weight that cannot be removed.  If you have a lot of Linkage, distribute into multiple SWFs.
  • Keep tweens to a minimum.  One at a time, if possible.
  • Do not tween alpha or apply any scaling, if possible.

Testing:

  • Test on the actual device ASAP.
  • When working in the Device Manager’s Emulator choose the actual device from the Emulators Online Library.  The Sample Device Set’s tend to have significantly more memory and all features enabled, and therefore do not give you an accurate idea of how your app will perform on the actual device.
  • Review the Device Profile for the selected device, particularly to determine what Content Types are available and what FSCOMMAND2 commands are available for each content type.

What to do when:

  • If you get a “Internet: Unable to connect to network. Try again later.” message while running your app on the phone, this is likely caused by a load process unable to complete.  For example, if you are dynamically loading a series of images into a SWF or a MovieClip, and the destination for those images is removed before they complete their load, you will receive the above error message for each image that was unable to load.  To resolve this you will either need to wait for images/data to finish loading, stop the images/data from continuing to load, or both before continuing with your event.
  • If something works in the emulator but not on the actual device, test on a different device (a different make and model).  This will help determine the scope of the problem.
  • If you are dynamically loading images and you find that they display as expected in the emulator, but not on the phone, you may need to embed each image into a swf.

Emulator Bug:

  • Not all device content types support full screen.  If you have been testing on a device content type that does, and then switch to one that does not, it may still display in full screen mode, despite the fact that it actually does not support full screen.  If you continue to choose other content types and then return it will usually return to non-full screen if not supported.  Check the Device Profile FSCOMMAND2 list for accurate specs on the phone.

Tips for building your app:

  • Create a KeyManager class that you can pass a class reference to, so that the KeyManager can access the interface definitions of that reference.  The KeyManager class will handle the onKeyDown events for the soft keys, d-pad, number keys, and any additional keys you may have.
  • If you are running a main swf locally and there are other sfws that live on a server and need access to your local swf, you will need to set allow the network swfs access.  Add System.security.allowDomain( “http:www.somedomain.com” ); to the local swf.
  • You do not need to set the fscommand2 setSoftKeys command when running your app in the emulator, but you do when running it on the actual device if you want control of the soft keys.
  • Consider running an event that calls the fscommand2 extendBackLight command to keep your app lit.  For example, set an interval that runs every 15 seconds to extend the back light duration.

I love my iPhone, but…

Saturday, August 23rd, 2008

I can do pretty much everything on my iPhone. I can listen to Pandora any where I want, check my personal and work email, look up NextBus.com, use Google Maps with GPS, or the YellowPages.  I can check any account balance, jot down ideas, update my blog, Twitter, Facebook, MySpace, Google, Wikipedia, take pictures, watch videos, and play games.  I can even tlk on the phone so long as I still have some battery life left.

Many of these applications, although great drain the battery fast, especially the cool feature that turns the iPod app on after you lock the phone and put it in your pocket. I’m really not surprised about the battery life and quite frankly I expected it to suck, after all it is an apple product.  I am, however, a little tired of pulling out my iPhone to find that it is completely dead after a full charge.

As for the phone, for the most part it sucks. First of all it does not always ring. If I happen to have out on a table I may be lucky enough to see it light up, but if I miss the call it takes 30 minutes for me to be notified of a new voice message. When it does ring, it’s not that loud and can be easily muffled. But say I get passed all that and hear the phone ring. I now have a choice, answer and hold the phone up to my ear which tends to get pretty hot and cause my ear and head to ache, or try to untangle my hands free set and put them in my ear before I miss the call or they hang up. I suppose I could buy one of those Bluetooth headsets, but honesty, I don’t want to be that guy nor should I have to spend additional money to get the stock expected experience.

As an UI guy, I love the interface and the touch screen, but as someone trying to make a phone call or send a message via SMS, twitter, email or whatever it is too easy to accidentally touch the wrong button and find that you’ve sent an incomplete message, started dialing the wrong person, or have hung up on the right person (e.g. the customer service representative you waited on the phone for for 20 minutes to have a duplicate charge removed). Again I love the interface and think that it is both fun and interesting experience, but actual buttons would save me both embarrassment and frustration.

Despite my issues with the iPhone and the fact that I will most likely be exchanging mine in an attempt to work out a few additional bugs, I still think it is the best device on the market and stoked to have one.