Sunday, October 31, 2010

Compile Hello World with Android source code

To run a helloworld application with the AOSP and see it in emulator

Once the android source is set up in your system and building fine.
1.You can copy paste the HelloWorld folder created in android-sdk into packages/app.
2. Copy Android.mk from any other package and just have to change the LOCAL_PACKAGE_NAME and make that one match the folder name in packages/apps.
3. Add your package in the list in /build/target/product/core.mk

Compile the source code now and build the root directory. Once done you can find your package .apk file in out/target/product/generic/system/app/

build the make file then generates

To run the file in the emulator
path to android sdk/tools/emulator -avd my_avd -kernel common/arch/arm/boot/zImage -system out/target/product/generic/system.img -sdcard sdcard.img &


To create a new system image file for the emulator (system.img userdata.img)
$ make install clean
$ make

No comments: