App Fundamentals摘要

App Components

Activities,Services,Content providers,Broadcast receivers


Activities, services, and content providers that you include in your source but do not declarein the manifest are not visible to the system and, consequently, can never run. However,broadcastreceivers can be either declared in the manifest or created dynamically in code (asBroadcastReceiver objects) and registered with the system by callingregisterReceiver().


An implicit intentsimply describes the type of action to perform (and, optionally, the data upon which you’d like toperform the action) and allows the system to find a component on the device that can perform theaction and start it. If there are multiple components that can perform the action described by theintent, then the user selects which one to use.


Android supports many different qualifiers for your alternative resources. Thequalifier is a short string that you include in the name of your resource directories in order todefine the device configuration for which those resources should be used. As anotherexample, you should often create different layouts for your activities, depending on thedevice's screen orientation and size. For example, when the device screen is in portraitorientation (tall), you might want a layout with buttons to be vertical, but when the screen is inlandscape orientation (wide), the buttons should be aligned horizontally. To change the layoutdepending on the orientation, you can define two different layouts and apply the appropriatequalifier to each layout's directory name. Then, the system automatically applies the appropriatelayout depending on the current device orientation.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值