Izumi Blog: Ralf - Android Tips
Index: Home | What Is Izumi | Linux Tips | OpenBSD Tips | FreeBSD Tips
This page contain several tips for developing with Android. I use this mostly as reminders of commands that I found useful. There's generally nothing here one couldn't learn by searching on the net or reading the documentation, which is generally how I got the commands in the first place.
Site License And Disclaimer as well as contact information are available here.

«»  2008/11/09 «» Android Links  «»

Some handy Android links to keep around:


«»  2008/11/09 «» Checkout Android source under Windows  «»

The easy way to checkout Android sources under Windows:

You will not be able to build the system under Windows. Some of the tools can be built, which is useful if you're trying to make your own SDK. To do so you just need to install a Sun Java JDK and add its bin folder to the Cygwin path.


«»  2008/11/09 «» Enhancing Android SDK with OpenGL javadoc  «»

If you use Eclipse to develop an Android application that uses OpenGL ES, you'll notice there's no help for the OpenGL methods (i.e. the javax.microedition.khronos.opengles.GL10 and javax.microedition.khronos.egl.EGL10 namespace).

The Android SDK uses the OpenGL ES 1.0 API for 3D rendering.

The javadoc bundled for OpenGL ES in the Android SDK reference documentation only describes the method names but does not offer any comment on what the method does nor what the parameters mean.

This can be easily fixed by overriding one javadoc file with the one from the official specification.

Here's how:

   jsr-239-1_0_1-spec/javax/microedition/khronos/egl/EGL10.html
   jsr-239-1_0_1-spec/javax/microedition/khronos/opengles/GL10.html
  android-sdk-windows-1.0_r1/docs/reference/javax/microedition/khronos/egl/
  android-sdk-windows-1.0_r1/docs/reference/javax/microedition/khronos/opengles/

Now restart Eclipse and enjoy complete javadoc for GL10 methods, which makes it much more usable.


«»  2008/11/09 «» Accessing Android SDK source from Eclipse  «»

When you install the Android 1.0 SDK in Eclipse with the ADT plugin, you can't browse the source code of the Android SDK methods. If you try to follow one, Eclipse only shows the disassembled class code.

It's however trivial to install the source and have it available in Eclipse with ADT:

Now from the Android open source, the only thing you really need is the platform/frameworks/base.git project. It is composed of many sub-directories (e.g. graphics), which in turn contain sub-directories such as java, data, etc. Each first-level directory represents a part of the Android API (core, graphics, etc.) and then inside you'll find the java code, some data, some native stuff, etc.

So what you want is to take directories that correspond to Java namespaces and stick them in the $SDK/sources directory you just created above.

To give you a concrete example, you'd want something like this:

	$ cp -r graphics/java/android $SDK/sources/.
	$ cp -r graphics/java/com     $SDK/sources/.

This is just an example. Under Linux or Mac, it would be better to do symlinks whereas on Windows even with Cygwin you don't have a choice and you need to copy everything (Eclipse won't support Explorer shortcuts nor Cygwin symlinks.)

Under Cygwin, I'd do something like this:

	$ SDK=/path/to/my/android-sdk-windows-1.0_r1
	$ mkdir -p $SDK/sources
	$ cd android-source/platform/frameworks/base
	$ rsync -avP */java/* $SDK/sources/.

If Eclipse is running you need to close it and restart it for it to detect the sources folder in the SDK. However the directory content is read on the fly by Eclipse so it can be changed anytime later.

Note that for this to work you need to have the source match the exact version of the SDK android.jar being used and that doesn't seem always obvious. At least in one case I saw Eclipse displaying the source code on the wrong line as if the file differed by a few comments. I did my repo/git checkout using the default (it's called master head on the summary page) whereas I guess I should have used the release-1.0 head or the android-1.0 tag.



Site License

Creative Commons License
This work is licensed by Raphaël Moll under a Creative Commons License.

Options
Color Theme: Gray  | Blue  | Black  | Sand  | Khaki | Egg  | None

Web ralf.alfray.com Powered by Google

Display Izumi & PHP Credits

Stats
8508 accesses, 3 accesses from 38.107.191.84
Visited 367 times by Google, last 2010/09/04 22:42
Visited 558 times by Yahoo!, last 2010/09/08 18:22
Visited 3 times by Alexa, last 2010/06/04 08:03
Visited 29 times by Teoma, last 2010/09/05 17:30
Visited 173 times by MSN, last 2010/09/08 06:16

< Generated in 0.11 seconds the 09/09/2010, 03:29 AM by Izumi 1.1.4 >