Archive for the ‘Android’ Category

YegDataListNot that long ago, the City of Edmonton announced it’s Open Data Catalogue.  I noticed that one of the data catalogues was a list of historical buildings in the city.  Yeah, I know that some people in other cities might consider this a pretty weak list.  I mean, the oldest building in Edmonton isn’t even 150 years old.  I’d wager that some parts of the world consider 150 year old buildings to be “new construction”.  Anyway, as I’ve been dabbling with Android now for about the past year, I thought a handy little project to try out would be to write an app for Android that would show me where the historical buildings are in the city.

I’ve got the foundation of a simple application started over a GitHub called, not surprisingly, Historical Buildings (if you pull the source code, then just a heads up that I use IntelliJ for my Android development).  This application currently works in the emulator, my next step is to installing it on my phone and trying it out for real.  Right now all the application does is present you with a list of buildings.  You click on one, and you’ll see on Google Maps where the building.

Some other ideas for features that may or may not happen:

  • Figure out the whole unit testing story in Android.  Then setup a build script.  Then a build server.  CI rocks, but as I’m trying to learn the Android framework and figure out what all the parts are, I’m not to focused on that at the moment.
  • Don’t always fetch the data – store it locally
    • I don’t think the way I’m parsing the JSON result is very efficient or “proper”, but it does get the job done.
  • Notify the user when they are within a certain distance of a historical building.
  • Currently YEG has a PDF explaining the significance of the building.  Not very friendly/convenient for mobile devices.  Need something better.
    • One thought would be to create Wikipedia entries and link to that.
    • Another thought is to petition the City of Edmonton to convert their PDF’s to a more neutral format (HTML anyone)?
    • The Edmonton Public Library has some information about the “Lost Building of Edmonton”.  Maybe incorporate that somehow – perhaps showing what buildings used to exist at a given address?
  • Perhaps allow the user to update their coordinates for YEG’s historical buildings.  I’ve notice (on the emulator) that sometimes the lat/long isn’t exactly accurate.  If you look at the image below for the old Arlington Apartments, you notice that the marker should be over the pile of rubble slightly to the left of where it currently is.
  • Maybe include buildings that aren’t necessarily designated as historical, but are interesting architecturally or otherwise.
  • Instead of using YEG OpenData, perhaps an independent cloud based data store (Azure maybe?)

If you’ve got any other suggestions, I’m happy to hear them.

MapList

After a bit of tinkering, I managed to provision my ADP1 setup without a SIM card.  A bit of google, and here is what I did

  1. Download the Android SDK.  In my case, I unzipped it to C:\android-sdk-windows-1.1_r1.
  2. Connection the phone via the USB cable to my computer.  When the phone asks for a device.
  3. You’ll get the new hardware dialog, when prompted for the drivers, you’ll need to specify the location.  The Android SDK has the drivers, in my case they were at C:\android-sdk-windows-1.1_r1\usb_driver\x86.
  4. Once you have the drivers installed cd to c:\android-sdk-windows-1.1_r1\tools.
  5. Type adb devices.  This should list all the Android devices that you have connected.  If you don’t see any devices listed, then you have a problem.
  6. Type adb shell.  This will direct your commands to your ADP1
  7. Now while at the adb shell, su to root, then : 
  8. cd /data/data/com.android/providers.settings/databases/
  9. sqlite3 settings.db
  10. INSERT INTO system (name, value) VALUES (‘device_provisioned’, 1);
  11. .quit
  12. Reboot the phone
  13. adb shell
  14. am start –a android.intent.action.MAIN –n com.android.settings/.Settings

Once all that is done, you should be enable to use your ADP1 as if you had a SIM card in it (we’ll except for the phoning part).

Useful link:  FAQ: Unlocking/Activating a G1 or ADP1 Without A Sim Card.

(Note:  this article is pretty dated, and used IntelliJ 8.  I plan a follow-up covering IntelliJ 9)

So I have this semi-fancy Google Android Dev Phone 1.  Lately I’ve been devoting part of my spare time to learning about programming for Android (the OS of the phone).  Google (probably because they didn’t ask for my opinion and/or input) decided to use Java as the lingua franca for Android programming.  If you ask me – and I know you will – they should have used C# and Mono (I might be a bit biased here).  Luckily, years ago I had done Java programming, so I wasn’t that intimidated by the use of Java on Android.

The first big question that every developer faces is which IDE?  There are a few Java IDE’s out there, but if you ask me the only ones worth considering are Eclipse and IntelliJ.  The documentation for Android points you to using Eclipse.  Eclipse is a good IDE.  However, back in the day when I was getting paid for Java development, my employer got us all copies of IntelliJ, from JetBrains.  I liked it.  I like it enough that if I landed a contract tomorrow that involved Java, I’d buy me a copy of IntelliJ.

So, all that being said, I figured I’d give IntelliJ a spin as I travelled down the stack-trace of Android programming.  Here are my observations, in general:

  1. There is an Android plug-in for IntelliJ.  Now, you might believe that development on the Android plug is dead.  Not true.  The plug-in is undergoing active development – it just seems to be kind of slow
  2. I found the installation of the Android plug-in for IntelliJ far easier than for Eclipse.  Just download the most current release, and then unzip to your plugins folder in your IntelliJ installation.  With Eclipse, it is simple, but not when the documentation is wrong.
  3. The IntelliJ plug-in is simple, and seems to get the job done.  It’s a bit to simple at this time, if you ask me.  The ADT for Eclipse provides a far richer dev-centric experience for Android coding.  For example there are designers to help you with laying out your form, a lot more control over starting up the Android emulator, and better tooling for hooking up the debugger to either the emulator or an app running on the physical phone.
  4. Being a Resharper junkie, I found that IntelliJ was more natural for me to use.
  5. I didn’t run into to many problems when I was trying to use/convert Eclipse project with IntelliJ. This is good, because the vast majority (all?) projects I’ve seen are all Eclipse based.

So, my conclusion at the end of the day, is that I’m going to stick with Eclipse for my Android development.  There just seems to be less friction at the moment if you’re using Eclipse.  In a couple of months maybe I revisit IntelliJ and see what’s new with it and Android development.  However, at this time, I’d like to really concentrate on learning the Android SDK, and it seems simplest to me right now with Eclipse.

After a bit of tinkering, I managed to provision my ADP1 setup without a SIM card.  A bit of google, and here is what I did:

  1. Download the Android SDK.  In my case, I unzipped it to C:\android-sdk-windows-1.1_r1.
  2. Connection the phone via the USB cable to my computer.  When the phone asks for a device.
  3. You’ll get the new hardware dialog, when prompted for the drivers, you’ll need to specify the location.  The Android SDK has the drivers, in my case they were at C:\android-sdk-windows-1.1_r1\usb_driver\x86.
  4. Once you have the drivers installed cd to c:\android-sdk-windows-1.1_r1\tools.
  5. Type adb devices.  This should list all the Android devices that you have connected.  If you don’t see any devices listed, then you have a problem.
  6. Type adb shell.  This will direct your commands to your ADP1
  7. Now while at the adb shell, su to root, then : 
  8. cd /data/data/com.android/providers.settings/databases/
  9. sqlite3 settings.db
  10. INSERT INTO system (name, value) VALUES (‘device_provisioned’, 1);
  11. .quit
  12. Reboot the phone
  13. adb shell
  14. am start -a android.intent.action.MAIN -n com.android.settings/.Settings

Once all that is done, you should be enable to use your ADP1 as if you had a SIM card in it (we’ll except for the phoning part).

Useful link:  FAQ: Unlocking/Activating a G1 or ADP1 Without A Sim Card.

After an uneventful flight from YEG to PSP, I’m settled in with my family.  After spending some time with beer at the pool, I’m sitting down with my Android Dev Phone 1 that I ordered last week (ship to PSP).

First impressions:  it seems like a nice phone, and I like the fact it has a keyboard.  I don’t have a SIM card to help with provisioning the phone, so all I get is this message saying "No SIM in phone" and "Emergency call".A quick search on Google tells me that how to get around this and use WiFi.  So, that’s my task for tonight.

Tomorrow we’re heading to the farmer’s market at the College of the Desert where I hope to refresh my collection of quality shirts.