Archive for the ‘Mobile Development’ Category

Blackberry Playbook App Development

Monday, January 17th, 2011

I spent the bulk of last night and early this morning trying to set up an environment for building an AIR app for the Blackberry Playbook using Flash Builder, the AIR SDK 2.5, the Blackberry Playbook plugin SDK, and the Blackberry Playbook simulator. While the Blackberry website had a lot of excellent documentation concerning setup and getting started, I ran into an error when deploying an application to the simulator. I receive error: ‘Username or password is invalid or not specified or time on the device is out of sync’. Apparently, according to google, I’m not the only one getting this error. It appears that some were able to keep playing with the time until it finally worked, while others gave up and could not find a solution. Each time I installed the simulator it would get my current time, determine that I’m on the East Coast, and then subtract five hours off my time. I’m pretty sure this is the root of the error. I unfortunately, do not know how to resolve it. Setting the time to match my computer’s time does not work. The simulator only gives me five timezones to choose from, and none of which is the appropriate time zone to offset the five hours needed to have the appropriate time.

So I fall into the ‘I give up’ category. After spending a couple hours troubleshooting the issue with zero results to show for it I’m moving on. While the installation of all the necessary components is a little excessive in my opinion (especially compared to setting up for Android app development), the guidelines presented by Blackberry are thorough and well-written. Also note, that running the simulator requires VMWare Fusion if running on a mac. While, I’m not completely sure why this is required, it is a pretty sharp piece of software that I’m glad I was introduced to.

It’s unfortunate that what is most likely a minor bug creates so much havoc, but perhaps I’ll try again in a month or two and hope Blackberry has had a chance to resolve the simulator issue.

Android LinearLayout tag not stacking elements

Thursday, May 6th, 2010

This is really more of a reference for myself than anything else.  Point being I just spent about half an hour trying to figure out why my TextViews were not showing up in my LinearLayout for my Android application.  What I was getting was the top level TextView but none of the others below it.  As I moved them around in their order I realized that they were there, but falling behind the TextView on top.  So, clearly, the issue is that they are layering instead of stacking.

Just to make sure we’re all on the same page in resolving this issue (which is really not an issue at all) we’re working on a layout XML file for an Android application.  So if you’re using the built-in Eclipse Android plugin you will have a main.xml file by default in the res/layout directory.  If you delete the XML from this file and add a new LinearLayout from the layout perspective, and then add some TextViews or whatever, you’ll notice that only the top one shows.

So for example.

Does not work

<LinearLayout 	android:id="@+id/LinearLayout01"
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			xmlns:android="http://schemas.android.com/apk/res/android"
			android:background="@android:color/black">

</LinearLayout>

and…

Does work

<LinearLayout 	android:id="@+id/LinearLayout01"
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			xmlns:android="http://schemas.android.com/apk/res/android"
			android:background="@android:color/black"
			android:orientation="vertical">

</LinearLayout>

For whatever reason, when you add a LinearLayout like this it does not include the ‘android:orientation=”vertical | horizontal”‘ attribute.  Apparently this is a pretty important attribute.  This determines if the assets stack horizontally or vertically.  And if not specified no error is thrown, instead it just seems to layer, or possibly just show the top asset.  Doesn’t really matter as far as I see it.  For those of us who have no idea what we’re doing it should seriously throw an error or something.

Device does not show up in Eclipse ‘Android Device Chooser’

Thursday, May 6th, 2010

This is just a quick note on how to make sure your device shows up in the device listing when debugging an Android app in Eclipse. I spent some time trying to figure this out since I had the plugins all installed and the app ran good in the Emulator, but my device just wouldn’t show up in the device list when choosing to debug manually. I found the solution, of course, in the docs.

So if you’re having this problem you should make sure that your device is set up for debugging. I’m running the Droid Incredible, so you may need to take slightly different steps to accomplish this than what I layout here.

  1. On the home screen of your device choose Menu > Settings > Applications > Development.
  2. Make sure that ‘USB debugging’ is checked. I would also suggest checking the ‘Stay awake’ option as well so you don’t have to keep waking your phone up during debugging.

If the rest of your debug settings are correct your device should show up.  At least for me this was the solution.