Android UI Fundamentals Develop and DesIgn笔记

第一部分 BASIC ANDROID UI,chapter 1 GET STARTED摘录的笔记。这一部分比较的基础。
manifest
1.The manifest is where you declare the physical hardware features your app
needs to run。Declaring these hardware features as required by your application allows the Android Market to properly filter applications based on a user’s hardware configu-ration.
2.The manifest is where you declare the permissions required by your app. Unlike
hardware requirements, all the permissions necessary to run your application must be declared in the manifest. There are no optional permissions.
3.The manifest is where you declare the icons and labels used by your application.
The most important is the top-level application element. This is what will represent your application on the device home screen and app drawer. However, the icon/label combination doesn’t just apply to the element. You can use them on the permissions element, which displays when the user accepts your application to install.
if the icon and label are set, but the activity and intent icons and labels are not set, then those elements will use the application icon and label by default.
4.Lastly, the manifest is where you declare your supported Android API versions.
targetSDKVersion:Declares the version of your application you are building against. This is what determines the features available to your app. If this differs from the minSDKVersion,you may need to use Java reflection to access APIs that are unavailable on the lower version.


It’s recommended to use XML for layouts, because it provides a good separation between UI and application logic. Folder names are used to separate layouts for different device configurations.


in the XML layout files,the xmlns:android attribute is necessary and must be declared in the top-level xml tag. this must always be present, or your resources will not build.

Even when you plan to set the text of a TextView in code,it’s a good idea to declare a default string.
that way, you can see what your layouts will look like with full text.


Each element in the layout is a view. A view is anything that can be drawn on
the screen.


It’s important to design your activities with the understanding that they can be killed at any time.


to ensure that your app is a good android citizen, always allow the user to return to a previous application if they have jumped straight into your app (for example, by pressing a notification or handling an intent created by another application). don’t force the user to back out of many screens of your app to return to their previous task.


some tools:
1.Android Asset Studio: this tool will take an uploaded image and create density-specific versions. It can also be used for creating launcher icons, menu bar icons, action bar icons and tab icons
2.LAYOUTOPT
3.DRAW9PATCH
4.hierarChY VieWer (unDown,page 27)
5.monKey: The Monkey runs a
specified number of iterations and randomly hits areas of the screen, changes the orientation of the device, presses volume and media keys, and generally just does crazy things. This is often a simple way of rooting out unexpected errors.

你可能感兴趣的:(android)