2011年12月26日月曜日

use windows exe from cygwin

1. add a dummy function

function adb {
    TOP=/cygdrive/c/Android/android-sdk
    "$TOP"/platform-tools/adb.exe "$@"
}

2. create a dummy symbol link
cd /usr/bin
mv gvim gvim.org

ln -s /cygdrive/c/Program\ Files\ \(x86\)/Vim/vim73/gvim.exe gvim


xperia take root

1. download the latest version of the following script.
DooMLoRD_v3_ROOT-zergRush-busybox-su.zip


This script will:
      (1) root ur device using latest zergRush exploit (16 Nov)
      (2) install Busybox (1.18.4)
      (3) install SU files (binary: 3.0.3 and apk: 3.0.6)
  
Before u begin:   
      (1) make sure u have installed adb drivers for ur device
      (2) enable "USB DEBUGGING" 
            from (Menu\Settings\Applications\Development)
      (3) enable "UNKNOWN SOURCES"
            from (Menu\Settings\Applications)
      (4) [OPTIONAL] increase screen timeout to 10 minutes
      (5) connect USB cable to PHONE and then connect to PC
      (6) skip "PC Companion Software" prompt on device



2. run this script


3. after Superuser is installed.
    adb shell
    su
    mount -o rw,remount /dev/block/mtdblock3 /system


4. and then you will find that you can change any file under system.


ENJOY!!

2011年12月5日月曜日

save log to sdcard

# logcat -v time -f /sdcard/logcat.txt -r 1024000 & http://developer.android.com/guide/developing/tools/logcat.html

2011年3月25日金曜日

mvc Android sample

http://www.anddev.it/index.php/topic,32.msg32.html?PHPSESSID=9sergpmb12t8utmv0t22gc11ribdlo5b#msg32

need to add to android.xml

2011年3月21日月曜日

java enum

1. package test;
2.
3. /**
4. * enumのテスト
5. * @author miyasaka
6. */
7. public class EnumTest {
8.
9. enum test {
10. one ("いち", 1),
11. two ("に", 2),
12. three ("さん", 3),
13. four ("よん", 4),
14. five ("ご", 5),
15. six ("ろく", 6),
16. seven ("なな", 7),
17. eight ("はち", 8),
18. nine ("きゅう", 9),
19. ten ("じゅう", 10);
20.
21. private final String hiragana; //ひらがな
22. private final int number; // 数字
23.
24. private test(String hiragana, int number) {
25. this.hiragana = hiragana;
26. this.number = number;
27. }
28.
29. public String Hiragana() { return hiragana; }
30. public int Number() { return number; }
31. }
32.
33.
34. /**
35. * @param args
36. */
37. public static void main(String[] args) {
38.
39. int count1 = 0;
40. int count2 = 0;
41.
42. for (test t1: test.values()) {
43. System.out.println("[" + t1.ordinal() + "]:" +
44. t1.toString() + " " +
45. t1.Hiragana() + " - " +
46. t1.Number() );
47. count1 += t1.ordinal();
48. count2 += t1.Number();
49. }
50.
51. System.out.println("count1:" + count1);
52. System.out.println("count2:" + count2);
53.
54. }
55. }