Rolling your own custom mobile templates for Flash Lite Development
January 9th, 2006 by Scott Janousek|
IMPORTANT UPDATE
09/18/2006 The official iriver u10 template is now included in Mobile Profile Update #4 that is distributed by Adobe. It is recommended you no longer use the temporary u10 template I had created below as it was never certified by neither Adobe or the vendor … besides, you get a nice .MXP install with the newer one! Thanks! |
Back in December 2005 (when a bunch of us Flash Lite folks were at Adobe) there was some talk about customizing the mobile templates for Flash Lite development. I think it was Justin who brought up the topic.
Well, it’s totally possible and relatively easy to do. However, one of the reasons why Adobe doesn’t document it … they don’t like to have all kinds of people mucking around inside a directory with prefabricated templates.
But there’s nothing stopping you from doing this …
I just put one together for the iriver U10, even though I know Adobe is bound to push a U10 CDK soon.
I thought it might be a good exercise and I got sick of using the lackluster default profile I created.
The updates don’t occur as frequently as we would all like (perhaps this should be an interns job?), and the current feature for “check for device updates” in the emulator panel doesn’t actually update real-time (you have to manually click, go to the site, download the .mxp, etc … Adobe please change this if it makes sense to do so?).
In this post, I’m going to explain how to create and install your own mobile template.
I created a template for the u10, even though it will probably appear on Adobe’s site within a few weeks (at which point you should use theirs, not mine).
————————————————-
Download the complete u10 profile I created from scratch:
————————————————-
Install notes (I’d create an MXP, but I figure Adobe will be doing that shortly anyways for the real deal):
————————————————-
Steps to create a mobile template (for the u10, yours may differ):
This is just from memory, so please post if I forgot a step or two. You can follow along if you have already extracted and installed the template.
1.) First and foremost, it is important to backup your mobile templates directory before beginning. If I have to explain why, you probably shouldn’t be mucking around with the templates directory.
The mobile templates are located for windows under:
C:\Program Files\Macromedia\Flash 8\en\Configuration\Mobile\Devices
On a Mac it is something similar.
Make a backup for that directory. Good.
2.) Now, enter that directory and copy one of the other templates to start the u10 template. I used Nokia_6680.xml. Rename the copy to Irivier_u10.xml.
3.) Now open it with your favorite XML editor (notepad works fine too). You’ll now want to change some parameters. First, you want to change the device tag to:
<device id=”999″ width=”320″ height=”240″ heap=”5120″></device>
I set the id to 999 (a number not used), adjusted the width and height for the u10 content, as well as the max memory available. The u10 doc says 5 megs, hence I put 5120 (obviously, you’ll probably want to keep memory to minimum).
Update all the locals to this type of format. Basically, slash separates the hiearchy seen in the mobile emulator, so there will be a top level iriver directory, then u10 directory, then iriver u10 template folder.
<locale id=”de”>
<name>iriver/u10/iriver u10</name>
<name>Hersteller/iriver u10</name>
<description />
</locale><
change the content type tag to:
<contenttype id=”standalonePlayer” width=”320″ height=”240″ />
Next, set all the features available for the u10. I came up with this:
<feature contentType=”standalonePlayer” name=”DeviceSoundsOrdered” value=”DeviceSound_MIDI_Generic,DeviceSound_3GP2,DeviceSound_3GP” />
<feature contentType=”standalonePlayer” name=”NativeSounds” value=”NativeSound_ADPCM,NativeSound_MP3,NativeSound_PCM” />
<feature contentType=”standalonePlayer” name=”LoadMovie” value=”OnePerKeyPerFrame” />
<feature contentType=”standalonePlayer” name=”getUrl” value=”OnePerKeyPerFrame” />
<feature contentType=”standalonePlayer” name=”Loop” value=”Yes” />
<feature contentType=”standalonePlayer” name=”MultipleDeviceSound” value=”No” />
<feature contentType=”standalonePlayer” name=”FSCommand” value=”OnePerKeyPerFrame” />
<feature contentType=”standalonePlayer” name=”keySet” value=”Phone” />
<feature contentType=”standalonePlayer” name=”mouseType” value=”None” />
<feature contentType=”standalonePlayer” name=”SMS” value=”No” />
<feature contentType=”standalonePlayer” name=”LoadVars” value=”OnePerKeyPerFrame” />
<feature contentType=”standalonePlayer” name=”DeviceSoundKeyOnly” value=”No” />
<feature contentType=”standalonePlayer” name=”InputText” value=”No” />
<feature contentType=”standalonePlayer” name=”soundEnabled” value=”Yes” />
<feature contentType=”standalonePlayer” name=”NavigationType” value=”4Way” />
<feature contentType=”standalonePlayer” name=”MMS” value=”No” />
<feature contentType=”standalonePlayer” name=”Email” value=”No” />
<feature contentType=”standalonePlayer” name=”SetSoftKeys” value=”Yes” />
Ok, that’s it for that file.
4.) Now make a copy of the Nokia_6680 directory. Rename it to: IRiver_u10.
Enter the directory. You’ll notice a main template that shows the device, as well as an “active” template, and a “mask” template. Another xml file for the specifc device is located in this directory.
All this should probably make sense to you on how they do skinning for the emulator.
Open the xml file and change the skinDescription tag to:
<skindescription width=”320″ height=”240″ skinImage=”iriver_u10.png” maskImage=”iriver_u10_mask.png” activeImage=”iriver_u10_active.png” contentMask=”#FFFF00″ skinMask=”#00FE00″>
</skindescription>
Rename all the template files to iriver_u10.*
Change the device node to:
<device id=”999″ />
or whatever you entered in the previous XML file.
Then update the controls so that the device keys are set properly. Remember that volume +,- are the softkeys on the u10. Then you have left, right, up, down.
Note, that you can set the tooltips, and the mask hex colors match the colors found in the _mask file. Pretty simple.
<control type=”button” action=”soft-left” tooltip=”Left Soft Menu” mask=”#0066FF” />
<control type=”button” action=”soft-right” tooltip=”Right Soft Menu” mask=”#9966FF” />
<control type=”button” action=”left” tooltip=”Left” mask=”#33FF66″ />
<control type=”button” action=”right” tooltip=”Right” mask=”#660000″ />
<control type=”button” action=”up” tooltip=”Up” mask=”#33FF00″ />
<control type=”button” action=”down” tooltip=”Down” mask=”#33FFFF” />

Now comes the fun part … replacing all the graphics, and creating the mask that will be used to drive the controls. I used photoshop to do this.
You can find the .psd inside the IRiver_u10 template directory. Just something quick I whipped up …
So the first graphic file, iriver_u10.png will just be a screenshot of the device. iriver_u10_active.png defines the active key area (in our case the whole device (rocker panel) so just use iriver_10.png). The iriver_u10_mask.png is essentially the hotspot areas that are applied as masks to the other device graphic files.
Careful, all 3 files should have the same dimension and position for all the elements within.
5.) Now, you’ll want to create a mobile template to open in Flash. Just duplicate:
C:\Program Files\Macromedia\Flash 8\en\Configuration\Templates\Global Phones\Flash Lite 1-1 – Symbian Series 60.fla
and rename it to something iriver_u10.fla … then open it and set the dimensions to 320×240, and the frame rate to 15fps – 30 fps.
15 fps is reasonable for the u10. It is pretty zippy device, so even 20-25 fps might be a good value to use (depends).
Lastly, select the u10 template and set it as the default device.
6.) Ok. Now that all that’s done. You need to test your template. Load up flash and access the u10 template you just created. Test some content. I included test_u10.fla as a sample file. Everything should be good to go.
7.) Remember that when Adobe releases the official u10 template, use that one instead.
I haven’t really thoroughly tested mine, and it was merely used as an exercise.
Now, when new devices appear you have an idea of how to create a temporary mobile template.



January 9th, 2006 at 4:40 pm
Hi Scott,
Thanks for the good info –
How is the iRiver working out for you? I have been doing a bit of window shopping for an MP3 player latley – was thinking of the U10 so that I could eventually take advantage of the possibilities of creating in Flash Lite. But, it seems that at either 1gig or 512MB it is just missing a little something. What’s you thoughts?
Also, does it have a good voice recording feature? If it has decent sound recording quality, I would be more than glad to get it, then probably have another MP3 player with more storage for video files.
Thanks!
January 9th, 2006 at 5:52 pm
Good article Scott. I wanted to mention that you can create your own device profiles however if you modify any existing files for Adobe officially created profiles you may run into issues during testing. The XML attributes (supported device capabilities) that are defined for each device are based on direct testing and certification with Adobe’s partners. Changing any of these values may result in different perfomance characteristics when testing on an actual device.
We are finishing up the device profile for the iRiver U10 and will have it available for download soon. For more info about developing content for the U10 you can go here: http://www.macromedia.com/devnet/devices/iriver.html
January 9th, 2006 at 7:15 pm
I like the iriver u10, but obviously it will be replaced soon with either a 2GB or 4GB model (they are not selling here in States yet though).
I’m actually going to ebay my nano, since I don’t use it anymore … I use the ipod Shuffle and u10 … but only because my dream phone doesn’t exist here in the States yet (one that not only does m3′s, but everything else!).
Honestly, there are some design flaws to it. despite me loving the device.
Like you can’t listen to FM while it’s plugged into the cradle … and you can’t use the UI without the remote while it’s in power/data mode (or in the cradle). Plus the synch software isn’t quite there yet. No built-in speaker (guess they couldn’t fit a quality speaker in the footprint). Lastly, I am so used to bluetooth, it bothers me I have to use a wire to connect it (but ipods are no different). Other than that it’s perfect.
On the bright-side, the screen is incredibly crisp, the Flash Lite 1.1 implementation is superb, sound quality is excellent, and the battery life is great. Those things alone make it batter than the smaller ipods, in my opinion.
I’d wait and buy a 2-4GB model when it comes out. Oh yeah, sound recording is decent on it.
—
Bill, that’s what I was guessing.
I just thought it was worth putting out there, so people know it can be done (even if it’s *not* recommended).
January 10th, 2006 at 2:26 pm
Hey Scott,
Groundbreaking article. The community has been waiting for the official U10 profile for so long. FLASH LITE HACKS. Im bookmarking this one.
Luciano
January 11th, 2006 at 12:13 am
Great work Scott, thanks for taking the time. The u10 is so cool it makes you want to spread the joy.
Even with the little quirks that could be better…
May 22nd, 2006 at 12:56 pm
needs a standaloneplayer
May 29th, 2006 at 10:32 am
i need one
how do i get it
May 30th, 2006 at 9:19 pm
I would like to know if I may redistabute it on my site at http://jrcproduct.com ?
It would be free from my site and with full credit to you.
June 29th, 2006 at 3:14 pm
What part do I need to change to make this work under flash lite 2.0?
July 23rd, 2006 at 11:46 pm
I have an idea oh how to read any document using the iriver u10 but I don’t have the flash programming skills to pull it off.
Have any of you heard of Macromedia Flashpaper? It converts any document into a swf that is basically a self-contained document reader. It seems conceivable to encapsulate this document in another flash program, utilizing iriver’s commands, to operate the reader interface. I am just concerned that there might be compatibily issues with the different versions of flash, but hey I’m not the expert.
If anyone manages to do this right, I think the whole mobile device market utilizing the flash environment would be most grateful. I certainly would be.
November 17th, 2006 at 10:18 pm
hey que hondas
January 18th, 2007 at 10:41 am
Hola, vengo a flotar.
Bueno. Chau
August 3rd, 2007 at 5:51 am
I read your FriendsOfEd book & it is great…
I am developing for a Nokia E62 using the Flash 8 Pro and Flashlite 2.1 Player for Symbian S60 r3 which I downloaded from Adobe. The Flashlite 2.1 player appears to work fine on the E62, however the Adobe site says Flashlite 2.x is not supported on the E62 so there is no device profile.
The E62 has a full alphanumeric keyboard but I am trying to make an application that will be portable to other phones, so I am using only the directional keys, softkeys, and numbers for navigation, so I thought I would be able to use a device profile for another phone…
The screen of the E62 is a landscape 320 x 240 and the only available profile with this screen shape is the Generic Windows Mobile profile. So I am using it but I have been running into problems where my code works very differently on the emulator and on the actual device.
Do you know of an E62 Flahlite 2.x profile for Flash 8 or do I need to make my own using the method in your tutorial? It seems fairly hard and tedious (although there is a vwery similar device, the E61, which ha a profile so I can copy it and make slight modifications.)
September 10th, 2007 at 8:26 pm
[...] a while back I wrote a very informal step-by-step post on how to customize profiles within Flash 8 [...]