Android Tips, Techniques and Theory
PART 1: Creating Content with XML with Android Studio (No programming required)
With Simple Recipes
Go Back To TOC
VITAL FEW
Below is a list of vital few tips and shortcuts that can make your life easier if you use them.
Vital Few Tips
Below is a list of vital few tips that you can used to save time:
- To preview an *.xml file that you are working on WITHOUT having to navigate to it using an intent, create multiple setContentView methods and comment all but the one that you want to see when you run the app in an emulator or on a real device since this is the file that is executed with the app loads:
// setContentView(R.layout.activity_main);
setContentView(R.layout.test1_activity_main);
// setContentView(R.layout.test2_activity_main);
- For additional information on how to run an app on a real Android device go to: http://developer.android.com/training/basics/firstapp/running-app.html
- RULE OF THUMB: The higher the dpi the higher the higher the resolution and the sharper the image that can be displayed.
- You can see how your app looks from various “viewpoints” by changing the:
- device type
- orientation (CTRL+F11)
- theme
- An easy way to see all of the four main options in one place is to close all projects first (File > Close Project). You will first see the Quick Start options, and then you can click on either the Configure or the Docs and How-Tos option. If you click on the Configure option, you can also choose the Project Defaults option.
Vital Few Shortcuts
Below is a list of vital shortcuts that can save you time.