25 March 2014

Install Cyanogenmod

Jgn guna cwm, tapi twrp utk custom recover.

ref : http://forum.xda-developers.com/showthread.php?t=2213910

stable : cm-10.2 (cm-11 belum stable)

tools:
-fastboot

  • fastboot flash recovery TWRPrecovery.img 
  • fastboot erase cache
  • ---

  • fastboot flash boot insert_your_boot_image_name_here.img
  • fastboot erase cache

-adb
  • adb reboot-bootloader

19 March 2014

Android Threading

- AsyncTask tak boleh execute AsyncTask yg lain.
- IntentService tak boleh panggil IntentService yg lain
-AsyncTask, IntentService, Service & Thread boleh panggil Service atau Thread
#(Rujuk row 'Triggered From')





ServiceThreadIntentServiceAsyncTask
When to use ?Task with no UI, but shouldn't be too long. Use threads within service for long tasks.- Long task in general.

- For tasks in parallel use Multiple threads (traditional mechanisms)
- Long task usually with no communication to main thread.
(Update)- If communication is required, can use main thread handler or broadcast intents[3]

- When callbacks are needed (Intent triggered tasks). 
- Long task having to communicate with main thread.

- For tasks in parallel use multiple instances OR Executor [1]
TriggerCall to method
onStartService()
Thread start() methodIntentCall to method execute()
Triggered From (thread)Any threadAny ThreadMain Thread (Intent is received on main thread and then worker thread is spawed)Main Thread
Runs On (thread)Main ThreadIts own threadSeparate worker threadWorker thread. However, Main thread methods may be invoked in between to publish progress.
Limitations /
Drawbacks
May block main thread- Manual thread management

- Code may become difficult to read
- Cannot run tasks in parallel.

- Multiple intents are queued on the same worker thread.
- one instance can only be executed once (hence cannot run in a loop) [2]

- Must be created and executed from the Main thread


ref: http://techtej.blogspot.com.es/2011/03/android-thread-constructspart-4.html