3 ms·
Some things I would note: * Do not use getBaseContext() like he does when he created the new Activity. Use getApplicationContext for most things (unless an Act
by Nemisis7654 13y ago
Some things I would note:
* Do not use getBaseContext() like he does when he created the new Activity. Use getApplicationContext for most things (unless an Activity is required) as this is guaranteed to be the same throughout the lifetime of your application.
* For log alternatives, checkout Timber by Jake Wharton (https://github.com/JakeWharton/timber https://github.com/JakeWharton/timber)
* I would suggest using the Build.VERSION_CODES when making the check against which version of android the device is (http://developer.android.com/reference/android/os/Build.VERSION_CODES.html http://developer.android.com/reference/android/os/Build.VERS...)
- minikomi 13y agoAnd if you want colored logcat in a terminal window: alias lc="adb logcat | sed -e $'s/^I.*/\e[0;94m&\e[0m/g; s/^D.*/\e[0;92m&\e[0m/g; s/^W.*/\e[0;93m&\e[0m/g; s/^E.*/\e[0;91m&\e[0m/g'"
- myko 13y agoJake Wharton also has a neat fork of Jeff Sharkey's colored logout Python script which is pretty awesome: https://github.com/JakeWharton/pidcat https://github.com/JakeWharton/pidcat