Tuesday, December 14, 2010

Play Low Quality Videos in Gome Flytouch

One of the common problems of Gome Flytouch is its inability to play high quality videos. Here is a trick by Kiarov for converting videos to a lower quality in order to be playable - Gome Flytouch Video Encoding Tutorial. Do not forget, you must have your tablet overclocked to 400MHz.


The software used for conversion was HandBrake but you can use any converter of your choice. The converted videos work well with Meridian Player.


Here’s the settings:


Type: MP4
Size: 480x320
Video Bit Rate: 384 kbps
Frame Rate: 25 fps
Video Encoder: XVid
Audio Encoder: AAC
Sample Rate: 44.1 KHz
Audio Bit Rate: 64 kbps

Thursday, December 09, 2010

G Sensor and Camera Fix for Gome Flytouch

Some Gome Flytouch tablets have their G sensors and cameras inverted by default. There are two ways to fix these.


1. If you’re creating your own firmware, it’s better to include the fix right on the scriptcmd file.


For the G sensor, add this line:



setenv gsensor_axis 0,-1,1,1,2,1

and for the camera:



setenv camera_rotate 270

2. If you had your device rooted, just execute the commands above on any Android terminal as root.

Sunday, December 05, 2010

Run Android Apps in Windows using YouWave

Now you can test run apps in your Windows machine before installing them in your device or perhaps you don’t want to miss the fun playing Robo Defense. This is best for extending the battery life of your device if you are just testing apps.


Watch the demo [here]. Click [here] to download. Enjoy!

Saturday, December 04, 2010

Gome Flytouch Android Tablet

Gome Flytouch


Gome Logo
Gome Flytouch



Model: generic
Manufacturer: generic
Device: generic
Product: generic
Brand: generic
CPI ABI: armeabi
Kernel Version: 2.6.29-00236-g4f8dbbb-dirty howayhuo@szmce12(MontaVista)
Build No: Donut.eng.howayhuo.20100910.134417
Release: 1.6
SDK: 4

Processor: ARM926EJ-S rev 5 (v5l)
BogoMIPS: 174.48
Features: swp half thumb fastmult edsp java
CPU Implementer: 0x41
CPU Architecture: 5TEJ
CPU Variant: 0x0
CPU Part: 0x926
CPU Revision: 5

Hardware: WMT
Revision:0000
Serial: 000000000000000

Type: Touchscreen Tablet
Materials: Plastic
Colors: White
Camera: 0.3 Megapixel
Screen: 7" Resistive Touchscreen at 800*480(16:9)
CPU: VIA WM8505 (350MHz)
RAM: 256MB DDR2
Flash ROM:2GB
Expansion Memory: SD/SDHC/MMC up to 32GB
Network Connectivity: WiFi or Ethernet (RJ45)
Sensors: Accelerometer (supports rotation)
Vibration: Yes
Battery Capacity: 2400mah
Ports: USB 2.0 Host /USB 2.0 Device Port/3.5 mm Headphone Jack
Sound: Internal Microphone and Speakers

If you are buying from the Philippines you can get this one for PHP 3,300 (USD 75) at 168 Mall, Divisoria.

Android 1.6 Firmware Default Wallpaper

The default wallpaper file is:



/data/data/com.android.settings/files/wallpaper

It is a JPEG file format without the .jpg extension.

Thursday, December 02, 2010

My Android Splash Screen

I just want to share my Android Splash Screen. Credit goes to the original artist. I just modified some part of it.


Android Splash Screen


If you have an 800x480 pad, make sure your bitmap is 24-bit and of course the resolution must be 800x480.

mkimage for Windows

Even if you do not use Linux, you can still roll your own Android firmware update on Windows. Click [here] to download mkimage for Windows.

Wednesday, December 01, 2010

update.sh for Android

After scriptcmd (previous blog post), the next to be called is the update.sh script. The script will setup the file system, data partition, cache partition, and user space. It will install BusyBox for you.



height=22
pointX=30
pointY=100

SDCARD=/mnt/mmcblk0p1

string="Good luck!"
echo $string
gui-echo $pointX $pointY "$string"

if [ -x /mnt/mmcblk0/script/update.sh ] ; then
SDCARD=/mnt/mmcblk0
fi

if [ -f ${SDCARD}/script/android_fs.tar ] ; then
string="Updating file system..."
echo $string
gui-echo $pointX $pointY "$string"
else
string="--- File not found - script/android_fs.tar"
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height + $height))
string="Failed updating file system!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi

# FILE SYSTEM SETUP

pointY=$(($pointY + $height + $height))
string="Cleaning up file system..."
echo $string
gui-echo $pointX $pointY "$string"

flash_eraseall /dev/mtd9
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="--- Failed cleaning up file system!"
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))
string="Kernel doesn't support NAND flash?"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Done cleaning up file system..."
echo $string
gui-echo $pointX $pointY "$string"
fi

mount -t yaffs2 /dev/mtdblock9 /mnt/mtd
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="--- Failed mounting file system!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="File system is now mounted..."
echo $string
gui-echo $pointX $pointY "$string"
fi

pointY=$(($pointY + $height))
string="Now copying system files..."
echo $string
gui-echo $pointX $pointY "$string"

tar xvf ${SDCARD}/script/android_fs.tar -C /mnt/mtd
chmod 777 -R /mnt/mtd
string="Files were copied successfully..."
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))

if [ -d ${SDCARD}/script/driver ] ; then
echo "Now copying device drivers..."
if [ ! -d /mnt/mtd/.driver ] ; then
mkdir /mnt/mtd/.driver
fi
cp -a ${SDCARD}/script/driver/* /mnt/mtd/.driver

string="Files were copied successfully..."
echo $string
gui-echo $pointX $pointY "$string"
fi

boardID=`getenv wmt.model`
if [ $? -eq 0 ] ; then
if [ $boardID = "8088b_90_20k" ] || [ $boardID = "8088b_90_1k" ] || [ $boardID = "8088b_90_1k" ] ; then
boardID=8088b
fi
special_driver=${SDCARD}/script/driver_$boardID
if [ -d $special_driver ] ; then
echo "Now copying special device drivers..."
if [ ! -d /mnt/mtd/.driver ] ; then
mkdir /mnt/mtd/.driver
fi
cp -a ${special_driver}/* /mnt/mtd/.driver
string="Done copying special device drivers..."
echo $string
gui-echo $pointX $pointY "$string"
fi
fi

if [ -f ${SDCARD}/script/busybox_1.17.tar ] && [ ! -x /mnt/mtd/system/bin/sh-org ] ; then
string="Now copying BusyBox..."
echo $string
gui-echo $pointX $pointY "$string"
tar xvf ${SDCARD}/script/busybox_1.17.tar -C /mnt/mtd
string="Done copying BusyBox..."
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))

if [ -x /mnt/mtd/busybox/bin/ash ] ; then
mv /mnt/mtd/system/bin/sh /mnt/mtd/system/bin/sh-org
ln -s /busybox/bin/busybox /mnt/mtd/system/bin/sh
rm /mnt/mtd/system/bin/busybox
cp /busybox/bin/busybox /mnt/mtd/system/bin/
if [ ! -d /mnt/mtd/bin ] ; then
mkdir /mnt/mtd/bin
fi
ln -s /busybox/bin/busybox /mnt/mtd/bin/sh
fi
fi

if [ -d ${SDCARD}/script/pre_root_disk ] || [ -f ${SDCARD}/script/data.tar ] || [ -f ${SDCARD}/script/cache.tar ] ; then
string="Now copying additional files..."
echo $string
gui-echo $pointX $pointY "$string"

if [ -d ${SDCARD}/script/pre_root_disk ] ; then
cp -a ${SDCARD}/script/pre_root_disk/* /mnt/mtd
if [ -d /mnt/mtd/restore ] ; then
if [ -d /mnt/mtd/.restore ] ; then
cp -a /mnt/mtd/restore/* /mnt/mtd/.restore/
rm -rf /mnt/mtd/restore
else
mv /mnt/mtd/restore /mnt/mtd/.restore
fi
fi
fi

if [ -f ${SDCARD}/script/data.tar ] ; then
if [ ! -d /mnt/mtd/.restore ] ; then
mkdir /mnt/mtd/.restore
fi
cp -rf ${SDCARD}/script/data.tar /mnt/mtd/.restore

if [ -d ${SDCARD}/script/pre_data_disk/app ] ; then
cp -rf ${SDCARD}/script/pre_data_disk/app /mnt/mtd/.restore
fi
fi

if [ -f ${SDCARD}/script/cache.tar ] ; then
if [ ! -d /mnt/mtd/.restore ] ; then
mkdir /mnt/mtd/.restore
fi
cp ${SDCARD}/script/cache.tar /mnt/mtd/.restore
fi

if [ -d /mnt/mtd/.restore ] ; then
if [ -f ${SDCARD}/script/etc/touchcal ] ; then
cp -a ${SDCARD}/script/etc/touchcal /mnt/mtd/.restore/
fi
boardID=`getenv wmt.model`
if [ $? -eq 0 ] ; then
special_touchcal_file=${SDCARD}/script/etc/touchcal_$boardID
if [ -f ${special_touchcal_file} ] ; then
cp -a ${special_touchcal_file} /mnt/mtd/.restore/touchcal
fi
fi
fi

string="Done copying additional files..."
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))
fi

string="Setting file system permissions..."
echo $string
gui-echo $pointX $pointY "$string"

chmod 755 -R /mnt/mtd
chmod 750 /mnt/mtd/init.rc
chmod 750 /mnt/mtd/init.goldfish.rc
chmod 750 /mnt/mtd/init
chmod 644 /mnt/mtd/default.prop
chmod 700 /mnt/mtd/root
chmod 750 /mnt/mtd/sbin
chmod 751 /mnt/mtd/bin
chmod 751 /mnt/mtd/busybox
chmod 750 /mnt/mtd/lib

string="File system permissions were set..."
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))

if [ -f /mnt/mtd/system/bin/preboot ] ; then
chown root:0 /mnt/mtd/system/bin/preboot
chmod a-w /mnt/mtd/system/bin/preboot
chmod a+rxs /mnt/mtd/system/bin/preboot
fi
chmod 777 -R /mnt/mtd
mv /mnt/mtd/busybox/bin/su /mnt/mtd/busybox/bin/su.bak
chown root:root /mnt/mtd/system/bin/su
chmod 4777 /mnt/mtd/system/bin/su

sync
umount /mnt/mtd

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height))
string="Failed dismounting file system!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi

# DATA PARTITION SETUP

if [ -d ${SDCARD}/script/etc ] || [ -f ${SDCARD}/script/data.tar ] || [ -d ${SDCARD}/script/pre_data_disk ] ; then
string="Erasing data partition..."
echo $string
gui-echo $pointX $pointY "$string"

flash_eraseall /dev/mtd10
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed erasing data partition!"
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))
string="Kernel doesn't support NAND flash?"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Done erasing data partition..."
echo $string
gui-echo $pointX $pointY "$string"
fi

mount -t yaffs2 /dev/mtdblock10 /mnt/mtd
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed mounting data partition!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Data partition mounted successully..."
echo $string
gui-echo $pointX $pointY "$string"
fi
pointY=$(($pointY + $height))

string="Now copying files to data partition..."
echo $string
gui-echo $pointX $pointY "$string"

if [ -f ${SDCARD}/script/data.tar ] ; then
tar xvf ${SDCARD}/script/data.tar -C /mnt/mtd
fi

if [ -d ${SDCARD}/script/etc ] ; then
if [ ! -d /mnt/mtd/wmtpref ] ; then
mkdir /mnt/mtd/wmtpref
fi
cp -a ${SDCARD}/script/etc/* /mnt/mtd/wmtpref/

boardID=`getenv wmt.model`
if [ $? -eq 0 ] ; then
special_touchcal_file=${SDCARD}/script/etc/touchcal_$boardID
if [ -f ${special_touchcal_file} ] ; then
cp -a ${special_touchcal_file} /mnt/mtd/wmtpref/touchcal
fi
fi
fi

if [ -d ${SDCARD}/script/app ] ; then
if [ -d /mnt/mtd/app ] ; then
echo "The app folder exists in the data partition. We don't want it there!"
else
cp -a ${SDCARD}/script/app /mnt/mtd/
fi
fi

if [ -d ${SDCARD}/script/pre_data_disk ] ; then
cp -a ${SDCARD}/script/pre_data_disk/* /mnt/mtd
fi

if [ -d ${SDCARD}/script/pre_root_disk/restore/etc ] ; then
cp -a ${SDCARD}/script/pre_root_disk/restore/etc /mnt/mtd/wmtpref/
fi

string="Done copying files to data partition..."
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))

chmod 777 -R /mnt/mtd
sync
umount /mnt/mtd

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height))
string="Failed to dismount data partition!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi
fi

# CACHE PARTITION SETUP

if [ -f ${SDCARD}/script/cache.tar ] || [ -d ${SDCARD}/script/pre_cache_disk ] ; then
string="Erasing cache partition..."
echo $string
gui-echo $pointX $pointY "$string"

flash_eraseall /dev/mtd11
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed to erase cache partition!"
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))
string="Kernel doesn't support NAND flash?"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Done erasing cache partition..."
echo $string
gui-echo $pointX $pointY "$string"
fi

mount -t yaffs2 /dev/mtdblock11 /mnt/mtd
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed mounting data partition!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Cache partition mounted successfully..."
echo $string
gui-echo $pointX $pointY "$string"
fi
pointY=$(($pointY + $height))

string="Now copying files to cache partition..."
echo $string
gui-echo $pointX $pointY "$string"

if [ -f ${SDCARD}/script/cache.tar ] ; then
tar xvf ${SDCARD}/script/chache.tar -C /mnt/mtd
fi

if [ -d ${SDCARD}/script/pre_cache_disk ] ; then
cp -a ${SDCARD}/script/pre_cache_disk/* /mnt/mtd
fi

string="Done copying files to cache partition..."
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height))

chmod 777 -R /mnt/mtd
sync
umount /mnt/mtd

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height))
string="Failed to dismount cache partition!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi
fi

string="File system updated successfully!"
echo $string
gui-echo $pointX $pointY "$string"
pointY=$(($pointY + $height + $height))

# USER SPACE SETUP

if [ -f ${SDCARD}/script/driver/g_file_storage.ko ] ; then
string="Erasing user space..."
echo $string
gui-echo $pointX $pointY "$string"

flash_eraseall /dev/mtd12

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed to erase user space!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Done erasing user space..."
echo $string
gui-echo $pointX $pointY "$string"
fi
mount -t yaffs2 /dev/mtdblock12 /mnt/mtd

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed to mount user space!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Done mounting user space..."
echo $string
gui-echo $pointX $pointY "$string"
fi

pointY=$(($pointY + $height))
string="Creating loop file..."
echo $string
gui-echo $pointX $pointY "$string"

create_loopfile mtd12 /mnt/mtd/vfat.bin bs=524288

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed to create loop file!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
if [ -f /mnt/mtd/vfat.bin ] ; then
string="Loop file created..."
echo $string
gui-echo $pointX $pointY "$string"
else
pointY=$(($pointY + $height + $height))
string="Failed to create loop file!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi
fi
pointY=$(($pointY + $height))

string="Formatting loop file..."
echo $string
gui-echo $pointX $pointY "$string"

mkdosfs /mnt/mtd/vfat.bin

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed formatting loop file!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Loop file formatted..."
echo $string
gui-echo $pointX $pointY "$string"
fi

if [ -d ${SDCARD}/script/DemoFile ] || [ -d ${SDCARD}/script/pre_local_disk ] ; then

losetup /dev/loop/0 /mnt/mtd/vfat.bin
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height))
string="Command losetup failed!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi
mkdir /LocalDisk
mount -o iocharset=gb2312 -t vfat /dev/loop/0 /LocalDisk
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height))
string="Mounting /dev/loop/0 to /LocalDisk failed!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi

if [ -d ${SDCARD}/script/DemoFile ] ; then
string="Now copying demo Files to user space..."
echo $string
gui-echo $pointX $pointY "$string"

cp -a ${SDCARD}/script/DemoFile /LocalDisk

string="Demo files were copied to user space successfully..."
echo $string
gui-echo $pointX $pointY "$string"
fi

if [ -d ${SDCARD}/script/pre_local_disk ] ; then
string="Now copying files to user space..."
echo $string
gui-echo $pointX $pointY "$string"

cp -a ${SDCARD}/script/pre_local_disk/* /LocalDisk

string="Done copying files to user space..."
echo $string
gui-echo $pointX $pointY "$string"
fi

chmod 777 -R /LocalDisk
sync
umount /LocalDisk
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height))
string="Failed dismounting LocalDisk!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi
losetup -d /dev/loop/0
if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height))
string="Command losetup -d /dev/loop/0 failed!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi
fi

chmod 777 -R /mnt/mtd
sync
umount /mnt/mtd

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed dismounting user space!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi

pointY=$(($pointY + $height + $height))
else
if [ -d ${SDCARD}/script/DemoFile ] || [ -d ${SDCARD}/script/pre_local_disk ] ; then
string="Erasing user space..."
echo $string
gui-echo $pointX $pointY "$string"

flash_eraseall /dev/mtd12

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed erasing user space!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Done erasing user space..."
echo $string
gui-echo $pointX $pointY "$string"
fi
mount -t yaffs2 /dev/mtdblock12 /mnt/mtd

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed mounting user space!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
else
string="Done mounting user space..."
echo $string
gui-echo $pointX $pointY "$string"
fi

pointY=$(($pointY + $height))

if [ -d ${SDCARD}/script/DemoFile ] ; then
string="Now copying demo files to user space..."
echo $string
gui-echo $pointX $pointY "$string"

cp -a ${SDCARD}/script/DemoFile /mnt/mtd

string="Done copying demo files to user space..."
echo $string
gui-echo $pointX $pointY "$string"
fi

if [ -d ${SDCARD}/script/pre_local_disk ] ; then
string="Now copying files to user space..."
echo $string
gui-echo $pointX $pointY "$string"

cp -a ${SDCARD}/script/pre_local_disk/* /mnt/mtd

string="Done copying files to user space..."
echo $string
gui-echo $pointX $pointY "$string"
fi

chmod 777 -R /mnt/mtd
sync
umount /mnt/mtd

if [ $? -ne 0 ] ; then
pointY=$(($pointY + $height + $height))
string="Failed dismounting user space!"
echo $string
gui-echo $pointX $pointY "$string"
exit 0
fi

pointY=$(($pointY + $height + $height))
fi
fi

echo 0 > /proc/boot-splash
cleanlcd
remove_sd

string="Please remove SD card..."
while [ -x /bin/ls ]
do
if [ -x ${SDCARD}/script/update.sh ] ; then
echo $string
sleep 1
else
break
fi
done

cleanlcd
hint_shutdown
string="Shutting down..."
echo $string
poweroff

scriptcmd for Android

Here’s my script for updating the Android firmware. This script must contain the correct file header for your processor.



setenv BMP_ADR 3c00000
fatload mmc 0 $(BMP_ADR) script/hint1_en.bmp
setenv lcdparam 1,30000,8,800,480,48,40,40,3,29,13
setenv pwmparam 0,45,1040,1040
setenv LCDC_FB f900000
lcdinit
logo show -1 0
textout 30 80 "Android update will start after 8 seconds..." ffff00
sleep 1
textout 30 80 "Android update will start after 7 seconds..." ffff00
sleep 1
textout 30 80 "Android update will start after 6 seconds..." ffff00
sleep 1
textout 30 80 "Android update will start after 5 seconds..." ffff00
sleep 1
textout 30 80 "Android update will start after 4 seconds..." ffff00
sleep 1
textout 30 80 "Android update will start after 3 seconds..." ffff00
sleep 1
textout 30 80 "Android update will start after 2 seconds..." ffff00
sleep 1
textout 30 80 "Android update will start after 1 second..." ffff00
sleep 1
mmcinit
setenv text1 'textout 705 458 " 1.9.99 by eradicus" c5c5c5'
run text1
textout 30 80 "Android Update" ffff00
textout -1 -1 "Updating w-load..." ffff00
fatload mmc 0 0 script/wload.bin
erase ffff0000 +10000
cp.b 0 ffff0000 10000
textout -1 -1 "w-load update done!" ff00
textout -1 -1 "Updating u-boot..." ffff00
fatload mmc 0 0 script/u-boot.bin
erase fff80000 +50000
cp.b 0 fff80000 50000
textout -1 -1 "u-boot update done!" ff00
setenv touchic true
setenv bootdelay 1
setenv audioic wm9715
setenv touchirq gpio5
setenv battvoltlist 6830,7086,7310,7503,7575,7636,7720,7861,7953,8018,8190
setenv gpiostate 3
setenv kpadid wms8088b_14
setenv panelres.x 800
setenv panelres.y 480
setenv logocmd 'nand read 3c00000 600000 150000;logo show;run text1'
setenv bootcmd 'nand read 0 0 380000;bootm 0'
setenv bootargs 'mem=237M noinitrd root=/dev/mtdblock9 rootfstype=yaffs2 rw console=ttyS0,115200n8 init=/init lcdid=1 androidboot.console=ttyS0 loadtime=-3'
setenv sd_powerup
setenv sd_powerdown
setenv amp_powerup 0xd811005c|0x4,0xd8110084|0x4,0xd81100ac&~0x4
setenv amp_powerdown 0xd811005c|0x4,0xd8110084|0x4,0xd81100ac|0x4
setenv wifi_powerdown 0xd811005c|0x2,0xd8110084|0x2,0xd81100ac&~0x2
setenv wifi_powerup 0xd811005c|0x2,0xd8110084|0x2,0xd81100ac|0x2
setenv regop $(amp_powerdown),$(wifi_powerdown),D8130054|0x1
setenv LOGO_STRING
setenv basevolt 3300
setenv hibernation_ui no
setenv eth_ui yes
setenv gsensor_axis 0,1,1,-1,2,1
setenv gsensor_int gpio6
setenv gsensor_ui yes
setenv motor_ui yes
setenv photo_ui_slideshow_mode
setenv vibra_start 0xD811005C|0x8,0xD8110084|0x8,0xD81100AC|0x8
setenv vibra_stop 0xD81100AC&~0x8
setenv vibra_enable 0
setenv video_ui_dir_select
setenv 88 1
setenv dw
setenv restore
setenv need_restore_data yes
setenv orientation_ui yes
setenv cam_pre_width 360
setenv cam_pre_height 480
setenv camera_rotate 90
setenv camera_chip sonix
setenv camera_up 5c|0x1,84|0x1,ac|0x1
setenv camera_down ac&~0x1
setenv camera_ui yes
setenv customer_id 1
setenv musicplayer_black_cd yes
setenv enable_hw_scal yes
setenv enable_gome_theme no
setenv modem3g_ui no
setenv pppoe_ui no
setenv release_ver 1.9_88v4c
setenv release_date 20101107
setenv release_language english
setenv bluetooth_ui no
setenv wmt.model 8088b_90_20k
setenv powerhold 1
setenv touchcodec
setenv amp_stop_when_nouse
randommac
protect off all
saveenv
fatload mmc 0 0 script/androidpad.bmp
textout -1 -1 "Updating splash screen..." ffff00
nand write 0 600000 $(filesize)
textout -1 -1 "Splash screen update done!" ff00
fatload mmc 0 0 script/ramdisk_88_en.gz
textout -1 -1 "Updating ramdisk..." ffff00
nand write 0 C00000 $(filesize)
textout -1 -1 "ramdisk update done!" ff00
fatload mmc 0 0 script/uzImage.bin
textout -1 -1 "Updating kernel..." ffff00
nand write 0 0 $(filesize)
textout -1 -1 "Kernel update done!" ff00
textout -1 -1 "Updating file system..." ffff00
setenv bootargs 'mem=237M root=/dev/ram rw initrd=0x01000000,32M console=ttyS0,115200n8 init=/linuxrc lcdid=1 loadtime=-3'
fatload mmc 0 1000000 script/mvl5_v5t_ramdisk_WM8505.090922.loop_en.gz
textout -1 -1 "Please wait..." ff00
bootm 0

To prepend the file header, execute



mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "info" -d thisscript.txt scriptcmd

Monday, November 29, 2010

Android ASCII Art


G G
GG GG
G G
GG GG
GG GGGGGGGGGGGGG GG
GGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGG GGGGGGGGGGGGGGGGG GGGGGG
GGGGGG GGGGGGGGGGGGGGG GGGGGG
GGGGGGG GGGGGGGGGGGGGGG GGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG

GG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GG
GGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGG
GGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGGG
GGGGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGGGG
GGGGG GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG GGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGG GGGGGGGGG
GGGGGGGGG GGGGGGGGG
GGGGGGGGG GGGGGGGGG
GGGGGGGGG GGGGGGGGG
GGGGGGGGG GGGGGGGGG
GGGGGGGGG GGGGGGGGG
GGGGGGGGG GGGGGGGGG
GGGGGGG GGGGGGG
GGGGGGG GGGGGGG

Tuesday, October 19, 2010

Active Directory with JXplorer

For folks who do not read the manual. If you encounter this error using JXplorer:



[LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment:
In order to perform this operation a successful bind must be completed
on the connection., data 0, vece]

Do not use your login name. Use your full name instead.

Tuesday, September 28, 2010

On an obsolete road

I have already forgotten these things.


1. Inner join versus outer join
2. Simple select statement for getting the max value of a column + another column
3. Definition of Object Oriented programming
4. Exact figure of the limitation of HTTP GET.
5. Differences between GET and POST.
6. The default method of an HTML form when submitted.


I have made time to review them. Here they are.


1. Inner join will return matched results between two tables while outer join will return all regardless if there is a match or none between the two tables. Here’s a good article by Jeff Atwood, A Visual Explanation of SQL Joins.


2. Given a table Person with two columns, Name and Age. To get the eldest,



SELECT Name, Age FROM Person WHERE Age = max(Age);

3. Object oriented programming is a programming paradigm that uses objects. These objects consist of fields, methods and their interaction.


4. 256 characters.


5. Given the size limit of GET, POST is used to overcome that. POST is used if you want to submit data with non-ASCII characters. If you want to hide data you’ll prefer POST than GET since it hides hidden fields in the URL but it’s not enough since you can view the source or use browser debugging tools such as FireBug and Chrome Developer Tools.


6. If you have an HTML form with no method defined, GET is the default.


There goes my hopes and dreams. The road less traveled.

Friday, September 24, 2010

Casting to a Boolean in JavaScript

I came across with this expression,



button.enabled = !!enable

!! is just a double not. This is just obscure.

Friday, July 16, 2010

HTML5 Web SQL Database

HTML5 has a bunch of cool APIs. In one of my previous posts, I have written a simple demonstration of the Web Storage JavaScript API. In this post I will be showing another demonstration, the Web SQL Database JavaScript API. What is so fascinating about these APIs is they are “crash-safe.” Now you can lessen the load of your web servers and perform SQL tasks like, sorting, joining, etc. on the client side.


Click [here] for the demonstration.

Thursday, July 15, 2010

Removing while Iterating a Collection in Java

Let us say you have a list and you want to remove items while iterating through it if a certain condition satisfies.



for (Object object : listOfObjects) {
if (isConditionSatisfied) {
listOfObjects.remove(object);
}
}

What is wrong with this code above? Try it and you will get this,



Exception in thread "main" java.util.ConcurrentModificationException

You might want to do this instead,



Iterator<Object> iterator = listOfObjects.iterator();
while (iterator.hasNext()) {
Object object = iterator.next();
if (isConditionSatisfied) {
iterator.remove();
}
}

Have a nice day.

Tuesday, July 13, 2010

HTML5 Web Storage

Here is a simple demonstration of HTML5’s Web Storage. The code is quite straightforward. One thing to experiment is after entering any string and hitting save, try closing the browser entirely and opening it again visiting the same page to see if the data persisted.


Click [here] for the demonstration.

Wednesday, June 09, 2010

Just for fun!

It has been a while since I have written something about Javascript. You need to copy and paste this to your browser’s address bar to see how it works.



javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200;
DI=document.getElementsByTagName("a"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style;
DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=
(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',50); void(0);

Enjoy!

Monday, June 07, 2010

Performance of null checks in Java

Which one is faster? a == null or null == a?


This is the method of the former.



public static boolean firstNullCheck(Object a) {
if (a == null) {
return true;
}
return false;
}

and the method of the latter.



public static boolean secondNullCheck(Object a) {
if (null == a) {
return true;
}
return false;
}

Here’s the disassembly of the former.



public static boolean firstNullCheck(java.lang.Object);
Code:
0: aload_0
1: ifnonnull 6
4: iconst_1
5: ireturn
6: iconst_0
7: ireturn

and the disassembly of the latter.



public static boolean secondNullCheck(java.lang.Object);
Code:
0: aconst_null
1: aload_0
2: if_acmpne 7
5: iconst_1
6: ireturn
7: iconst_0
8: ireturn

The former saves you a bytecode. Anyone who can explain further since I am not sure whether if_acmpne is faster than ifnonnull?

Google over SSL

If you do not want your search queries to be compromised, use Google SSL. However, there is one thing I discovered though, if you click on a cached link, it’s not encrypted, it goes back to HTTP from HTTPS making the protected search useless. Just be aware.

Friday, June 04, 2010

Importance of daily meetings

Why are daily meetings important? Yes I know what you are thinking, to check if the schedule is on target, to spot showstoppers, roadblocks and whatnots. But aside from those, there are things that make daily meetings rewarding.


Let’s face it, some people (including me) find it hard oftentimes to achieve a certain level of focus at work especially when multitasking is inevitable. Meetings will remind us of our commitments infront of our peers. Since most of us will be ashamed of not making any progress, it will trigger ourselves to do something about it.


In my opinion, having daily meetings typically before the shift starts will help a lot of peers suffering from bad habits - procrastination. It is one way of invigorating those who have not found their way out yet.


“Keep each other in the zone, what are teammates for?”

Tuesday, June 01, 2010

Yesterday I turned 0x18

A very simple party, KFC Bucket, 1 Black Forest Cake. Thank you God for another blessed year.

Friday, March 12, 2010

Google Search Operators

There is great power here. I know most of you are not taking advantage of these operators.


1. + (plus) - this will yield search results ordered by the number of occurrences of the specified word
2. - (dash) - this will yield search results that do not contain the specified word
3. " " (double quotes) - this will yield search results containing the exact word specified
4. . (dot) - is a wildcard representing a single character
5. * (asterisk) - is a wildcard representing a single word
6. | - traditional OR operator
7. site: - search within a specified domain
8. intitle: - this will search for the 1st specified word in page titles and the 2nd specified word in the text
9. allintitle: - this will search for texts in page titles only
10. inurl: - this will search for URLs containing the specified word
11. allinurl: - this will search for texts in URLs only
12. filetype: - this will search for texts containing files of the specified extension and the specified word
13. ext: - this will search for texts containing files of the specified extension and the specified word
14. numrange - used for searching number sequences
15. link: - this will search for pages containing the specified link
16. inanchor: - this will yield search results that contain the actual link text specified
17. allintext: - this will search for the exact text specified
18. info: - this will search for links and information about the specified website
19. cache: - this will display a copy of the page stored by Google
20. movie: - this will yield search results about the movie specified
21. stocks: - display the current stock of the specified symbol
22. define: - instant dictionary

Thursday, March 04, 2010

Gmail Search Operators

These operators will give you more precise search results.


1. from: - mails from the name of the sender
2. to: - mails sent/to be sent to to the recipient
3. subject: - search mails containing the specified words in the subject
4. OR - traditional OR operator
5. - (dash or hyphen) - exclude messages containing the specified words
6. label: - search messages by label
7. has:attachment - search mails with attachments
8. filename: - search mails by filename of the attachments
9. " " (double quotes) - traditional operator for filtering exact specified words
10. () - used for grouping search expressions
11. in:anywhere - search for mails anywhere in your account
12. in:inbox - search for mails in your inbox
13. in:trash - search for mails in your trash folder
14. in:spam - search for mails in your spam folder
15. is:starred - search for starred mails
16. is:unread - search for unread mails
17. is:read - search for read mails
18. cc: - search mails that were carbon copied to a specified recipient
19. bcc: - search mails that were blind carbon copied to a specified recipient
20. after: - search mails after a specified date in yyyy/MM/dd format
21. before: - search mails before a specified date in yyyy/MM/dd format

Saturday, February 20, 2010

Endianness of Java

In Java, multibyte data items or streams are stored in big endian order.


Using Java to write bytes directly to the wire will require byte-order transformation if the recipient talks in little endian. The same is true if you are reading directly from the wire from a sender who talks in little endian.


If you are using a byte array wrapped in ByteBuffer,



byte[] data = new byte[] { 12, 19, 83, 05, -05, 55, -55 };
ByteBuffer byteBuffer = ByteBuffer.wrap(data);

Transforming from big endian to little endian is easy,



byteBuffer.order(java.nio.ByteOrder.LITTLE_ENDIAN);

If you are unsure of the endianness of the underlying platform, just invoke the native order method.



java.nio.ByteOrder.nativeOrder();

Aside from streams, operands in classes that are above 1 byte in size are in big endian order.

Friday, February 19, 2010

Protect your self from Repetitive Strain Injury (RSI)

Putting your keyboard where your brain is means that you are a candidate for repetitive strain injury.


You should check out Workrave now. Workrave is a free software available for Windows and *Nix users.


If you are working on a Debian-based system,



sudo apt-get install workrave

Windows users, download [here].

Tuesday, January 12, 2010

Java Lambda Expressions / Closures

Lambda expressions are just (anonymous) functions.



f(x) = x can be expressed as x→x
f(x, y) = x*x + y*y can be expressed as x, y→x*x + y*y

In simple Java terms,


1. Return an int 23 with a void argument



int j = { => 23 }.invoke();

2. Closure with 1 argument, convert 23 kilograms to pounds



double j = { double kilograms => kilograms*2.2D }.invoke(23);

3. Closure with 2 arguments, get the sum of the 2 squares



int squareSum = { int x, int y => (x*x) + (y*y) }.invoke(2,3);

4. Closure returning an instance and invoking an instance method



{ new RocketLauncher() }.invoke().fire();

Every time a closure is created at compile time, an interface is automatically created for each expression having an invoke method with a signature depending on the number of arguments, then an anonymous subclass of this interface is constructed.


Enjoy!