23 February 2010

Developing Android apps -> the android.jar source #2

edit: this method is outdated. This one works now (16 April 2011).


For some reason, I've had a fight or two with eclipse on getting these sources right. Even after completing the steps I've mentioned in the other blog post.

The steps I'll describe now makes a fake android-src.jar, and fixed it for me tonight. *puh*

(requires you've done everything else I've mentioned)
#cd/opt/android-sdk-linux_86/platforms/
#ln -s ~/src/android-sources android-src.jar
In eclipse
  • Select your project on the right menu of eclipse
  • Choose Properties
  • Select Android on the left hand list.
  • Choose a different SDK version, 1.6 for example.
  • Click Apply.
  • Wait for building workspace (on the bottom right side of the eclipse window).
  • Choose your correct SDK version again. 1.5 in my example.
  • Click Apply.
Note that the dummy android-src-jar we've made by sym-link needs to be replaced if you're swapping SDK versions.

This is a bit fuzzy and I'm not sure why these sources are causing such grief. There may be better ways of doing this, please tell me if you come across one.

/Finn

3 comments:

  1. Hi Finn,

    You have this working in Ubuntu? Just curious. Trying to figure out how to get it working in Windows and OSX.

    ReplyDelete
  2. Only tried Ubuntu. I suggest trying cygwin in windows. In OSX Id think this should work as long as you have git.

    ReplyDelete
  3. John: For whatever reason I couldn't quite get this to work on OSX either. But you can grab android-src.jar from
    http://android.opensourceror.org/2010/01/18/android-source/, that worked for me.

    ReplyDelete