第一部分 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.

更多相关文章

  1. android 学习笔记有用代码片段(2)
  2. android view画图笔记-1
  3. Android学习笔记(十九)
  4. 《Android 基础(十二)》 TextInputLayout,让输入框更有灵性
  5. Android中PackageManager学习笔记(3)-PackageParser
  6. android学习笔记二
  7. Android学习笔记(一)——初识Android的系统
  8. 动画学习笔记-Android Animation
  9. 【Android学习笔记】AutoCompleteTextView(数组在代码中)

随机推荐

  1. Python 中星号的本质及其使用方式
  2. 每天一算: Number of Boomerangs
  3. 使用Azure Backup还原云端VM
  4. 二叉树实现
  5. linux文件目录结构汇总!Linux学习
  6. 使用pkg打包编译nodejs程序,手动设置缓存
  7. 来了!Python官方文档中文版
  8. 使用AndroidStudio生成打有系统签名的apk
  9. 来了!Django 2.2 正式发布
  10. 添加到我的小程序动画实现详细讲解,轻松学