Building Android on a Linux PC - AVS Forum

AVS Forum > Video Components > Home Theater Computers > HTPC - Linux Chat > Building Android on a Linux PC

HTPC - Linux Chat

waterhead's Avatar waterhead
03:41 PM Liked: 12
post #1 of 12
06-19-2010 | Posts: 1,280
Joined: May 2007
I thought that I would take a stab at this. It is incomplete, but here is what I have so far:

How to "Install" Android

Download and install the Android SDK:

http://developer.android.com/sdk/index.html

Install the Android SDK:

http://developer.android.com/sdk/installing.html

==============================================

System Requirements:

*Eclipse 3.4 or 3.5
*Eclipse JDT plugin
*Eclipse IDE for Java EE Developers OR
*Eclipse IDE for Java Developers OR
*Eclipse forRCP/Plug-in Developers OR
*Eclipse Classic (ver 3.5.1 & higher)
*JDK 5 or JDK 6
*Android Development Tools (optional)

==============================================

Using Synaptic, I installed the following packages:

ant (1.7.1-4)
ant-gcj (1.7.1-4)
ant-optional (1.7.1-4)
ant-optional-gcj (1.7.1-4)
eclipse (3.5.1+repack~1-0ubuntu4)
eclipse-jdt (3.5.1+repack~1-0ubuntu4)
eclipse-pde (3.5.1+repack~1-0ubuntu4)
eclipse-platform (3.5.1+repack~1-0ubuntu4)
eclipse-platform-data (3.5.1+repack~1-0ubuntu4)
eclipse-plugin-cvs (3.5.1+repack~1-0ubuntu4)
eclipse-rcp (3.5.1+repack~1-0ubuntu4)
gcj-4.4-base (4.4.1-5ubuntu2)
gcj-4.4-jre-lib (4.4.1-5ubuntu2)
libequinox-osgi-java (3.5.1+repack~1-0ubuntu4)
libgcj-bc (4.4.1-1ubuntu2)
libgcj-common (1:4.4.1-1ubuntu2)
libgcj10 (4.4.1-5ubuntu2)
libjaxp1.3-java (1.3.04-5ubuntu2)
libswt-gtk-3.5-java (3.5.1+repack~1-0ubuntu4)
libswt-gtk-3.5-jni (3.5.1+repack~1-0ubuntu4)
libxerces2-java (2.9.1-4ubuntu1)
sun-java6-jdk (6.20dlj-0ubuntu1.9.10)

==============================================

Unpack the downloaded SDK:
Code:
tar xvfz android-sdk_r06-linux_86.tgz
==============================================

Install the ADT plugin for Eclipse:

http://developer.android.com/sdk/ecl...tml#installing

Eclipse 3.5:

1. Start Eclipse, then select Help > Install New Software.
2. In the Available Software dialog, click Add....
3. In the Add Site dialog that appears, enter a name for the remote site (for example, "Android Plugin") in the "Name" field.

In the "Location" field, enter this URL:

Code:
https://dl-ssl.google.com/android/eclipse/
Note: If you have trouble acquiring the plugin, you can try using "http" in the URL, instead of "https" (https is preferred for security reasons).

Click OK.
4. Back in the Available Software view, you should now see "Developer Tools" added to the list. Select the checkbox next to Developer Tools, which will automatically select the nested tools Android DDMS and Android Development Tools. Click Next.
5. In the resulting Install Details dialog, the Android DDMS and Android Development Tools features are listed. Click Next to read and accept the license agreement and install any dependencies, then click Finish.
6. Restart Eclipse.

==============================================

Configuring the ADT Plugin

Once you've successfully downnloaded ADT as described above, the next step is to modify your ADT preferences in Eclipse to point to the Android SDK directory:

1. Select Window > Preferences... to open the Preferences panel.
2. Select Android from the left panel.
3. For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.
4. Click Apply, then OK.

==============================================

Now install the Andoid packages, using Eclipse. Select:
Window > Android SDK and AVD Manager

On the left, select "Available Packages"
Under the address "https://dl-ssl.google.com/android/repository/repository.xml"
I selected the newer versions:

Android SDK tools, revision 6
Documentation for Android SDK, API 8, revision 1
SDK Platform Android 2.2, API 8 revision 1
Sampes for SDK API 8, revision1
Google APIs by Google Inc., Android API 8, revision 1

==============================================

Not sure what to do next. Everybody welcome to jump in and join me. I could use the help.
waterhead's Avatar waterhead
03:54 PM Liked: 12
post #2 of 12
06-19-2010 | Posts: 1,280
Joined: May 2007
In Eclipse, open the Android SDK manager:
Window > Android SDK and AVD Manager

In the left panel, select "Virtual Devices", then click on the "New..." button on the right. I selected Android 2.2 in the target dropdown box, and clicked the "Create AVD" button. It seems to then start some sort of virtual Android device. But I wasn't able to do anything with it.
waterhead's Avatar waterhead
04:48 PM Liked: 12
post #3 of 12
06-19-2010 | Posts: 1,280
Joined: May 2007
I tried the "Hello, World" tutorial, but didn't get the expected results.

http://developer.android.com/resourc...llo-world.html

It really isn't about installing the Android OS, but I thought it was worth trying.
waterhead's Avatar waterhead
07:24 PM Liked: 12
post #4 of 12
06-19-2010 | Posts: 1,280
Joined: May 2007
It looks like the How-To's that I have been following are more for building apps for Android. I don't seem to even have the android source on my PC.

There is a tutorial on getting the source here:

http://source.android.com/source/download.html

It seems to have information on everything, except what part of the source is needed to build Android! The repository is here:

http://android.git.kernel.org/

It says to use repo to download the entire source tree, and git to pull a specific tree. Looks like more research is needed.
waterhead's Avatar waterhead
11:10 PM Liked: 12
post #5 of 12
06-19-2010 | Posts: 1,280
Joined: May 2007
I found two tutorials on building Android for the Eee PC 701. They aren't the most recent, but it should give a clue on what is needed.

http://groups.google.com/group/andro...862bdb52dac936

http://docs.google.com/View?docid=aj...357_81cmpr56f6

There is an eee_701 project in the git repository, which makes this build possible. No other non-phone manufacturer has such a project. There is a reference to a make-live script to make an image that won't automatically overwrite your hard drive. Although it is reported as being submitted, I don't see it in the repo.

http://code.google.com/p/android/issues/detail?id=1598

There is also a Google Groups on porting Android to different hardware.

http://groups.google.com/group/android-porting
Rgb's Avatar Rgb
04:56 AM Liked: 19
post #6 of 12
06-20-2010 | Posts: 6,893
Joined: Apr 2000
Just for grins, you can play with Android on x86 with the liveCD-

http://code.google.com/p/live-android/

http://code.google.com/p/live-android/wiki/readme

The last update is kinda old, so it appears no Android v2.1/2.2 liveCD yet, but at least it's something to try in VirtualBox.
waterhead's Avatar waterhead
06:25 AM Liked: 12
post #7 of 12
06-20-2010 | Posts: 1,280
Joined: May 2007
Thanks RGB, I'll take a look at that.

If the live script that I found still works, we (maybe) can make a bootable image with a newer version of Android.
waterhead's Avatar waterhead
10:58 AM Liked: 12
post #8 of 12
06-20-2010 | Posts: 1,280
Joined: May 2007
OK, this looks promising:

http://www.android-x86.org/
http://code.google.com/p/android-x86...ourceCode?tm=4

Quote:


Android-x86 Project - Run Android on Your PC

This is a project to port Android open source project to x86 platform, formerly known as "patch hosting for android x86 support". The original plan is to host different patches for android x86 support from open source community. A few months after we created the project, we found out that we could do much more than just hosting patches. So we decide to fork our code base that will provide android x86 support on different x86 platforms, and set up a git server to host it. To reflect this major change, we create this new project.


It is using version 1.6, so the latest goodies wouldn't be available here either.

Edit: If you pull from the GIT repository, you can get version 2.1:
Quote:


At 2010-02-03, the Eclair 2.1 has been merged to Android-x86 eclair-x86 branch

http://www.android-x86.org/getsourcecode
waterhead's Avatar waterhead
04:16 PM Liked: 12
post #9 of 12
06-21-2010 | Posts: 1,280
Joined: May 2007
Ever since I found the Android-x86 project, I've been working on trying to produce a USB image. I had to take time out to visit dear-old-dad yesterday (father's day in the USA).

I run this command:
Code:
make usb_img TARGET_PRODUCT=eeepc
It runs a few hours, then exits with an error. Each time it was because of a missing dependency. I install the dependency, and try again. So far I had to install three more dependencies.

When I get the finished image, I'll update on the dependencies that I had to install.
waterhead's Avatar waterhead
04:38 PM Liked: 12
post #10 of 12
06-22-2010 | Posts: 1,280
Joined: May 2007
OK, I have successfully built the Android-x86 USB image on Ubuntu 9.10, and booted it!

First, I had to add these applications, they all were available through the Ubuntu repository (and apt).

curl
bison
flex
gperf

You also need the repo program developed by android:
Code:
$ mkdir bin
$ echo $PATH
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo
Code:
$ mkdir android-x86
$ cd android-x86
$ repo init -u git://git.android-x86.org/platform/manifest.git -b eclair-x86
$ repo sync
The first few times that I used the repo command, I had to still give the full path:
Code:
~/bin/repo init -u git://git.android-x86.org/platform/manifest.git -b eclair-x86
This will then download the Android source, from the repository. The latest version it offers is 2.1. It will take quite some time to do this.

After it is finished downloading the source, go to the top of the source directory:
Code:
$ cd ~/android-x86
To make a bootable Eee PC compatible USB image, run this command:
Code:
make usb_img TARGET_PRODUCT=eeepc
To make a bootable image compatible with a Samsung netbook, run this command:
Code:
$ make usb_img TARGET_PRODUCT=q1u
You can also make a live CD image:
Code:
$ make iso_img TARGET_PRODUCT=eeepc
Or
Code:
$ make iso_img TARGET_PRODUCT=q1u
The time to compile is comparable to a kernel compile (on a single-core CPU). Try it and see what you think!
waterhead's Avatar waterhead
03:56 PM Liked: 12
post #11 of 12
06-25-2010 | Posts: 1,280
Joined: May 2007
I have been trying the version of Android-x86 2.1 that I compiled, and have foud a few problems.

First, neither network connection works by default. The LAN connection won't work until you configure it using the ConnectBot terminal, using the netcfg command.
Code:
# netcfg eth0 down
# netcfg eth0 up
# netcfg eth0 dhcp
This then gave me a working LAN connection. The wireless doesn't seem to work at all. It keeps enabling/disabling the wireless, in a continual loop.

I haven't been able to diagnose the wireless problem, because of another problem. Not all of the terminal commands were compiled into the image. A common command such as ls is missing. I tried a precompiled version of 1.6, and all of the commands are there.

Edit: I just discovered that busybox is installed, and that I can run commands through that. More on that after I give it a try.
waterhead's Avatar waterhead
04:24 PM Liked: 12
post #12 of 12
06-25-2010 | Posts: 1,280
Joined: May 2007
Busybox helps to run some commands. I am still unable to load/unload modules. There is the insmod/rmmod commands available. But it fails to find a modules folder!

I have to be able to unload and reload the wireless module, to try and make it work
Reply HTPC - Linux Chat

Subscribe to this Thread

Powered by vBadvanced CMPS v3.2.3