style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-8809257555105760"
data-ad-slot="9085542108">


Trick or Treat

Learning Android Note #1


Contents
1. Compile Android Root-FS Source code
2. Something wrong with embinux website
3. Working on Android NDK
4.
Loading 3D model with min3D library
5. Porting Android to new development board
6. New SDK Android 2.3 API 9  installed !!





# Compile Android Root-FS Source code
Date : 8 November 2009

1.download source code of Android from
http://source.android.com/download

2.install all need packages for compile the sources.
$ sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev

3.due to my computer is use Ubuntu 9.10 as base. JDK 5 sdk is out of fashion. So , just change 2 place in the build/core/main.mk file to be JDK 1.6
# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')

4.do the rest as the official website is describe.
5.make the source code and wait for a while ...
6.after hours , image are all created

Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Installed file list: out/target/product/generic/installed-files.txt






# Something wrong with embinux website ??
Date : 24 January 2010

Recently , I tried to porting Android to Beagleboard.

I did as they said on http://labs.embinux.org/index.php/Android_Porting_Guide_to_Beagle_Board

Well, At least , It working on my board but still can not use network or playing sound.

Anyway,On 24th I tried to access the website. Something wrong was writing on the website page.

(-o-)

Did Hacker change links of android poring page of embinux site ?




# Working on Android NDK
Date : 20 March 2010
  
1.Download Android NDK from here. (I'm using Ubuntu as development platform)
2.Extract NDK and parse to you workspace directory
3.Enter to NDK directory and run setup script
       $ cd  android-ndk-r3/build
       $ build/host-setup.sh
4.Now build the hello-jni application
       $ make APP=hello-jni
  libhello-jni.so library must be appeared at apps/hello-jni/libs/armeabi
5.By using Eclipse to open project at apps/hello-jni/project
hello-jni android eclipse project

6.Execute Android Emulator and Yes It's Work !!
Using C to make app run on Android




# Loading 3D model with min3D library
Date : 23 September 2010

Trying to loading 3D model that made by using Blender program to Android
1.Using Blender (
http://www.blender.org/) to make a 3D model (For demo,Just a box)
2.creating a Box and export it to wavefront(.obj) format.  Just select all option when you export it.
blender export obj
3.At this step, You will got box.obj and box.mtl files. Then, change their name to box_obj and box_mtl
4.change meterial link described in box_obj file. To be just like this below...
 mtllib box_mtl
5.Import the modified resource into Min3D's Android project and do some coding as you can see
  from (
http://code.google.com/p/min3d/)
6.Run the program through a Emulator and Yes It Works !!!

Min3D with a Box !!



 
# Porting Android to new development board
Date : 2 January 2011

From my experience, To porting android you need to know about..
  - bootloader : u-boot,redboot or whatever. You need to know how to config boot option to load from NAND,SD-Card,TFTP
or the media that contains Android-Linux kernel
  - Android-Linux kernel : This is a hard job. To porting Android to new development board that never run Android before.
First of all,you need to obtain Linux kernel sourcecode that it compiled kernel running perfectly on the target board.
From that point we will porting it into Android-Linux kernel.
  - Android-Root File System : due to Android kernel and root file system is separated, you can compile it with cross-compiler
without related with kernel.The compiled root file system can be use with all other development boards.

OK.Now we will talking about how to making Android-Linux kernel for the board.
 1. Download the Android-Linux kernel sourcecode that nearly your board Linux kernel sourcecode version.
Check the version of the kernel on http://en.wikipedia.org/wiki/Android_%28operating_system%29

For example :
if your board's Linux kernel is 2.6.31 version.then using Android 2.2 (Froyo) that base on Linux kernel 2.6.32 version.
$ git clone git://android.git.kernel.org/kernel/common.git android-kernel
$ cd android-kernel
$ git checkout origin/android-2.6.32

 2. Try to check that it contains your board config file in /arch/arm/config or not. If it had a config file then thing gonna be easier.
 If it not you have to porting all of config and driver from your own board's linux kernel sourcecode and it will be a hard way to do.
    - In case of config file is not existed in config directory. You need to make patch from your board original Linux kernel sourcecode diff with vanilla linux kernel (ofcause same version)
and then try to patch it into Android-Linux kernel. At this point a lot of error may appear, Just use your sense to ignore, fix it or give up.
    - If the config file existed (or already doing patched) then try to config the Android-Linux kernel sourcecode. If no error then you are lucky.
If not, try to copy sourcecode from your board's kernel sourcecode and fix it. Especially,Driver problem is better to be solved by using board's original sourcecode.

android porting image

3. After compiled without error and you got uImage file. Don't be happy too fast. You neet to fix touch screen driver and mapping keymap anyway.
    - For touch screen driver, you need to add touch event when event is report to upper level.
    - For keymap, you need to map at least KEY_BACK,KEY_HOME,KEY_MENU for control Android

4. Just make uImage again. If the kernel image working well with Android root file system on your board.. Congratulation.(^^)
*** This is wrote from my own experience. I'm not sure it the right way or not. At least it works for me.



# New SDK Android 2.3 API 9  installed !!
Date : 22 January 2011

        I just update Android's SDK last week and some errors are happened.
1. On my Ubuntu Not PC, I got debug expire problem  and it resolved by delete file ~/.android/debug.keystore and clean your Android projects.
2. On my Office Debian Lenny PC, I got a complain about GLIBC version is not compatible and still can not do anything...

However, on my Ubuntu PC I can run an Android Emulator and ... Wow !! It's has Galaxy Tab Emulator also. Great ...

Galaxy Tab Emulator.                                                                   I'll be celebrating 20 years of Linux with
The Linux Foundation!




Custom Search