Consider disabling animations if you feel confident about using your device's developer settings. Animations look nice as you navigate your phone, but they can slow down performance and drain battery power. Disabling them does require turning on Developer Mode, however, so it's not for the faint-hearted.
Hopefully there aren't too many hidden, hidden features - but here's some of the less well known and non-intuitive features available for Android that will definitely make your life easier and your apps better.
The tools in the /tools directory of the SDK deserve a mention:
draw9patch
which helped design stretchable buttons. He gave me assets from there, and I changed from a background colour to a 9-patch drawable and now we have a custom button, rounded corners, etc stretched to fit the text.ddms
, which is also integrated into the Eclipse plugin. It's immensely powerful, but I use it to take screenshots.adb
- interact with your device or emulator from the command line. I use this to follow the logs from my device in a terminal window on my desktop, though I have found it useful for installing and uninstalling apps which are misbehaving.sqlite3
- great for interacting with an installed database, and trying out queries.apkbuilder
, zipalign
, aapt
- great for running headless buildsmonkey
for fuzz-testing your app. I would also single out the three Designing for Performance, Responsiveness and Seamlessness, but I'd also like to add a fourth Coding for (Battery) Life.
Although the Javadoc can be a little sparse at times, it helps no end to have the source right there for you to look at.
It is also very useful to have plenty of sample apps written by Googlers to build, examine and then see how they did it.
I guess I'll start then.
A nice hidden feature I think is the Best Practices of the Android documentation. It lists plenty of great tips for designing responsive and fast apps.
Best Practices sections are:
Another hidden feature is that these docs are available offline as part of the SDK. At first I was loading up a few pages every day for my morning train ride but didn't need to do that anymore after I found them in the SDK directory.
If you use Eclipse, you will notice that it doesn't format XML files very well and when it does, it's very inconsistent (sometimes it splits the attributes by new lines, sometimes it doesn't). To fix it, you can press Ctrl-Shift-F (auto-format). The rules Ctrl-Shift-F uses are in Window->Preferences->XML->XML Files->Editor.
Android supports XML <shape>
's which can be used as SVG-like drawables. Unfortunately there's no documentation for them. This is the best information I could find:
http://escomic.net/217
Also with regard to best practices, you may want to check out Android coding style:
http://source.android.com/source/code-style.html
as well as the eclipse code and imports formatters (android-formatting.xml, android.importorder) which are found in the platform source code under development/ide/eclipse
hierarchyviewer in /tools allows you to debug/analyze your view layout: padding, positioning, view hierarchy etc.
It saved me a lot of time a couple of times when trying to figure out why things are laid out the way they are.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With