Orientation change with MXML

I have been banging my head on the wall trying to figure out how to detect the device orientation on the BlackBerry PlayBook.  I initially tried to use the accelerometer function.  Unfortunately, the listener would continue to activate and determining the exact orientation was a little iffy.  So, a slight move of the device would set off the listener and the redrawing of the screen would keep going until the accelerometer stopped.  This was not a good way to test for orientation, it will be a great way to make a game that required moving the PlayBook around a lot.  After days of searching the internet and the forums I finally stumbled upon the answer.

The way to check the orientation is to determine it through the stage.  However using the Sparks/mxml scripting and not the full as3 coding to make the application, getting to the stage information isn’t very straight forward.  If you trying to add a event listener to the stage as you would in as3, the you get a “null” object error, because the stage hasn’t been instantiated or something.  With the actual solution, you have to go a level above the stage to the systemManager.


systemManager.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, onOrientationChanging );

From there, it is just a matter of determining the correct orientation and then updating the display.


private function onOrientationChanging( event:StageOrientationEvent ):void {
 if(event.afterOrientation == StageOrientation.UPSIDE_DOWN || event.afterOrientation == StageOrientation.DEFAULT ) {
stageSize(false);
 } else {
stageSize(true);
 }
 }

mx and qnx happliy playing together

I’m in the processing of updating the Meetup Search application for the BlackBerry PlayBook.  Last night I was busy trying to rearrange the search form options and realized that the mx:UIComponent was not returning width or height back in order to determine where to place the next component.  The qnx library used for the PlayBook require that an application be either completely in AS3 or use the mx:UIComponent to add the qnx fields; button, textinput, toggle switch, etc…   When developing the Meetup Search, I figured that using the mx tags, it would be easier to control the layout and possibly make it easier to convert the application from a PlayBook application to an Android application.  That doesn’t seem likely now, but I can always use the behind the scenes items to build the application, but the interface will have to be redone for each device.

Anyway, my initial thought was to create a mx:UIComponent for each item I wanted to add to the screen.  Since I wasn’t going to use all qnx components, this seemed logical.  Then last night I decided that I would use all qnx components and add them dynamically in order to change the text, size and position based on portrait or landscape layout.  When I discovered that the mx:UIComponent wasn’t returning height or width, I pondered if I could just use one mx:UIComponent and add all the qnx items to that.  Well, that’s exactly what I can do.   All components are added and can be repositioned and sized with just the one.  Hopefully this will keep down the application size and cause less problems.  Of course, it doesn’t make for a obvious layout design.


// Create Topic Picker
 topicsPicker = new Picker();
 topicsPicker.width = 300;
 topicsPicker.setListWidth(0,300);
 topicsPicker.addEventListener(Event.SELECT, setTopicText);

<s:Group id="optionsGroup">
 <mx:UIComponent id="optionsHolder" styleName="menuAppLabel" />
 </s:Group>

PlayBook and Meetup Search so far

I have 1 review from my Meetup Search application for the PlayBook and it points out that Canadian zip codes don’t work :( , so I need to get the search features updated.  I have made some updates, but haven’t uploaded the changes yet, since I wanted to test the changes directly on the PlayBook, which I received last Thursday.  Hopefully I’ll get the search updates soon and improve my ratings on the App World.

I spent the weekend traveling and the PlayBook came in handy while waiting in airports and flying in the plane.  I was able to connect to wi-fi locations at Raleigh-Durham (RDU) and Atlanta without any issues.  At RDU, I used my AT&T DSL wireless account to connect for free, which was very nice.  Most of the time I had an available power outlet, so I didn’t see how far the battery lasted. I tried BlackBerry Bridge using my sister’s BlackBerry Flip to connect to.  Connection was simple, but due to cell coverage, using the browser was not very good.  I tried using Bridge on my wife’s BlackBerry when I got home and the browsing experience was much better, which leaves me to believe it was the network out in Kansas.  Also, I didn’t realize that Bridge does not connect the internet for the applications ; something that should be done using tethering.  However, according to the article, that might change in the future.

I discovered that GMail voice mail will just download the recording to my music list instead of playing the message from the inbox.  I guess that’s helpful if I wanted to store the message and play it back.

After loading music on the PlayBook, I tried to find radio apps, but didn’t find anything that I wanted to use.  I tried the Slacker Radio application, but apparently there is still something wrong with the app or my setup ( cause it costs $3/month ).  I found a couple of streaming servers that I might try to create a PlayBook app for, they are Audio Galaxy and Subsonic. Both take your music files and stream them on the internet, but one does it via a system service and the other as an application.  The APIs for both look fairly straight forward, so if I come up with a good interface, then it might be possible to use it for both options.  So many ideas, so little time to do stuff.

I tried some podcast downloads on the PlayBook to see what that is all about.  I guess it would be good if you don’t have wi-fi and wanted to listen to something besides the music playlist.   I added BlackBerry Today and downloaded their latest episode.  Heard on BlackBerry Today podcast :   There were 3,000 PlayBooks applications available and 40 – 50,000 PlayBooks (corrected on 5/18 podcast) sold on launch day, which was the most for any tablet launch.   The 6,000 participants at BlackBerry World conference all got a free PlayBook.

Here is the download chart for the month of April for Meetup Search.   Not tremendous, but not too bad.  I think improving the UI and adding search options will help with the downloads.  Also, I need to make the description a little prettier.  I think the form allows for HTML, since I’ve seen others use bullet lists.

A message from PlayBook

Last night I received my free BlackBerry PlayBook.  I immediately downloaded the updates and began to familiarize myself with it.  The first thing I need to get used to is using my finger pad instead of my nails. Touch response is different than with my phone.  But, I am getting used to it.  After a little trail and error, I have figured out how to load music, photos and files from my desktop.  I have loaded a few free apps to help with the flight layovers I’ll have this weekend.  Later, I think I will give more of a review.

I can successfully report that Gigya sign in with WordPress works on the PlayBook browser. I typed this post using my PlayBook.

Download graphing

The BlackBerry PlayBook was officially launched on April 19th.  I wasn’t expecting too much from my little Meetup Search application, because I don’t consider it done.  The API wasn’t a full release yet and I sort of rushed to finish it in time for the free PlayBook giveaway.  Now that the API 1.0.1 version has been released, I will go back and clean up my application.  I am still waiting for my free PlayBook, which was supposed to arrive to developers “around the time the device is available in the area”, which was on the 19th.  Rumor has it, we’ll all get them today on the 22nd.

Like I said, I didn’t expect a ton of downloads on the first day, of course analysts didn’t expect 50,000 in sales and pre-orders either.  So, I am glad to see that some people downloaded my free application.  Currently there isn’t a way to get a feed from the download page, so I guess I’ll have to export the graph on a regular basis.

Welcome to the App World

Today I made my Meetup Search available on the BlackBerry App World.  It is really rough right now and I am very eager to try it out on the BlackBerry PlayBook.  And why do I say I am “eager”, well it is because I will be getting a free PlayBook!  After going through the struggles of trying to create an application and getting the software, I got my app in before the deadline and now it is signed and ready for download.  And because it was in before the deadline and accepted, I qualified for the free PlayBook offer.  Rumors has it, that they will be shipping tomorrow, which would be awesome!

Where do I go from here?  Well, I would like to clean up the Meetup Search:

  • Adjust item layouts and fonts to make sure they work well on the device
  • Add GPS location search option : get the GPS latitude and longitude location and use that instead of zip.  “Meetups near me”
  • Add City Upcoming Events : The City Meetup pages is a nice feature that shows upcoming events, this might be useful
  • Add Map of Meetups search option :  show a map and have Meetups pop up on the map based on search options

I will probably try to add as many search possibilities as possible from the Meetup API and try to keep it up to date.  After that, I need to get OAuth working and start developing the Meetup user and Organizer applications.  In the mean time, I still have a movie to finish editing.

Today is the day!

Well, today is the deadline for the Free BlackBerry Playbook offer.  This is the third and final deadline for getting applications submitted, and I hope that I can get mine in.  I’ve registered and sent identification information, so now I am waiting for a response back in order to actually upload my application to the App World. I have until midnight, so hopefully they’ll get the reply back to me and things will get done.

I have been trying to create an application since around Christmas.  I’ve had a few setbacks.  For one, I didn’t have a paid version of the development tool (Adobe Flex Builder), so I tried to make an application using he evaluation version.  Then BlackBerry updated their IDE for the PlayBook and things just crashed after that.  When the first deadline started approaching, I gave up trying to make a simple timer application and started working on a Meetup application to replace my initial Meetup Organizer Tool.   But, when I couldn’t get the OAuth to work with the PlayBook simulator, among other things, I decided to make a simpler search tool.  But, before I could finish working on that, my trial offer expired.  Luckily, my lovely wife took a course at Wake Technical College and we bought some Adobe software for the student price.  However, that still took some time to get and reload everything.

Finally, I have everything working and the deadline is close, so I finished up what I had and began the submission process.  Part of the submission process requires registration as a vendor.  Apparently this is something that should have been done much earlier, because it doesn’ t require an immediate upload, but it does require validation that you are a business or a real person.  So, last night I did the registration step 1 and today I got the first reply back asking for the verification, which I replied with immediately.   Now, I am waiting for the confirmation that I am now registered so I can upload the application.

To be honest, my search application is extremely basic, but I plan on updating it once I get the initial one uploaded to the App World.  I will also create a page for the application for the DeanLogic site as well.  After I get the Search Meetup application finished, then I’ll start working on the Organizer and Member Tools.  The good news is, Meetup is continually updating the API and adding new features, some of which are not available through the Meetup site.

Of course, work on these applications have to happen between married life and the movie making hobby.