I wanted to reference a terrific article by Andrew Muller and provide some source code.
Recently I received a BlackBerry Playbook tablet, very exciting. I have a client who is interested in a Flex and AIR check-in app (along the lines of Foursquare). The initial challenge was to get the geolocation of my device and pass it to an API which would return to me places within a certain distance. I wondered about using either the Foursquare or SimpleGeo API’s respectively. Then I found Andrews article. You can link to it here:
I asked Andrew if I could post the code, which he kindly agreed to. You can get a zip of the code from the link below.
A couple of things to note. We found that Simplegeo had not anticipated Flex/AIR apps hitting their API, so had no crossdomain.xml file in place. They have now rectified that issue (many thanks to Andrew Mager at SimpleGeo). In the code itself you will need to apply to SimpeGeo to get both a CONSUMER_KEY and CONSUMER_SECRET. You’ll see the following in the code:
private static const CONSUMER_KEY:String = “GET CONSUMER_KEY”;
private static const CONSUMER_SECRET:String = “GET CONSUMER_SECRET”;
Replace each of these strings with your respective keys.
Lastly, I have started using this code for the AIR app on the BlackBerry PlayBook, I posted a blog entry on the work so far, and included a video of the initial AIR app running on the device, at the following link: