logo

What's here anyways ?

What's up doc ?

Playing with Android (Part IV)

Login:

If you've read the previous posts, you should have Busybox running on the phone. That means a proper shell (Ash), and plenty of Unix utilities to play with. Good.
But that's still not quite what we are looking for. We'd like to be able to store our aliases in a .profile startup file. We'd like to add our own stuff to the startup process. We'd like to feel at $HOME on our Android.

So we're going to do just that ! But as we've seen already, Android is not built to do that out of the box : no /etc/passwd, no $HOME, and a strange startup script. Let's have a look.

→ Read more...

Playing with Android (Part III)

Installing Busybox

Ok, we got busybox running (if you haven't, read Part II), but typing /data/busybox ls is no fun. We are going to install Busybox properly, in /bin.

The problem is that Busybox knows how to install itself (as in create symlinks with the right names that point to it), but not in our crazy Android environment (no /bin, no /usr). So we'll have to hack a bit. The first thing I did was to rewrite the install procedure in libbb/appletlib.c. If you know what you are doing, this is probably the best way. For those who don't I have another solution.
The key idea is to print the name of all the applets (the list actually depends on what you selected in the menuconfig). Then, we can create our symlinks ourselves, and modify the ramdisk accordingly.

→ Read more...

Playing with Android (Part II)

Cross Compiling 101

Now that we can modify the ramdisk, we can start thinking about what to put there. Our goal was (and still is) to write code directly in C, so we are going to do just that. Since Android runs on an ARM processor, it will be a bit more difficult than calling gcc on our C file : we have to setup a Cross-compiler toolchain.

A cross compiler is just a compiler that runs on a processor (say, an Intel processor), but actually produces binaries for another processor (an ARM, in our case). We also have to get a few libraries that have already been compiled for ARM (like libc and friends), and the binutils (strip, nm, ld …). And last but not least, we have to “isolate” this toolchain from our regular system, to make sure that the cross compiler is not going to try to use the “regular” libraries (in /lib and /usr/lib).

→ Read more...

Playing with Android (Part I)

Introduction

Android is a pretty cool environment for playing with an embedded system. It comes in a bundle that you can get from their website, containing an emulator (Qemu), the system itself (mainly Linux + Dalvik Java vitual machine) and all the Eclipse stuff that makes it easy to write cool Java apps in a few clicks.

Writing Java apps is cool, and the tutorials and docs available on the website are really helpful. But you might want to play with the “real thing” and start hacking the phone. Let's read the FAQ :

Can I write code for Android using C/C++?
Android only supports applications written using the Java programming language at this time.

Well, let's try it anyways !

→ Read more...

 
start.txt · Last modified: 2009/03/03 04:31 by fred
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki