| |
Android Developers |
Excellent work! I just noticed that some classes in Android.jar used the keyword On Nov 13, 9:31 am, TomCooksey <TomCook...@googlemail.com> wrote: > For those who are interested, here's how: > 1) Create your hello world program: > #include <stdio.h> > int main(int argc, char** argv) { > } > 2) Compile with an arm cross-compiler toolchain. I used a toolchain I > armv6-vfp-linux-gnueabi-gcc hi.c -o hi -static > Note the -static. I've not figured out the version of libc etc or the > 3) Copy to a running emulator: > 4) Run it! From the emulator console: > 5) Smile as you see "hello world" printed on the console. :-) > Next, I'm going to try and get busybox up & running so we can have
"native". It should be a matter of time to get either offical or
unofficial suport for calling native code from the Dalvik VM.
> printf("hello world\n");
> return 0;
> built with gentoo's crossdev tool, but there are lots out there.
> Assuming your c file is hi.c and your cross compiler is called armv6-
> vfp-linux-gnueabi-gcc, you can compile using:
> ABI used yet, so for now, link applications statically.
> adb push hi /system/sbin/hi
> cd /system/sbin
> ./hi
> access to exciting programs such as "cp"! After that, perhaps dropbear
> for remote ssh access? Or maybe a small web server like boa so we can
> turn the android emulator into a webserver? Stay tuned.