2Lines Software
31Jan/094

Getting Android SDK to work with Fedora 10

Just thought I pass this little bit of information on. Fedora 10 (and Ubuntu also) is a little screwy when it comes to connecting the ADP1 device to Eclipse for testing.

Any USB device automatically gets connected as read-only which means the adb server and Eclipse won´t see the device when you plug it in.

This post gives a little information on how to fix it.

The idea is to create a rules file that listens for the Android device and sets the permissions differently. The rules are all located under /etc/udev/rules.d. So in detail,

Create a new rule for Android devices

vi /etc/udev/rules.d/99-android.rules

Add the following code

SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666"

And run

udevcontrol reload_rules

Plug it in and it should work.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Tagged as: , 4 Comments
21Jan/090

WikiWhere the Video

Here is the fully functioning WikiWhere Application.


Feel free to add / remove / update or delete the app as you see fit!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
21Jan/0912

Programming with Android Part 4 – Finishing WikiWhere

Continuing from Part 3 we are going to spend the 30 minutes or so to finish the WikiWhere application. So far we have a mapping and location application on the device. The final step is integrating the Wiki sites and displaying them on the map.

1:45 Foosball, Reddit, Digg and Google Reader Break

1:55  Getting the XML feed for the Wiki sites

Now that you've had a long break we can get to the more complicated sections of the code. The Wiki information is collected and provided as a web service by Geonames.org. We will be using the wikipediaBoundingBox XML API to get the information from the service. By making a call to http://ws.geonames.org/wikipediaBoundingBox?north=51.1&south=50.1&east=-113&west=-115 you can get the XML feed of the Wiki Entries in the bounding box in the following format:

  1. <geonames>
  2.   <entry>
  3.   <lang>en</lang>
  4.   <title>Max Bell Centre</title>
  5.   <summary>The Max Bell Centre (often referred to as the Max Bell
  6.   Arena) is an ice hockey arena in Calgary, Alberta, Canada in the
  7.   community of Radisson Heights. It seats 2,121 for hockey with a
  8.   standing room capacity of over 3,000. It is named after George
  9.   Maxwell Bell, a philanthropist who helped fund the arena's
  10.   construction (...)</summary>
  11.   <feature>landmark</feature>
  12.   <countrycode>CA</countrycode>
  13.   <population>0</population>
  14.   <elevation>0</elevation>
  15.   <lat>51.0422</lat>
  16.   <lng>-114.0036</lng>
  17.   <wikipediaurl>http://en.wikipedia.org/wiki/Max_Bell_Centre
  18.   </wikipediaurl>
  19.   <thumbnailimg />
  20.  </entry>
  21. ...
  22. </geonames>

So to get our wiki items displayed on the map we need to:

1. Call the Geonames XML API

2. Parse the XML

3. Display the icons on a MapOverlay

4. Implement the "Search For Wiki Entries" Button

20Jan/0915

Programming with Android Part 3 – Building WikiWhere

We will continue from where we left off in the last instalment and extend our basic application into a more useful application. If you are keeping track, we're an hour and fifteen minutes into our development and we have our application environment setup and ready to program in Android.

Over the next hour we will create an application that will show the wiki entries near our location, display that information on a map and embed the wiki page into the application. This application highlights three key features of the Android platform;

  1. Focus on LBS that makes locative media easier to produce.
  2. Deep web integration from consuming web services to embedding web page.
  3.  Simple map integration via Google Maps.

What is WikiWhere

WikiWhere is a buzzword-compliant mobile application that gives you access to local wiki knowledge where ever you are. Using your Android phone, WikiWhere searches wiki for entries near your location and passes that information to you. Discover your neighbourhood or visit others. 

1:20 Back from Break. You aren't paid to sit there you know.

We are now going to get started with the WikiWhere application. Let's go through the first step and create an application shell using the Eclipse project builder. Just as in the previous part, select File >> New Project >> Android Project to launch a new project. Add the details for WikiWhere. I've attached a screenshot of the details below.

WikiWhere Project Dialog

Step 1. Create the MapView

The main user interface will be a MapView so we want to change the interface of our WikiWhere class from Activity to MapActivity and implement the onRouteDisplayed method.

  1. package demo.WikiWhere;
  2.  
  3. import com.google.android.maps.MapActivity;
  4. import android.app.Activity;
  5. import android.os.Bundle;
  6.  
  7. public class WikiWhere extends MapActivity {
  8.     public void onCreate(Bundle savedInstanceState) {
  9.  
  10.         super.onCreate(savedInstanceState);
  11.         setContentView(R.layout.main);
  12.  
  13.     }  
  14.    
  15.      protected boolean isRouteDisplayed() {
  16.          return false;
  17.      }
  18. }

Next we have to implement the map in the view. Android separates the device layout / views from the source code to simplify development. A graphic designer can modify the XML layout without impacting the underlying source code. I'm a strong believer in letting programmers do the programming and not the UI or graphic design. Windows 3.1 was designed by programmers. Case closed.