Using jdb (java debugger) with adb (android debug bridge) to debug Android app on a handset (without ADT plugin).

Method 1: Debug from CLI

Launch target apk.  Get pid of target app. Forward target app remote port (jdwp:<pid>) to local tcp port (tcp:<#>).  Attach jdp to specified tcp port.

(apk manifest with debuggable=”true”)
scripts:
#!/bin/bash
#adb kill-server
#sleep 1
#adb start-server
adb wait-for-device
cmd=”adb -d shell am start -e debug true -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.thirdwhale/com.thirdwhale.activity.SplashActivity”;
echo $cmd;
exec $cmd &
app_debug_port=$(adb jdwp | tail [...]

Posted at 5:20 am on September 26, 2009 | leave a comment | Filed Under: Android | read on

Passing complex data between two activities via byte serialization (Google protobuf)

First time android developer frequently asked question:  How to pass complex data from one activity to another?  One way is to use XML string serialization. Marshalling is performed at the originating activity and demarshalling is performed at the target activity. One drawback with using XML is you have more extra bytes (caused by unnecessary tags) [...]

Posted at 3:56 pm on September 22, 2009 | leave a comment | Filed Under: Android | Tagged: , , , | read on

About

Agus Santoso’s blog.
website: http://neusou8.appspot.com
email: asantoso@sfu.ca

Categories