Sunday, November 7, 2010

Endomondo Android Application

In previous posts here and here I documented how I use GPS enabled mobile phones to record my mountain bike rides. I have recently been evaluating Endomondo. Endomondo is an Android application which records your rides, runs, swims, and any other exercise.

The Endomondo service consists of a mobile application (Android, iPhone, Blackberry and Symbion) that makes use of the GPS functionality of the phone to track your workouts. This is paired with a web-based service that will store a history of your workouts along with allowing you to see your workouts overlayed on a Google Map.

Some of the key features of the Endomondo service which make it interesting to use are:

  1. Audio Coach: the Audio Coach uses the text to speech functionality on your Android phone to announce your current progress at each kilometer. It means you do not need to constantly check your progress on your phone.
  2. Live Tracking: if you have a mobile connection active on your phone, the application will constantly update the web service with your progress. This will allow interested people to follow your progress via your profile page. An interesting addition to this is the ability for someone to send a message to your device which will then be read out by your device.
  3. Routes: if you have a favourite ride/run this can be published as a route on the web service which means that anybody can ride/run this course and compare their times to yours. 

Overall, the application and web service work together very well. The workout history is reasonably comprehensive and the statistics collected can be used to see how many kilometers are ridden in a year.

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.

Tuesday, June 15, 2010

Google I/O 2010 - Session Videos

If you didn't get to go to Google I/O this year the next best thing is to watch the videos. Most come with a PDF of the slide pack to follow along.

Google I/O 2010 Session Videos

A large variety of different talks covering most of the major Google products. Something for everyone.

Enjoy.

Thursday, June 3, 2010

First Look at the Arduino Duemilanove

Received my Arduino Duemilanove from Toysdownunder today. It was ordered yesterday morning and shipped late yesterday afternoon. I got it just after lunch today.I am very impressed by Toysdownunder and their fast turnaround time.

I purchased the Arduino Inventors Kit due to the larger number of sensors and other pieces like servos and motors that are included. The other notable inclusion is a booklet of simple projects showing how to use the various sensors included in the kit.

After I got  home tonight I installed the Arduino IDE and connected the Arduino to the USB port. After installing the USB Serial Port drivers the Arduino was immediately recognised by the PC.

Once the Arduino was connected to the PC I started the IDE and loaded the 'Blink' sketch. After compiling and loading it to the Arduino using the IDE. Almost immediately the small yellow led on the board starts flashing.

Over the next couple of days I will run through the various circuits in the booklet. As I have not had any experience with electronics previously it should be an interesting couple of weeks.

Thursday, May 27, 2010

Sunday, May 23, 2010

Google I/O 2010 - Keynotes

Google I/O 2010 finished two days ago. Lots of interesting news for HTML5 and Android. Here are the two Keynotes from Day 1 and Day 2.



Tuesday, May 18, 2010

Arduino Microcontroller Kits

Are you interested in embedded programming or microcontrollers? I have recently been looking into purchasing an Arduino Duemilanove to experiment with some physical computing. The Arduino is:
an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.
 Using one of these kits from Little Bird Electronics or Toysdownunder it is possible to easily build systems that interact with their environment.

Little Bird Electronics
Arduino Inventors Kit
Arduino Starter Kit

Toysdownunder
Arduino Inventors Kit
Arduino Starter Kit
These kits include everything you need to start building with Arduino. They include the microcontroller board, sensors and wiring to connect it all together. The Inventors Kit also includes a printed book describing simple designs and the code to get you started.

My plan is to purchase one of these kits and do some building. Ultimately, I have some ideas for a large project that will use the Arduino along with some of the other sensors available.

Thursday, May 13, 2010

Using DJ NativeSwing in Netbeans

In my previous post I linked to a library that allows the use of native components within Java applications as easily as using Swing components. At the time of this post I had managed to get the Web Browser sample to compile and run in Netbeans 6.8 but was having troubles getting the HTML Editor to compile in Netbeans.

Over the last couple of days I have managed to get the HTML Editor compiled and running in Netbeans 6.8.

This post will demonstrate how to configure Netbeans to use the DJ NativeSwing library to embed a HTML Editor into a Java Swing Application.

The first step is to download a copy of the libraries required for DJ NativeSwing to function.

DJ NativeSwing
SWT - requires the M6 development build to function correctly.
FCKEditor- requires FCKEditor not the CKEditor Download
FCKEditor Java Plugin

Once you have downloaded all the class libraries unzip them to a handy directory. I use c:\java_util\ and create a separate directory for each class library.

The FCKEditor ZIP does not require unzipping. The FCKEditor java plugin takes care of this.

Open Netbeans and create a new Java Application and add the downloaded libraries to the project. Once completed the libraries tab should look like the image below.


Now that the project has been created you need to create the two class files the project requires. Rather than have masses of code in the post, I have included these class files for you to download.

HTMLEditor.java- this is the class that includes the main class. Refer to image below for this class. This was copied directly from the sample HTMLEditor code in the JavaWebstart sample on the DJ NativeSwing site.


SimpleHTMLEditorExample.java- this is the HTMLEditor class that extends JPanel and builds the HTML Editor control.

This class was slightly changed as it returned a compiler error in the state it was in on the DJ NativeSwing site.

In the screenshot below you can see where the call to create the new JHTMLEditor is returning an error. To make this code work correctly requires a change to specify what HTMLEditor implementation is to be used.

JHTMLEditor htmlEditor = new JHTMLEditor(JHTMLEditor.HTMLEditorImplementation.FCKEditor);


Once these minor changes have been completed, it should be possible to compile and run the project and get a HTML Editor with WYSIWYG editing.

I have included a zipped file of the Netbeans Project for people to try out.

Enjoy.

Tuesday, May 11, 2010

DJ NativeSwing Class Library

Would you like to include an embedded browser, media player, flash player or html editor in your application. Then the DJ NativeSwing class libraries may be what you are looking for. This is a JAVA library built on SWT to allow the use of native components in Java applications as easily as using the Swing component library.

I have been experimenting with this library and have managed to get the Web Browser and HTML Editor samples to compile and run in Netbeans 6.8.

Over the next couple of weeks I will be preparing some posts about how to configure the projects to be able to work in Netbeans.

Thursday, April 8, 2010

Latitude/Longitude Converter Class Library

A few weeks ago I found an old photograph taken while we were doing a 4wd tour on the Mid North Coast of NSW. I wanted to scan and post this photo to the blog along with a Google Maps location.

The issue with this was I only had a rough idea where the photo was taken. During this 4wd tour we followed the directions in a printed book. This was 10 years ago and we did not have the use of a GPS to record our track. All I had to go on was the directions in the book. These directions made little sense trying to follow them on Google Maps as in many cases the tracks we followed are not named or marked in Google Maps.

However, the book did give GPS co-ordinates for key points on the tracks (major intersections or landmarks). I decided these could be used to provide a rough path followed and allow me to get my bearings while trying to follow the directions on Google Maps.

Once I tried to plot each of these points in Google Earth I realised it would be a slow process to import each of these points. An easier way would be to create a KML file of the points and load that into Google Earth. I had already written some code to produce a KML file of points from a CSV file so it was just a matter of loading the GPS co-ordinates into the CSV file and running the program.Unfortunately, KML files need GPS co-ordinates in Decimal Degrees and all my co-ordinates were in Degrees, Minutes and Seconds.

At this point I could have used any number of web based conversion pages to convert each co-ordinate manually. Instead, I decided to write a JAVA class library to convert co-ordinates between Degrees, Minutes and Seconds and Decimal Degrees.

The code was reasonably simple but as I had not been able to find an equivalent class on the net I decided that I would try to make it as versatile as possible with the aim to releasing it onto the web for anybody to use. It would also be a good learning exercise for me as I have created a Java class library previously.

After a weeks worth of coding I have now got the library to the point that I feel comfortable releasing a alpha version of the library to the net. There is a simple tutorial available and I am currently developing the Javadocs to go with the library.

Eventually, I will also post the source under an open source license to allow others to build or improve the library.

Monday, March 29, 2010

Crossing the Causeway

This photo was taken around 10 years ago during a four wheel drive trip. It is the view from a causeway on Tiri Road, Knorrit Flat NSW.

Sunday, March 7, 2010

Programming or Configuration?

A recent post over at the Reinvigorated Programmer highlighted an interesting point about the nature of the programming that many modern coders do. The post discusses the difference between creating an application from scratch and coding much of the functionality yourself or using frameworks and libraries to create much of the code.

As a VB5/6 programmer who has recently started coding in JAVA I have found that the choice of libraries available both in the standard class libraries and in third party libraries was very large and it is sometimes difficult to know if you are creating something from scratch that may already be available in the standard libraries. Every day I find myself searching the libraries to ensure I am not re-writing the wheel.


Another point the blog post touched on is the widespread use of frameworks in modern coding. These ready built code bases are used to simplify the coding of applications by hiding the underlying code and allowing the user to configure the system with very little actual programming.

Overall, the use of these frameworks is a good thing as they do minimize the production of a lot of code that is common from one application to the next. My biggest gripe with frameworks is that there are so many of them and more are being created every day. Especially in the Java world it is difficult to determine what is the best choice amongst the hundreds of frameworks. However, once selected it can be difficult to change frameworks without considerable work.

From a learning perspective the large number of libraries and frameworks can be daunting and given the communities willingness to create new libraries and frameworks on a rapid basis I guess I will be learning a new library or framework most of the time. 

Thursday, March 4, 2010

JAVA - Writing a StringBuffer to a File

During some recent development work I was using a StringBuffer to hold a large string (>400K characters). This string was built using a variety of methods based upon data being read in from a CSV file.

Once the StringBuffer had been created I was going to write the StringBuffer out to a file. This is where I had an issue. For some reason I thought that stringBuffer included a method to write the information to a file. It doesn't.

I then went looking for an easy way to write the contents of the StringBuffer to a text file. After looking at a few forum posts I managed to determine the simplest way to write the StringBuffer to the file.

StringBuffer output = new StringBuffer();
// Get the correct Line Separator for the OS (CRLF or LF)
String nl = System.getProperty("line.separator");
String filename = "output.txt";
output.append("Write First Line to StringBuffer");
output.append(nl);
output.append("Write Second Line to StringBuffer");

try {
  BufferedWriter out = new BufferedWriter(
                       new FileWriter(filename));
  String outText = output.toString();
  out.write(outText);
  out.close();
    }
catch (IOException e)
    {
    e.printStackTrace();
    }

The interesting parts of this code is the use of System.getProperties to get the correct line separator for the OS the code is running on and the use of the BufferedWriter in conjunction with a FileWriter to write the StringBuffer to the file.

Thursday, February 11, 2010

Google Buzz - Facebook Threat?

Earlier this week, Google started rolling out Google Buzz to all Gmail users. Google Buzz is an attempt by Google to provide a social networking facility within Gmail.

After enabling Google Buzz on my Gmail account I was presented with a new menu item in the left hand menu and a prompt to connect some of my other Google presences to my Google Buzz feed. These included Picasa Public albums, my two blogs and Google Reader. These links are used to automatically populate my Buzz stream (buzz) with items as they are published.

With these items now automatically populating my 'buzz' all I need now is for someone to read them. Unfortunately, my Gmail account is not my primary email account and is only really used for administering my Google presence. Further experimentation will have to wait until I find some friends who are using Google Buzz.

Google already has a number of social networking tools (Orkut, Google Wave). Where Google Buzz fits in with these other products is unknown. However, from my limited time using the product it is most like Facebook. You can post status updates, photos, videos and subscribe to friends posts. The difference is that it is also linked to your other Google products such as Blogger, Picasa and Reader and these products will automatically update your buzz when you post updates.

Interestingly, a group of former Google employees created something similar in 2007 called FriendFeed. FriendFeed is a social networking aggregator that was recently sold to Facebook. It has a advantage over Google Buzz in that it includes the ability to aggregate content from more than 50 services including Facebook and Twitter.

As you can see there is quite a lot of competition in the social networking world and from what I can see Google Buzz does not really offer any large advantage over the other sites such as Facebook, FriendFeed and Orkut. To really make a dent in any of these services they will need to expand the aggregation service and convince their Gmail subscribers that this is an alternative to Facebook.

Sunday, January 31, 2010

iPad - Who will buy this device?

For over a year, pundits on the internet have speculated that Apple was developing a touch screen tablet.

On Thursday, Steve Jobs confirmed these rumours when he announced the Apple iPad. The Apple iPad is a 9.7" touch screen tablet which runs an upgraded version of the iPhone software. 

My initial reaction when I saw the Apple  iPad was confusion. What functionality does this device offer over and above the Apple iPhone? And what market is Apple aiming this device at?

The issues I see with the device are:
  • It is too large to be a truly portable device. You cannot carry this in your pocket as you would an iPhone or other mobile device, however it has limited functionality compared to a netbook which is much the same size when closed.
  • It is not aimed at replacing the iPhone as it does not make calls. The 3G cellular connection is purely for data purposes. 
  • It is only possible to load Apple App Store applications onto the device. 
I wont be buying an iPad. I think that the size and limitations make it less capable than the iPhone. 

I wont be the only one not buying, many technology writers have expressed similar dissatisfaction with the iPad. It seems to be a product without a distinct market.

For further information:

CNET - Apple iPad: What you need to know.
SMH - iPad Review
SMH - 12 Features Apple iPad Lacks
SMH - Jury Out as iPad touches down