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

Saturday, October 2, 2010

Setting up Android source code

Changes to the file

1. To build on a 32-bit machine
To get rid of this error "Only 64-bit build environments are supported beyond > froyo/2.2"
/build/core/make.mk
- ifneq (64,$(findstring 64,$(build_arch)))
+ ifneq (i686,$(findstring i686,$(build_arch)))
Just be sure that instead of *64* you use your machine architecture (you can get it
running # uname -m) because mine is *i686*

2. To build with a java version of 1.5 instead of java 1.6



Ubuntu inside Windows can't be more easy :)

Yesterday I tried installing Ubuntu inside Windows, it was so easy that I was tempted to write down steps for any future reference:

Required stuff:
1. 512 MB of RAM

2. Ubuntu - Download the ubuntu image of whichever version you want
File size: ~700Mb File format: .iso
If you have fast internet access it might just take a couple of mins
http://www.ubuntu.com/desktop/get-ubuntu/download
Else if your internet gets interrupted every now and then you might consider downloading
it through bit torrent

3. VirtualBox
Depending on your system version/configuration virtualBox can be downloaded from here
http://www.virtualbox.org/wiki/Downloads


Once the above downloads are ready follow the article for step by step installation
http://www.psychocats.net/ubuntu/virtualbox


Just the follow up of the above post to run virtualBox in fullscreen mode:
1. Install Ubuntu on VB.
2. After install and restart, go to the 'Devices' menu for VirtualBox.
3. Select 'Install Guest Additions'.
4. Open Terminal in Ubuntu.

Type:
cd /media/cdrom0 (this puts you to the cdrom directory where you just mounted guest additions)
Press enter then type:
dir (this shows you what's inside this directory.)
Press enter then type:
sudo sh ./VBoxLinuxAdditions-x86.run (this is what you would type if you have an x86 machine, typical. If you have an AMD use that one, and so forth.)
If this steps doesnt work for you try locating the file in following structure and run it VBOXADDITIONS_W.X.Y_Z/VBoxLinuxAdditions-x86.run

5. Wait for update to complete.
6. Once complete, shut down Ubuntu.
7. Restart VirtualBox
8. Boot up Ubuntu.
9. Once booted, press cmd+F for fullscreen or cmd+L for seamless.

There u go!