Monday, June 14, 2010

Android with database

It seems Android has own database sqlite. But sqlite is a self contained database, which means the database is on the local computer one. To pull information from internet, one have to use mysql server. Android will be able to pull the information out through PHP, which I have no clue at this moment.

To install MySQL on the ubuntu, use the following commands:

===============
sudo apt-get install mysql-server php5-mysql
===============

Then, you can use the following command to check the server status.

===============
mysql -u root -p
===============

The following command will create a database "pager" and give all the right to user "setup"

===============
mysql -u root -p

mysql> create database pager;
Query OK, 1 row affected (0.00 sec)

mysql> grant usage on *.* to setup@localhost identified by 'your password here';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on pager.* to setup@localhost;
Query OK, 0 rows affected (0.00 sec)
===============

Once the database is setup, you can check the following tutorial.

http://dev.mysql.com/doc/refman/5.0/en/tutorial.html

To make php to work, you might need phpmyadmin

===============
sudo phpmyadmin
===============

Further mysql setup is on
http://www.phpf1.com/tutorial/php-mysql-tutorial.html?page=5


\

Thursday, June 10, 2010

Android theme

/system/app/Launcher.apk is actually the theme file. Unzip the file and you can find the icon, color and font setup. You can change that package and upload to change your theme.

Boot animation

put your animation files as /data/local/bootanimation.zip

If this file does not exist, another animation will be displayed, which I have not found it yet.

Now, create desc.txt file and type the following…

* 480 427 30
p 1 0 part0
p 0 10 part1

Here is what the desc.txt file does and mean.

* 480 – stretched width of the animation
* 427 – stretched height of the animation
* 30p – this controlled the speed of both parts of the animation
* 1 – this defined how many times part0 of the animation looped
* 0 – saw no change when altering this number
* part0 – folder containing first part of the animation
* p – this was a bit confusing as there is no space between the words “part0″ & the “p”. I tried adding a space and changing this number -> “part0 30p”. I expected this to change the speed of the second part of the animation, but there was no change as far as I could tell.
* 0 – this defined the number of times part1 of the animation looped (0=infinite)
* 10 – saw no change when altering this number
* part1 – folder containing second part of the animation

Reset NAND

You can use "saveenv" to save the uboot environment, for example, bootdelay. Once you saved it, uboot will use that environment every time. To erease that NAND section, you can use the following command.

==============
nand unlock 0x260000 0x20000
nand erase 0x260000 0x20000
reset
==============

Friday, June 4, 2010

Add ethernet on boot

To enable ethernet on boot, there are several things you need to setup.

0. At one point, someone from online said put "ip=dhcp" in the bootarg. That actually does not work very well. You have to remove that if you have it in your u-boot.

1. The kernel section should enable the ethernet driver.

The following setup are actually in init.rc file:

2. There should be a line to bring up eth0 on boot

==============
# Bring up the eth0 interface
ifup eth0
# Setup the DNS server configuration.
setprop net.dns1 134.129.111.111
==============

3. Start up the netcfg service

==============
service ethernet /system/bin/netcfg eth0 dhcp
user root
==============

4. If the network does not work, you might want to add the following code

==============
service dhcpcdusb0 /system/bin/dhcpcd -o domain_name_servers -B eth0
user root
==============

Thursday, June 3, 2010

Get nano on android

==============
wget http://content.modaco.net/dropzone/nano.android.zip
wget http://content.modaco.net/dropzone/terminfo.zip
adb push terminfo /system/etc/terminfo
adb push nano /system/bin
adb shell
su
export TERMINFO=/system/etc/terminfo
export TERM=linux
==============

The above steps put terminal information in /system/etc/. The nano can not save at this moment.

Connected to Beagleboard

The beagleboard has an adb server running once it boot up. To connect to the beagleboard, you can use the adb commend on the host computer.

===============
adb connect 134.129.xxx.xxx:5555
adb devices
===============

Once it shows a device, you can use that device name. For example,

===============
adb -s 134.129.xxx.xxx:5555 shell
===============

will open up a shell on the beagleboard.

To install a package to the beagleboard, you can use the following command.
===============
adb -s 134.129.xxx.xxx:5555 install -r Entertainment1.5.apk
===============

If success, the terminal will show something like:

===============
210 KB/s (12897 bytes in 0.059s)
pkg: /data/local/tmp/Entertainment1.5.apk
Success
===============

If that device is the only device, you can copy file to the beagleboard by the following command, that will copy the current nano to beagleboard /system/bin directory.

===============
adb push nano /system/bin/nano
===============

Build Android filesystem

The files downloaded from 0xlab are modified. Here is how it works now.

1. U-boot: u-boot can be version as long as it detect C4 board. You can use "saveenv" to save boot options to NAND. At least the delay time was saved. The following code should be used to pass the boot option to kernel.

==============
"mmcargs=setenv bootargs console=${console} " \
"init=/init " \
"rootwait " \
"vram=${vram} " \
"omapfb.mode=640x480MR-16@60 " \
"omapfb.debug=y " \
"omapdss.def_disp=${defaultdisplay} " \
"root=${mmcroot} " \
"rootfstype=${mmcrootfstype}\0" \
==============


2. Kernel: The kernel file can be downloaded from http://gitorious.org/0xlab-kernel. The only thing you need to change is the boot option.

==============
CONFIG_CMDLINE="root=/dev/mmcblk0p2 init=/init rw console=ttyS2,115200n8"
==============

That will set the root to the SD card.

3. Root file system: Zipped root file system from 0xlab works fine. The compiled system does not work very well at this moment.

Wednesday, June 2, 2010

repo sync error

sync stopped at 61%, solved by the following.

also have the same problem and I solved it by modifying manually
the .repo/manifests/default.xml file:
fetch="git://gitorious.org/0xdroid/" #instead of
fetch="git://git.0xlab.org/"
review="0xlab.org" />

Tuesday, June 1, 2010

Add eth0

=================
netcfg
netcfg eth0 dhcp
setprop net.dns1 134.129.111.111
=================

Boot procedure

The prebuilt image works fine. My kernel and rootfs do not boot. The kernel can not find the files system. It seems the kernel boot option needs to be set up to boot from "root=/dev/mmcblk0p2". I kernel option I found is:

===============
root=/dev/mmcblk0p2 init=/init rw console=ttyS2,115200n8
===============


I am trying my own rootfs with prebuilt kernel. More will follow