Flash Lite 1.1: Blood Pressure Tracker
If you follow my blog you’ll no doubt be under the impression that I am all about Flex. For the most part, this is true, and as a Sr. Product Specialist here at Adobe, specifically for the Flex product, I spend the majority of my time in that wonderful world. Occasionally though I’ll head out to other technologies provided by Adobe and give them a whirl. Sometimes this is driven by customer interests/demand, but others are purely exploratory in nature. Such is the case with the following Flash Lite 1.1 application - Blood Pressure.
I’ve always struggled with hypertension. I have the blessing of genetics to thank for that as both my parents manage their blood pressure with medication. Much like the now popular pharmaceutical commercials, hypertension doesn’t discriminate about age, weight or physical fitness. While certainly these factors can play a role, one might be the perfect human specimen physically, and still have high blood pressure. Even as a soldier in the US Army, in peak fitness, running several miles every day, with a body fat percentage nearing single digits, I had to keep my blood pressure in check.
One way to manage hypertension is to be aware of it, and how your body exhibits those stressors. This most commonly takes the form of simply logging what your blood pressure is at various intervals throughout the day or week. Obviously this could be done on paper, but I’d leave it somewhere, my wife might throw it away, or my daughter would use it as the foundation for her next work of [scribble] art. Excel might be an answer, and there are even desktop applications for this purpose, but I don’t want to have to power up my laptop every time I want to record my blood pressure.
It then occurred to me that I almost always have my [Flash Lite enabled] phone with me, and that I could write an application to support my efforts. That application could keep the data on a remote server. Then I wouldn’t have to worry about it, and I could potentially expose a larger set of functionality through a Flex application. This is the genesis for my Blood Pressure application.
![]() |
|
![]() |
At first glance this is a pretty simple application. You can add blood pressure readings, view a list of historical readings, and update or delete readings. Doing this with what essentially amounts to Flash 4 ActionScript however was a very sizable task. Remember that I’m storing all my data on a remote server (powered by ColdFusion MX 7) through loadVariables() calls. No fancy SOAP or even XML here, just name/value query string values.
When a data request is made, there are no events or other notifications; I simply had to build that myself. When the user wants to page down through what could potentially be several years of historical information, I have to manually account for where they are in the overall dataset. I use a scrollbar to indicate the overall number of records versus the user’s current position, and this too had to be invented. A list control to show selected fields from the data objects also had to be invented.
Outside of the UI elements, there’s a ton of processing on the fields in the UI that occurs. Think about the fact that readings are recorded with date and time information, but that no Date object exists in Flash 4. Dealing with leap years meant porting a JavaScript routine I found on the web to ActionScript - Flash 4 ActionScript. I also had to be able to assemble/disassemble date values to coordinate data communication with the server. When the users moves the months from February to March to … I adjust the day of the week (spelled out) to reflect their new selection. None of this existed, and all of it had to be written from scratch.
You might then understand how the decision to post the source on my blog has pained me so much. It’s been a ton of work, but work from which I’ll likely never use fully due to some constraints that I’ll mention in a moment. My thought then is that perhaps the community can benefit from my pains and in studying how it is I went about creating a data-centric, internet-connected, Flash Lite 1.1 application. With that being said, attached to this blog entry is my Blood Pressure application.
You know how when you set out to learn about a specific technology, that there are always pitfalls of which you were initially unaware? Such is the case with Blood Pressure. Most notably is that Flash Lite 1.1 looks at URL’s as distinct entities. I have a “list.cfm” an “update.cfm” and so on for the various actions needed by the application. Flash Lite 1.1 looks at those as different destinations, and requests the user’s approval before sending the data. This can be very aggravating when you just want to make a new entry.
In looking back, it’d be better to have a single “bloodpressure.cfm” or the likes that I could control through query string arguments such as “?action=update”.
The other limitation comes from being able to uniquely identify the user. Rather than deal with a login system, I figured that I’d rely on the phone number. If you’re like me and you take your phone number with you from phone to phone, then it would consistently identify your data. Besides, who’s ever going to use this besides me? Well it turns out that when Flash Lite 1.1 goes to access the phone number, it has to, once again, get approval from the user.
Note to self (does anybody remember Parker Lewis Can’t Lose?): next time use a login authentication scheme.
A note to those of you that put this one your phone for a test spin: I do record the phone number and store it in my database on my server. I have no intention of sharing this information with anybody, and quite frankly I’m not sure I’ll ever even look at it. That being said however, it is a file on the Internet and could potentially be susceptible to a hacker. If you have a problem with using your phone number in this fashion, then I suggest that you avoid running this application on your phone. The emulator however uses a dummy phone number, which should work great. All I ask is that you not delete any data that you didn’t create.
In the end, all these additional prompts really almost make the application unbearable to use, so I haven’t. It’s just been sitting around for months now, collecting digital dust. As I pick up my next Flash Lite 1.1 project, I find myself referring back to the code. It occurs to me that if I am referencing the code, then there’s likely others out there that can benefit as well. In the spirit of open source, I hereby set Blood Pressure free unto the community.
I started a Flash Lite 2 version not too long ago. It’s got a much improved UI and adds charting of your data (a la the Drawing API). I’ve even started on a Flex 1.x and subsequently Flex 2 version with far more substantial capabilities. Will I send those off as well? Perhaps one day, but for now I encourage you to explore Blood Pressure, it’s substantial code, and to provide me with feedback should you go so far as to run it. I provide not guarantees about the condition of this software, but would love to hear from those bold enough to give it a try.


January 24th, 2008 at 9:20 pm
In this article you say “Well it turns out that when Flash Lite 1.1 goes to access the phone number, it has to, once again, get approval from the user”
How do you find out the phone number of the phone the flash lite app is running on? Your article is the only reference to doing this I can find on the web!
September 3rd, 2008 at 4:20 pm
Interesting, well worth reading.