|
|
Index: Home | What Is Izumi | Linux Tips | OpenBSD Tips | FreeBSD TipsThis 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.
Some handy Android links to keep around:
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.
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:
bindings_gles-1_0_1-mrel-spec.zip and save it locally.bindings_gles-1_0_1-mrel-spec.zip:jsr-239-1_0_1-spec/javax/microedition/khronos/egl/EGL10.htmljsr-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.
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:
android-sdk-windows-1.0_r1 for me.sources.
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.
|
|

This work is licensed by Raphaël Moll under a Creative Commons License.
|
|
| Color Theme: | Gray | Blue | Black | Sand | Khaki | Egg | None |
|
|
|
|