Running Custom MicroStrategy Visualizations on the iPad: Part 1

The very first question I received after showing people my first custom visualization was “Can I run it on my iPad?“.  Surely, Mobile Business Intelligence is the hot item right now, and the fancier the visualization, the more it seems at home on an iPad for an equally fancy demo.  The feud between Apple and Adobe is legendary, and it seemed that as developers we were doomed to rewrite our visualizations twice: Once in ActionScript (Flash) and once in Objective-C (iOS).  Adobe came to our rescue by initially announcing plans for Flash CS5 to export to HTML5 to run natively on iOS.  But shortly after that announcement, Apple countered again by changing the rules to not allow third party code generators.  About six months later though, Apple had a change of heart.  Adobe went back to their plans of building an export option for Flash, and last week, the release of Flash Builder 4.5 made that dream a reality.

How it Works
The main intention of this release by Adobe is that you can develop iOS apps using ActionScript and their tools, and then export it to iOS.  If you’ve ever tried writing Objective-C in Xcode, you’ll appreciate how much easier of a language and interface Adobe offers.  They have a complete suite of mobile targeted components and frameworks if you want to build a whole mobile app.

However, I came across this terrific blog post that contains a video showing a very simple “trick” to take an existing compiled SWF and just convert it to an IPA which can be directly loaded onto an iPad without changing any code.  It sounds too good to be true, but I tried it and had immediate success.  The tool also supports exporting to iPhone, Android phones and tablets and the Blackberry Playbook, all without changing any code.

Check out the video here.

What You Need
The most important thing is really what you DON’T need, and that’s a Mac.  Xcode, Apple’s development software for iOS, only supports Mac, so previously that was a pretty big requirement.  Adobe Flash Builder supports Windows and although some of the steps are “harder” on Windows, they can all be accomplished without a Mac.  The harder parts have to do with generating the signing certificates during the Apple process of generating your IPA (iOS application file).
If you want to push your application to a device, you don’t have to go through the App Store (though you could if you wanted to).  You do need to sign up for an Apple Developer Account which will cost you $100/yr.  With that, you can add up to 100 devices and transfer the IPA to those devices via iTunes. You don’t have to have the physical device with you to set it up, so if someone in a remote office wants to try it, they just have to send you their Device ID and you can set that up through Apple’s Provisioning Portal.  There are ample tutorials online for performing those tasks, as well as walkthroughs on screen directly in Adobe’s software, so I won’t recreate them here.
You’ll also want an actual iPad.  I’m not sure if the simulator would work or not, but the magic of this moment is in holding the device itself.  The simulator only runs on a Mac anyway, and although you can run the Flash Mobile application in an iPad targeted simulator, don’t be fooled: Adobe’s iPad simulator is not the real thing, but just normal Flash Player running at the iPads resolution.  This would allow you to make sure that you have the scaling correct, and it doesn’t test actual functionality.
Where I’m At
So far I’ve converted three of my larger visualizations to the iPad with only a few minor issues: 
  1. A special OpenType font that I commonly use seems to prevent the app from loading.  After I removed the embedded fonts, it loaded fine.  
  2. One of my visualizations also includes dragging a slider around a graph, and that animation is a little sluggish on the iPad.  I suspect tweaking the stage.framerate may improve performance, but I haven’t investigated that yet.
  3. I haven’t been able to get the initializeFromURL() function from the MicroStrategy VisSDK to work yet.  Check out Part 2!
So far, I’ve basically built some demos for our executives to play with and potentially Sales to use to woo customers.  The next logical step is to actually build a functional app that can pull data from MicroStrategy.  As outlined in my post Getting MicroStrategy Data into Your Control, the only functionality you really need is just loading the data out of the dataset on the Document/Report.  But in an iPad environment, it will live external and outside of MicroStrategy.  So, one thing we would have to change is to pull the data remotely.  Fortunately, there is an entire suite of functions along the line of initializeFromURL(), but unfortunately they’re not documented very well in the SDK and I haven’t been able to get them to work very well.  I have got the Flash versions of them to work, but they’re not functional when ported to the iPad.  It’s hard to tell if it’s due to the conversion process, security settings or what, as there’s not really any debugging information available (at least that I’ve found) when porting to the iPad.
By the way, this shouldn’t be confused with the MicroStrategy Mobile application.  This method I’ve described would create a stand alone application, and not an addon for the MicroStrategy Mobile app.
Where I’m Going
I wanted to save this post until I could do a full write up on getting a fully functional MicroStrategy based application on the iPad, but I’m not sure when or if that’s going to be possible.  I suspect MicroStrategy will need to adapt parts of their framework to get them to work with this technology, though I haven’t given up trying to get it to work myself.  In the mean time, I wanted to put out this “Part 1” post just to let people know this technology existed.  My top goal is to port a Flash based app to the iPad that can pull MicroStrategy data directly.  After that, the sky’s the limit.  After playing with Xcode/Objective-C on and off for about a year, I was a little worried that I’d never be able to really bring a professional grade experience to the devices with my skill set (programming is a hobby and not my primary profession).  However, I’m excited that Adobe has not only made it a lot easier to realize an iOS app, but to save us the trouble of having to rewrite code twice even if we could.  In the example I’ve given, I didn’t have to rewrite a single line, and the dual code of Base Model vs initializeFromURL is less than 10 lines of code.  
It’s exciting to see what can grow from this, so if you’re feeling adventurous and have the time to explore, please drop some notes in the comments.  It would be great to compare successes and ideas with others journeying down this path.

You may also like...