Android Dev Tips and Tricks

1. To find the current visible (focused) activity via adb:

 $ adb -s device_serial_number shell "dumpsys window windows" | grep "mFocusedApp"

2. Which activity life cycle method is called with persistent data when an app is force closed and restarted ?
onRestoreInstanceState(Bundle savedInstanceState)

3. How to make an android phone to call a number from commandline using adb ?

$ adb shell am start -a android.intent.action.CALL -d tel:9008174697


Happy Coding..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s