Sunday, October 17, 2010

Android App Inventor - Location

I recently got a new HTC Desire phone. One of the main reasons for purchasing an Android phone was the ability to write and deploy my own applications to it. Just prior to getting the phone I had seen a post from Google regarding the new App Inventor for Android tool. The tool is in beta at this time so I signed up hoping that I would get an invite and I would be try out this new tool. Last week I got the invite and started playing with App Inventor.

As I am interested in GPS and location aware applications I decided to develop a small application that would show the current location, current address and the option to launch the Google Maps application on the phone.

 The Android App Inventor is a web application that has a visual GUI builder to create the GUI and uses 'blocks' in place of code to provide the logic in the application.

The screenshot below shows the GUI builder with the 4 controls used to display the current latitude and longitude and the street address if known from the Google geocoding service. It also has a button to initiate the display of a Google map centered on the current co-ordinates.

To obtain the GPS co-ordinates you will need to add a LocationSensor to the non-visible components. This sensor allows you to access the built-in GPS on Android devices. It includes methods to enable/disable the internal location sensor, read the sensors and get the current address.

The next screenshot shows the logic required to display the latitude, longitude and address on the screen whenever the phone is moved.

It also shows the logic for the ActivityStarter to create and display a Google Map. Information on how to setup the properties for the Google Maps ActivityStarter is in the MapTour tutorial.



Once the properties are configured you will need to generate the URI to pass to the Map Activity. I have shown this above as it took a couple of attempts to get this right. As it is not currently possible to simulate the location sensor in App Inventor the app will need to be compiled and deployed to either the Android SDK emulator or a real phone.I did this a number of times prior to getting it to work.

I hope this information helps if you are trying to use LocationSensor and Google Maps activities on App Inventor.

I have added a link to the source code here.

My other App Inventor tutorials are here:
App Inventor - Lists
App Inventor - SMS Services

Thursday, September 16, 2010

My Tracks for Android

In the past I have done some mapping of the various mountain bike tracks around the Central Coast. In a previous blog post I documented how I used my Nokia phone and a bluetooth GPS dongle to do mapping.

Now I have a HTC Desire this process has now become much easier to do and I only have to carry one device while I ride.

The key to using the HTC Desire for mapping is the My Tracks for Android application. This application was built by some Google engineers in their 20% time and the results have been open-sourced for the community to benefit.

The My Tracks application uses the GPS in your Android device to record your location as you walk, run or ride. The resulting information can then be exported to either Google Documents to record the details or Google Maps to visualise the route.

Here is an example of a map produced by the My Tracks application.


View 2GO Track in a larger map

An example of the data collected and archived in Google Docs is here
.
My experience so far with Google My Tracks has been very positive and I will continue to use it for both my riding and running.

Sunday, September 12, 2010

HTC Desire - Android Phone

Two weeks ago I got myself a HTC Desire. For the last couple of months I have been watching the release of various Android phones to decide which one I should get once my contract was up on my old Nokia. The winner was the HTC Desire. It was universally billed as one of the best Android phones available today.

I had decided to get an Android phone because as a developer I would like to be able to create applications for my phone. The other reason to get an Android rather than a iPhone (iOS) was that all the tools required to develop applications are freely available and run on Windows or Linux.

Over the coming months I will try to document my attempts at building some simple applications for the HTC Desire.

Tuesday, August 24, 2010

Don Norman - Business of Software Conference Talk

In my first year of university, one of the first subjects used a book called 'The Design of Everyday Things' by Don Norman. It was an interesting look at the design of normal objects and some of the mistakes made by designers when it comes to interface design.

Last year Don Norman was a speaker at the Business of Software Conference. This post from the Business of Software blog includes his presentation from the conference. Well worth watching for anybody in the software development field.

Monday, August 16, 2010

Gigapixel Photos

Gigapixel images are large images made using special panoramic camera rigs.  Images are created from 100's and 1000's of individual images taken using a digital cameraand stitched together using panorama software.

The Gigapan website includes a large number of images and the tools required to build your own gigapixel images.

 This is a really interesting technology and could have uses other than just for landscape photographs. Imagine a photo of an item that you could zoom into to see detail. For example a circuit board would be visible at both the high level as well as at a very macro level to show traces and connects.

Thursday, August 5, 2010

Google Wave is being discontinued.

According to the Official Google Blog, Google Wave will no longer be developed as a standalone product. Although the product was reasonably well received internally and by Google fans it never managed to be embraced by the general public.

The underlying technology will continue to be developed as part of other products and the site will be maintained till at least the end of the year.

For more information refer to the Official Google Blog post.

Wednesday, July 14, 2010

The Joys of Engineering Leadership - Google I/O 2010 TechTalk

An interesting talk was given by Brian W. Fitzpatrick and Ben Collins-Sussman at Google I/O 2010. For anybody who leads a team of software engineers this has some great pointers on how to be a successful leader.

Watch the video here. A PDF containing the slides from the presentation is available from this page.

Enjoy.