Developing  Android on Ubuntu? here’s how to define your JAVA HOME and PATH:

What you’ll need:

  • Path to your Java installation
  • Path to your Android SDK installation
  • admin password

On windows you’d edit your environment variables, on linux you edit the .bashrc file.

Run this command:
sudo gedit $HOME/.bashrc

prompted for admin password.

Add the following lines to your .bashrc. Please ensure where you installed the Java libraries and your android sdk. The below reflects default installation directories.

export JAVA_HOME=”/usr/lib/jvm/java-6-sun-1.6.0.24;”
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:$HOME”/android-sdk-linux_86/platform-tools”

Save file.

Run this command to reload your .bashrc:
source ~/.bashrc

Test by typing adb version
You should get something like
Android Debug Bridge version 1.0.26

Upodate: this is now fixed in ADT r11. Kudos to ADT team.
After refactoring Activity name from MyContactDetailsPage to ContactDetailsPage I spend a age trying to figure out why I suddenly started getting ActivityNotFoundExceptions.
Manifest before:
<activity android:name=”.contacts.MyContactDetailsPage”
android:label=”@string/app_name”
android:configChanges=”locale” />
Manifest after:
<activity android:name=”contacts.ContactDetailsPage”
android:label=”@string/app_name”
android:configChanges=”locale” />
Looks the same right? or at least the activity name has renamed, yay, but however Eclispe refactor has missed the dot prefix, so Android couldn’t find the activity, hence the exception. This drove me crazy for a good half an hour, I didn’t notice the missing dot. I guess its a good reason to use fully qualified package names when defining activities.+
04-28 11:39:19.623: ERROR/AndroidRuntime(28696): FATAL EXCEPTION: main
04-28 11:39:19.623: ERROR/AndroidRuntime(28696): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.scottyab.android.proj/com.scottyab.android.proj.contacts.ContactDetailsPage}; have you declared this activity in your AndroidManifest.xml?
04-28 11:39:19.623: ERROR/AndroidRuntime(28696):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
04-28 11:39:19.623: ERROR/AndroidRuntime(28696):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
04-28 11:39:19.623: ERROR/AndroidRuntime(28696):     at android.app.Activity.startActivityForResult(Activity.java:2817)

Encase anyone else is also having issues with eclipse or STS crashing or randomly closing on ubuntu? try running the latest official Sun JDK (instead of openJDK) is in Ubuntu 10.10 Maverick Official Partner Repository Thanks to the guys at webup8 for how to enable. There’s also a good stackoverflow question here.

The error i was getting…

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb53d1635, pid=3933, tid=1804258160
#
# JRE version: 6.0_20-b20
# Java VM: OpenJDK Server VM (19.0-b09 mixed mode linux-x86 )
# Derivative: IcedTea6 1.9.7
# Distribution: Ubuntu 10.10, package 6b20-1.9.7-0ubuntu1
# Problematic frame:
# J  com.android.dx.rop.code.Rops.ropFor(ILcom/android/dx/rop/type/TypeBearer;Lcom/android/dx/rop/type/TypeList;Lcom/android/dx/rop/cst/Constant;)Lcom/android/dx/rop/code/Rop;
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
#

## A fatal error has been detected by the Java Runtime Environment:##  SIGSEGV (0xb) at pc=0xb53d1635, pid=3933, tid=1804258160## JRE version: 6.0_20-b20# Java VM: OpenJDK Server VM (19.0-b09 mixed mode linux-x86 )# Derivative: IcedTea6 1.9.7# Distribution: Ubuntu 10.10, package 6b20-1.9.7-0ubuntu1# Problematic frame:# J  com.android.dx.rop.code.Rops.ropFor(ILcom/android/dx/rop/type/TypeBearer;Lcom/android/dx/rop/type/TypeList;Lcom/android/dx/rop/cst/Constant;)Lcom/android/dx/rop/code/Rop;## If you would like to submit a bug report, please include# instructions how to reproduce the bug and visit:#   https://bugs.launchpad.net/ubuntu/+source/openjdk-6/#

Finally got around to creating the additional marketplace images and application signing  to publish my first android app findr.

It’s still a beta so expect a few issues.findr feature graphic mosaic

I’m working on:

  • better storage to cache downloaded data
  • allow saving to SD card
  • better compression when setting as wallpaper
  • Live wallpaper

Why not give this a whirl and resist the 1 star ratings (if you can) and instead post some feedback or feature requests below or tweet me.

Dropbox allows you to sync your files online and across computers. 2GB account is free! http://db.tt/Tk9RpcD (Shameless referral alert)

My first android app is almost ready for the market place, drop me a tweet if you want to test the beta.

Description:

Findr allows the user to search the popular photo sharing website Flickr for images that have been tagged with location data. For example: architecture in New york. The retrieved items are displayed as either a list of thumbnail images or as locations on a google map. Selecting an item allows you to see more details and a long press on an item in the list enables the user to set the image as their device wallpaper.

Technical Notes:

I have used Yahoo Pipes Flickr module for this app as it’s a quick and easy way of the required images with geo data.  I’ll look to use the Flickr API directly for the next version.  I’ve developed Findr for Android version 2.1 allowing it to be compatible with the majority of Android devices.
I have used this opportunity as a chance to experiment with a two 3rd party libraries showing my willingness to build on the efforts of the Android community and satisfy my programming desire to code efficiently:
  1. Spring Android- I’m currently studying towards becoming a SpringSource Certified  Professional and I have discovered a version of their useful RestTemplate for Android I’ve used this to retrieve the RSS feed.
  2. ThumbnailAdapter  by Mark Murphy aka Commons ware – Mark mentioned this at Droidcon 2010. This has been specifically created to download thumbnails in the background without blocking the UI thread. This was ideal for the list items page.
Also based on Google’s UI guidelines I’ve added the Action bar element, using example resources from the Google IO Schedule application.

The idea to teach young people aged 18-26 about application development and generating ideas and solutions focused on improving the community. Couple of guys from the Apps for Good project/course gave a short presentation about Apps for Good and their of the applications. They had a  string focus on paper prototyping and implemented there ideas using Google App inventor.
It sounded a really worth while project so check out their site and interesting Apps: Oyster check, Stop and Search, Student voice

my Hero

my Hero

Just a quickie blog post… my new HTC hero arrived today, yay!

Blown away by how within a few minutes of tapping in my google id I fully sync’d was contacts, calender, and email.

It’s my first touch screen and in portrait mode found the tapping a text message a little awkward. Landscape mode is fine.

Got it from Mobile Phones Direct – who supply the phones unlocked. They do some decent deals on 12m contract + free car kit. Plus in white which isn’t  avail on the network i’m on, Nice!