2013年11月26日 星期二

Nexus 5 w/ AOSP

Tested in KRT16M / KOT49H

Steps

Follow the steps here

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

  • unlock device
  • get source code Version

    • KRT16M | android-4.4_r1
    • KOT49H | android-4.4.2_r1
  • get nexus driver

  • fix what's missing in nexus driver

    link
    yes, pull the binary from stock ROM first If you didn't do that, your SIM cannot be used

  • (optional) get /system/media/bootanimation.zip Because AOSP android doesn't have nexus animation

  • (ADD: 2013/11/29 16:55) add Network Location Provider for GMS
    link
    Fixed Wireless GPS issues. Changed "config_locationProviderPackageNames" from "com.google.android.location" to "com.google.android.gms" in frameworks/base/core/res/res/values/config.xml

  • start to build

      $ source build/envsetup.sh  
      $ lunch  
          => Press AOSP hammerhead userdebug  
      $ make clobber  
      $ make -j 4  
    
  • flash custom recovery (CWM or TWRP)

  • flash everything other than recovery

  • fastboot reboot bootloader

  • Press VOL-UP than power button to enter recovery mode
    Choose Advanced -> sideload mode, if you are using TWRP

      $ adb sideload gapps
          gapps link http://forum.xda-developers.com/showthread.php?t=2397942
      $ adb sideload stock_boot_animation or 
          adb push bootanimation.zip into /system/media/bootanimation.zip
    
  • do a factory reset

  • (ADD: 2013/12/19 16:07)
    fix green line issue in camcorder KOT49H (KRT16M has this issue?)
    Replace /system/lib/libmmcamera_interface.so by stock one
    link

Have fun!

2013年11月12日 星期二

WeakReference listener in API

在找 OnSharedPreferenceChangeListener 範例抄時找到這個

SharedPreferences keeps listeners in a WeakHashMap. This means that you cannot use an anonymous inner class as a listener, as it will become the target of garbage collection as soon as you leave the current scope.

SharedPreferences.onSharedPreferenceChangeListener not being called consistently

靠... 這很容易踩到啊 =_=

2013年11月2日 星期六

ad block on android

plurka 廣告設計得太爛,不要怪我對你不義啊

記錄一下

adb shell mount -o rw,remount /system 
adb push hosts.for.mobile.txt /etc/hosts
adb reboot

refs: xda