iLeichun

当前位置:首页Android

Android前景、前途如何?(转)

分类:Android  来源:网络  时间:2011-3-19 18:38:36

     来自:http://www.mobpub.net/viewthread.php?tid=5751&extra=     

  现在移动开发 市场上平台 林立,各自圈地盘,android平台也异军突起,甚至被誉为对抗iPhone 最有实力的平台,而且预计未来将会超过iPhone 独领风骚。Android 真的就这么牛吗?真的就非常完美吗?带着疑问,记者对eoeandroid开发社区的开发者进行了解,从实际的开发者那里对android平台有了新的解读。

当 android出来的时候,大家都非常兴奋,希望这个开放平台能够做好做大,有益于移动互联网 整个产业链的每一个角色:软件 平台提供商Google , 元器件供应商与设备 制造商, 网络 运营商, 应用 开发者, 消费者。但是这从两年看来,android发展的不够好,反倒是进入了一个问题多发的混乱局面。

  android面临的问题:

  首要问题--模式 :其实模式问题说到底是一个盈利问题。 产业链中的每一个角色都想获得更多的利润。

  对角色A 软件平台提供商google来说,盈利主要是来自广告和自身的增值服务。

  对角色B 元器件和设备制造商来说,卖出去的终端 数量决定了他们的盈利。

  对角色C 网络运营商来说,用它的网络和增值服务来盈利。

  对角色D 应用开发者来说, 靠用户下载 量 和 广告植入补贴来盈利。

  对角色E 消费者来说,要为所有这些链上的角色买单,但是消费者有选择权。智能手机 的玩家来说倾向于新潮,时尚的外观, 强悍的硬件 ,绚丽实用,易用的软件,和相对低廉的价格。

  苹果 的模式是封闭,相当于OEM+软件平台提供商(角色A和B的合体), 自身控制硬件和软件质量, 实现无缝优化,凭借时尚的外观,彪悍的硬件,良好的用户体验赢得消费者口碑。凭借与运营商合作,和巨大的市场降低产品成本。 苹果自身角色AB盈利,从C那里得到分成,从D那里得到分成,与CD一起从消费者那里盈利。苹果成了最大的盈利者。

  再来看看android的模式, 开放。 虽然说开放是好事,其实也是坏事。开放了大家都可以免费用,免费做。这造成一个假象,开放降低成本,赢得更多的消费者。事实呢?开放模式下,角色混乱,大家各为其主,都想越足更广的领域,获取更多的利益。泛而不精,急功近利直接导致了用户体验差的结果,最终每个角色在消费者心理都成了大白菜,久而久之消费者对其失去信心。

  android的现状大家很清楚,市场上充斥了各种品牌,各种档次硬件,各种应用的消费品, 说其为大白菜,一点不夸张。 再来看每个角色, google升级快, 设备商跟不上,消费者抱怨(最典型HTC的系统 升级慢问题,各种民间ROM混乱的问题)。

  设备商想打响自己的品牌,涉足更多领域,推出很多款终端抢占,其开发成本,维护成本如何?可想而知质量如何?消费者抱怨(如HTC推出自己的SENSE界面 ,光是每次系统升级就耗费大量的再开发成本,最终让用户买单,不稳定的东西自然质量问题多,屏,触屏,还有程序 的问题,谁愿意花很多钱买这个质量不高的东西?) 运营商甚至开始涉足研发,不再是简单的采购,合作,推广,推自己的平台,推自己的应用商店 ,甚至推自己的终端。简直就想一口吞掉整块蛋糕。结果如何?一样是提供给用户低劣的产品,谁指望一个之前做运营不做研发的厂商能够提供好质量的消费品和软件?于是消费者又抱怨。

  对于应用开发者,自然不用说,空有满腔热忱。不仅仅角色A.B.C带来的混乱局面让开发者疲于写多个程序, 更重要的是收入甚微。 说个简单的道理,10000个用户用苹果IPHONE,开发者只需要开发一次,就可以从他们那里盈利。

  而android呢, 10个厂商或者运营商各分了1000个用户, 开发者要开发10次才能从同样数量的用户那里得到钱。而且从口碑来看, 多个厂商的总数加起来还不到人家一家。 最后是消费者,这是整个产业链的底端,直接决定了产业链的兴荣。

  从消费者的需求出发,android平台的优势完全被其混乱局面掩盖,伤害了消费者的利益。大家也知道在国外,IPHONE的价格并不贵,比起 android手机可以说是相当。消费者为什么不选一个更好用的精品?而且这个口碑会不断扩散,android因为角色混乱的问题给消费者留下的不好印象也会扩散。

尽管android的角色A,B,C,D都在为其造势,但是觉得E直接导致的市场效应大家都看在眼里。说到底A,B,C,D都依赖于E,即便再有信心,也逃不掉E的打击。个人觉得android的前景堪忧,关键还是在模式问题上,这是根本,只有解决 了最根本的问题,才能够让整个产业联动起来,蓬勃发展。

  以下是个人的一些建议,希望改进android的模式,大家可以多多发表自己的看法和意见:

  GOOGLE必须作为行业规范者。而且必须和苹果一样强势,不能再唯唯诺诺,任由角色B和C越俎代庖, 伤害到消费者。GOOGLE既然发起来了android的联盟,就有这个实力和权力去谈判并规范整个行业。不必向苹果那样一棒子打死,但是可以让整个行业井然有序。

  硬件问题

  硬件规格至少应该分为少许的几类,如按照CPU,RAM,ROM容量,屏等分为手机,平板电脑,大屏电视等类。每一类的硬件规格固定,与之优化的android版本。不符合的平台拒绝提供android版本并不予支持。应用加锁等手段强制。

  android版本问题

  android的版本升级应该时间固定,有序,并发布开放协议不允许修改系统关键部分。界面可以交由第三方设计 ,但是是通过应用程序 的方式安装在系统上。而不是HTC SENSE之类的修改应用框架 等,避免每次系统升级带来的再开发问题。

  android版本管理 :基于支持硬件的分类的android版本通过GMAIL账户自动同步。如HTC HERO的硬件符合规范,则其可以通过GMAIL自动刷到最新版本的ROM,并可以自动安装刷机前的软件,获取联系人等同步信息。GMAIL应该作为云端的账户,能够同步更多东西,这样版本混乱的问题得到解决,民间混乱ROM的问题也就迎刃而解。

  android运营网络问题

  与运营商绑定的机型,不再以加锁ROM的形式出现,而仅仅是销售渠道和收费模式不同。也就是说从运营商那里买的手机,可以获得补贴,但须与运营商签订合同。但是软件和系统仍是统一标准。

  开发者问题

  犹如IPHONE和IPAD,开发者因android的规范制定,而只需为有限的规范开发同一款程序即可。做到API兼容。

  第三方商店问题

  GOOGLE可以完全禁止第三方应用商店,避免混乱。也可以授权第三方商店,第三方必须符合软硬件规范,通过兼容性测试,并向GOOGLE缴纳授权费用。这样以来,第三方的问题从程度上得到了抑制,兼容性和用户体验提高,也使得应用程序总数集中增长,不再分散。

  资源 整合


  GOOGLE完全有实力整合更多的资源进入到android平台,如亚马逊的电子书,索尼的游戏 等等,与其采用合作分成的模式,让大家来把android这个蛋糕做大做强,而不是让游兵散将去和苹果火拼当炮灰。 我相信苹果的强势侵犯到了整个产业链的利益,所到之处,让其他厂商憎恨。虽然消费者是满意的。所以GOOGLE拉拢大家之力,每个都推出精品对抗苹果是不错的选择。

  总结,android平台需要规范化,不能开放到混乱的局面,至少有个开放化规范协议。其次,明确角色分工,发挥各家之长,才能出精品,单打独斗,越俎代庖的不和他玩。不提供支持让它自生自灭。然后是,发挥GOOGLE的优势,云计算, 资源整合入云里面的优势,做到资源丰富,兼容性强。再是,各个角色利益分配问题。 当然最后也是最重要的是,要赢得广泛的消费群体。从低端市场到高端市场,从手机,电子书,到平板电脑。都要有大批的消费者。消费品之间要能够兼容,能够互联互动,物联网,移动互联!!!!


专家认为:

1、Android的混乱是必然。

  所有的混乱来源于秩序的不规范,苹果的井然有序主要是由于乔布斯的强权和产业链的严格规范。Android注定要混乱,因为作为Google来说要的不是秩序,不是规范,要的是手机终端的数量,只要手机终端的数量足够多,那就可以卖出足够多的广告,其自身的核心战略得到了保证。所以秩序和规范是其次的东西,不是Google第一要考虑的,那肯定会出现Android的混乱。

  2、混乱仍然将长时间持续。

  这种混乱可能会长时间持续,主要有几点原因:

  a.Google的战略决定。因为其战略是Android的终端数量。

  b.Google对整个产业链比较无知。Google是个互联网公司,不是通信产业公司。从Nexous One的销售失败上来看,Google对整个产业链的理解并非我们想象的深刻。

  c.Google无法强势。布林和佩奇的骨髓里边充满着对自由和开放向往,充满着对打败强权政治的向往,没有强权政治,就无法设立秩序,这是历史证明的。

  3、不要太对Google抱有太大的幻想。

  上边也分析了对Google的看法,所以我觉得不能对Google抱有太乐观的想法,Google在移动互联网需要积累的东西还比较多,也许只有吃一堑才能长一智。

  4、Android开发者在混乱中求生存。

  对于Android开发者来说,最主要的是要学聪明点,不要做政治和别人尝试的牺牲品。机会很多,但是要睁大眼睛,有自己的辨别力才行。

 

Android permission 权限类中英文说明

分类:Android  来源:网络  时间:2011-3-7 22:42:25

public final class Manifest {

002     public static final class permission {
003         /**  Allows read/write access to the "properties" table in the checkin
004          database, to change values that get uploaded. 
005          */
006         public static final String ACCESS_CHECKIN_PROPERTIES="android.permission.ACCESS_CHECKIN_PROPERTIES";
007         /**  Allows an application to access coarse (e.g., Cell-ID, WiFi) location 
008          */
009         public static final String ACCESS_COARSE_LOCATION="android.permission.ACCESS_COARSE_LOCATION";
010         /**  Allows an application to access fine (e.g., GPS) location 
011          */
012         public static final String ACCESS_FINE_LOCATION="android.permission.ACCESS_FINE_LOCATION";
013         /**  Allows an application to access extra location provider commands 
014          */
015         public static final String ACCESS_LOCATION_EXTRA_COMMANDS="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS";
016         /**  Allows an application to create mock location providers for testing 
017          */
018         public static final String ACCESS_MOCK_LOCATION="android.permission.ACCESS_MOCK_LOCATION";
019         /**  Allows applications to access information about networks 
020          */
021         public static final String ACCESS_NETWORK_STATE="android.permission.ACCESS_NETWORK_STATE";
022         /**  Allows an application to use SurfaceFlinger¹s low level features 
023          */
024         public static final String ACCESS_SURFACE_FLINGER="android.permission.ACCESS_SURFACE_FLINGER";
025         /**  Allows applications to access information about Wi-Fi networks 
026          */
027         public static final String ACCESS_WIFI_STATE="android.permission.ACCESS_WIFI_STATE";
028         /**  Allows an application to publish system-level services.  Such services
029          can only be published from processes that never go away, so this is
030          not something that any normal application can do. 
031          */
032         public static final String ADD_SYSTEM_SERVICE="android.permission.ADD_SYSTEM_SERVICE";
033         /**  Allows an application to update the collected battery statistics 
034          */
035         public static final String BATTERY_STATS="android.permission.BATTERY_STATS";
036         /**  Allows applications to connect to paired bluetooth devices 
037          */
038         public static final String BLUETOOTH="android.permission.BLUETOOTH";
039         /**  Allows applications to discover and pair bluetooth devices 
040          */
041         public static final String BLUETOOTH_ADMIN="android.permission.BLUETOOTH_ADMIN";
042         /**  Required to be able to disable the device (very dangerous!). 
043          */
044         public static final String BRICK="android.permission.BRICK";
045         /**  Allows an application to broadcast a notification that an application
046          package has been removed. 
047          */
048         public static final String BROADCAST_PACKAGE_REMOVED="android.permission.BROADCAST_PACKAGE_REMOVED";
049         /**  Allows an application to broadcast sticky intents.  These are
050          broadcasts whose data is held by the system after being finished,
051          so that clients can quickly retrieve that data without having
052          to wait for the next broadcast. 
053          */
054         public static final String BROADCAST_STICKY="android.permission.BROADCAST_STICKY";
055         /**  Allows an application to initiate a phone call without going through
056          the Dialer user interface for the user to confirm the call
057          being placed. 
058          */
059         public static final String CALL_PHONE="android.permission.CALL_PHONE";
060         /**  Allows an application to call any phone number, including emergency
061          numbers, without going through the Dialer user interface for the user
062          to confirm the call being placed. 
063          */
064         public static final String CALL_PRIVILEGED="android.permission.CALL_PRIVILEGED";
065         /**  Required to be able to access the camera device. 
066          */
067         public static final String CAMERA="android.permission.CAMERA";
068         /**  Allows an application to change whether an application component (other than its own) is
069          enabled or not. 
070          */
071         public static final String CHANGE_COMPONENT_ENABLED_STATE="android.permission.CHANGE_COMPONENT_ENABLED_STATE";
072         /**  Allows an application to modify the current configuration, such
073          as locale. 
074          */
075         public static final String CHANGE_CONFIGURATION="android.permission.CHANGE_CONFIGURATION";
076         /**  Allows applications to change network connectivity state 
077          */
078         public static final String CHANGE_NETWORK_STATE="android.permission.CHANGE_NETWORK_STATE";
079         /**  Allows applications to change Wi-Fi connectivity state 
080          */
081         public static final String CHANGE_WIFI_STATE="android.permission.CHANGE_WIFI_STATE";
082         /**  Allows an application to clear the caches of all installed
083          applications on the device.  
084          */
085         public static final String CLEAR_APP_CACHE="android.permission.CLEAR_APP_CACHE";
086         /**  Allows an application to clear user data 
087          */
088         public static final String CLEAR_APP_USER_DATA="android.permission.CLEAR_APP_USER_DATA";
089         /**  Allows enabling/disabling location update notifications from
090          the radio. Not for use by normal applications. 
091          */
092         public static final String CONTROL_LOCATION_UPDATES="android.permission.CONTROL_LOCATION_UPDATES";
093         /**  Allows an application to delete cache files. 
094          */
095         public static final String DELETE_CACHE_FILES="android.permission.DELETE_CACHE_FILES";
096         /**  Allows an application to delete packages. 
097          */
098         public static final String DELETE_PACKAGES="android.permission.DELETE_PACKAGES";
099         /**  Allows low-level access to power management 
100          */
101         public static final String DEVICE_POWER="android.permission.DEVICE_POWER";
102         /**  Allows applications to RW to diagnostic resources. 
103          */
104         public static final String DIAGNOSTIC="android.permission.DIAGNOSTIC";
105         /**  Allows applications to disable the keyguard 
106          */
107         public static final String DISABLE_KEYGUARD="android.permission.DISABLE_KEYGUARD";
108         /**  Allows an application to retrieve state dump information from system
109          services. 
110          */
111         public static final String DUMP="android.permission.DUMP";
112         /**  Allows an application to expand or collapse the status bar. 
113          */
114         public static final String EXPAND_STATUS_BAR="android.permission.EXPAND_STATUS_BAR";
115         /**  Run as a manufacturer test application, running as the root user.
116          Only available when the device is running in manufacturer test mode. 
117          */
118         public static final String FACTORY_TEST="android.permission.FACTORY_TEST";
119         /**  Allows access to the flashlight 
120          */
121         public static final String FLASHLIGHT="android.permission.FLASHLIGHT";
122         /**  Allows an application to force a BACK operation on whatever is the
123          top activity. 
124          */
125         public static final String FORCE_BACK="android.permission.FORCE_BACK";
126         public static final String FOTA_UPDATE="android.permission.FOTA_UPDATE";
127         /**  Allows access to the list of accounts in the Accounts Service 
128          */
129         public static final String GET_ACCOUNTS="android.permission.GET_ACCOUNTS";
130         /**  Allows an application to find out the space used by any package. 
131          */
132         public static final String GET_PACKAGE_SIZE="android.permission.GET_PACKAGE_SIZE";
133         /**  Allows an application to get information about the currently
134          or recently running tasks: a thumbnail representation of the tasks,
135          what activities are running in it, etc. 
136          */
137         public static final String GET_TASKS="android.permission.GET_TASKS";
138         /**  Allows access to hardware peripherals.  Intended only for hardware testing 
139          */
140         public static final String HARDWARE_TEST="android.permission.HARDWARE_TEST";
141         /**  Allows an application to inject user events (keys, touch, trackball)
142          into the event stream and deliver them to ANY window.  Without this
143          permission, you can only deliver events to windows in your own process.
144          Very few applications should need to use this permission. 
145          */
146         public static final String INJECT_EVENTS="android.permission.INJECT_EVENTS";
147         /**  Allows an application to install packages. 
148          */
149         public static final String INSTALL_PACKAGES="android.permission.INSTALL_PACKAGES";
150         /**  Allows an application to open windows that are for use by parts
151          of the system user interface.  Not for use by third party apps. 
152          */
153         public static final String INTERNAL_SYSTEM_WINDOW="android.permission.INTERNAL_SYSTEM_WINDOW";
154         /**  Allows applications to open network sockets. 
155          */
156         public static final String INTERNET="android.permission.INTERNET";
157         /**  Allows an application to manage (create, destroy,
158          Z-order) application tokens in the window manager.  This is only
159          for use by the system. 
160          */
161         public static final String MANAGE_APP_TOKENS="android.permission.MANAGE_APP_TOKENS";
162         public static final String MASTER_CLEAR="android.permission.MASTER_CLEAR";
163         /**  Allows an application to modify global audio settings 
164          */
165         public static final String MODIFY_AUDIO_SETTINGS="android.permission.MODIFY_AUDIO_SETTINGS";
166         /**  Allows modification of the telephony state - power on, mmi, etc.
167          Does not include placing calls. 
168          */
169         public static final String MODIFY_PHONE_STATE="android.permission.MODIFY_PHONE_STATE";
170         /**  Allows mounting and unmounting file systems for removable storage. 
171          */
172         public static final String MOUNT_UNMOUNT_FILESYSTEMS="android.permission.MOUNT_UNMOUNT_FILESYSTEMS";
173         /**  Allow an application to make its activities persistent. 
174          */
175         public static final String PERSISTENT_ACTIVITY="android.permission.PERSISTENT_ACTIVITY";
176         /**  Allows an application to monitor, modify, or abort outgoing
177          calls. 
178          */
179         public static final String PROCESS_OUTGOING_CALLS="android.permission.PROCESS_OUTGOING_CALLS";
180         /**  Allows an application to read the user¹s calendar data. 
181          */
182         public static final String READ_CALENDAR="android.permission.READ_CALENDAR";
183         /**  Allows an application to read the user¹s contacts data. 
184          */
185         public static final String READ_CONTACTS="android.permission.READ_CONTACTS";
186         /**  Allows an application to take screen shots and more generally
187          get access to the frame buffer data 
188          */
189         public static final String READ_FRAME_BUFFER="android.permission.READ_FRAME_BUFFER";
190         /**  Allows an application to retrieve the current state of keys and
191          switches.  This is only for use by the system.
192          */
193         public static final String READ_INPUT_STATE="android.permission.READ_INPUT_STATE";
194         /**  Allows an application to read the low-level system log files.
195          These can contain slightly private information about what is
196          happening on the device, but should never contain the user¹s
197          private information. 
198          */
199         public static final String READ_LOGS="android.permission.READ_LOGS";
200         /**  Allows an application to read the owner¹s data. 
201          */
202         public static final String READ_OWNER_DATA="android.permission.READ_OWNER_DATA";
203         /**  Allows read only access to phone state. 
204          */
205         public static final String READ_PHONE_STATE="android.permission.READ_PHONE_STATE";
206         /**  Allows an application to read SMS messages. 
207          */
208         public static final String READ_SMS="android.permission.READ_SMS";
209         /**  Allows applications to read the sync settings 
210          */
211         public static final String READ_SYNC_SETTINGS="android.permission.READ_SYNC_SETTINGS";
212         /**  Allows applications to read the sync stats 
213          */
214         public static final String READ_SYNC_STATS="android.permission.READ_SYNC_STATS";
215         /**  Required to be able to reboot the device. 
216          */
217         public static final String REBOOT="android.permission.REBOOT";
218         /**  Allows an application to receive the
219          {@link android.content.Intent#ACTION_BOOT_COMPLETED} that is
220          broadcast after the system finishes booting.  If you don¹t
221          request this permission, you will not receive the broadcast at
222          that time.  Though holding this permission does not have any
223          security implications, it can have a negative impact on the
224          user experience by increasing the amount of time it takes the
225          system to start and allowing applications to have themselves
226          running without the user being aware of them.  As such, you must
227          explicitly declare your use of this facility to make that visible
228          to the user. 
229          */
230         public static final String RECEIVE_BOOT_COMPLETED="android.permission.RECEIVE_BOOT_COMPLETED";
231         /**  Allows an application to monitor incoming MMS messages, to record
232          or perform processing on them. 
233          */
234         public static final String RECEIVE_MMS="android.permission.RECEIVE_MMS";
235         /**  Allows an application to monitor incoming SMS messages, to record
236          or perform processing on them. 
237          */
238         public static final String RECEIVE_SMS="android.permission.RECEIVE_SMS";
239         /**  Allows an application to monitor incoming WAP push messages. 
240          */
241         public static final String RECEIVE_WAP_PUSH="android.permission.RECEIVE_WAP_PUSH";
242         /**  Allows an application to record audio 
243          */
244         public static final String RECORD_AUDIO="android.permission.RECORD_AUDIO";
245         /**  Allows an application to change the Z-order of tasks 
246          */
247         public static final String REORDER_TASKS="android.permission.REORDER_TASKS";
248         /**  Allows an application to restart other applications. 
249          */
250         public static final String RESTART_PACKAGES="android.permission.RESTART_PACKAGES";
251         /**  Allows an application to send SMS messages. 
252          */
253         public static final String SEND_SMS="android.permission.SEND_SMS";
254         /**  Allows an application to watch and control how activities are
255          started globally in the system.  Only for is in debugging
256          (usually the monkey command). 
257          */
258         public static final String SET_ACTIVITY_WATCHER="android.permission.SET_ACTIVITY_WATCHER";
259         /**  Allows an application to control whether activities are immediately
260          finished when put in the background. 
261          */
262         public static final String SET_ALWAYS_FINISH="android.permission.SET_ALWAYS_FINISH";
263         /**  Modify the global animation scaling factor. 
264          */
265         public static final String SET_ANIMATION_SCALE="android.permission.SET_ANIMATION_SCALE";
266         /**  Configure an application for debugging. 
267          */
268         public static final String SET_DEBUG_APP="android.permission.SET_DEBUG_APP";
269         /**  Allows low-level access to setting the orientation (actually
270          rotation) of the screen.  Not for use by normal applications. 
271          */
272         public static final String SET_ORIENTATION="android.permission.SET_ORIENTATION";
273         /**  Allows an application to modify the list of preferred applications
274          with the {@link android.content.pm.PackageManager#addPackageToPreferred
275          PackageManager.addPackageToPreferred()} and
276          {@link android.content.pm.PackageManager#removePackageFromPreferred
277          PackageManager.removePackageFromPreferred()} methods. 
278          */
279         public static final String SET_PREFERRED_APPLICATIONS="android.permission.SET_PREFERRED_APPLICATIONS";
280         /**  Allows an application to force any currently running process to be
281          in the foreground. 
282          */
283         public static final String SET_PROCESS_FOREGROUND="android.permission.SET_PROCESS_FOREGROUND";
284         /**  Allows an application to set the maximum number of (not needed)
285          application processes that can be running. 
286          */
287         public static final String SET_PROCESS_LIMIT="android.permission.SET_PROCESS_LIMIT";
288         /**  Allows applications to set the system time zone 
289          */
290         public static final String SET_TIME_ZONE="android.permission.SET_TIME_ZONE";
291         /**  Allows applications to set the wallpaper 
292          */
293         public static final String SET_WALLPAPER="android.permission.SET_WALLPAPER";
294         /**  Allows applications to set the wallpaper hints 
295          */
296         public static final String SET_WALLPAPER_HINTS="android.permission.SET_WALLPAPER_HINTS";
297         /**  Allow an application to request that a signal be sent to all persistent processes 
298          */
299         public static final String SIGNAL_PERSISTENT_PROCESSES="android.permission.SIGNAL_PERSISTENT_PROCESSES";
300         /**  Allows an application to open, close, or disable the status bar
301          and its icons. 
302          */
303         public static final String STATUS_BAR="android.permission.STATUS_BAR";
304         /**  Allows an application to allow access the subscribed feeds 
305          ContentProvider. 
306          */
307         public static final String SUBSCRIBED_FEEDS_READ="android.permission.SUBSCRIBED_FEEDS_READ";
308         public static final String SUBSCRIBED_FEEDS_WRITE="android.permission.SUBSCRIBED_FEEDS_WRITE";
309         /**  Allows an application to open windows using the type
310          {@link android.view.WindowManager.LayoutParams#TYPE_SYSTEM_ALERT},
311          shown on top of all other applications.  Very few applications
312          should use this permission; these windows are intended for
313          system-level interaction with the user. 
314          */
315         public static final String SYSTEM_ALERT_WINDOW="android.permission.SYSTEM_ALERT_WINDOW";
316         /**  Allows access to the vibrator 
317          */
318         public static final String VIBRATE="android.permission.VIBRATE";
319         /**  Allows using PowerManager WakeLocks to keep processor from sleeping or screen
320          from dimming 
321          */
322         public static final String WAKE_LOCK="android.permission.WAKE_LOCK";
323         /**  Allows applications to write the apn settings 
324          */
325         public static final String WRITE_APN_SETTINGS="android.permission.WRITE_APN_SETTINGS";
326         /**  Allows an application to write (but not read) the user¹s
327          calendar data. 
328          */
329         public static final String WRITE_CALENDAR="android.permission.WRITE_CALENDAR";
330         /**  Allows an application to write (but not read) the user¹s
331          contacts data. 
332          */
333         public static final String WRITE_CONTACTS="android.permission.WRITE_CONTACTS";
334         /**  Allows an application to modify the Google service map. 
335          */
336         public static final String WRITE_GSERVICES="android.permission.WRITE_GSERVICES";
337         /**  Allows an application to write (but not read) the owner¹s data. 
338          */
339         public static final String WRITE_OWNER_DATA="android.permission.WRITE_OWNER_DATA";
340         /**  Allows an application to read or write the system settings. 
341          */
342         public static final String WRITE_SETTINGS="android.permission.WRITE_SETTINGS";
343         /**  Allows an application to write SMS messages. 
344          */
345         public static final String WRITE_SMS="android.permission.WRITE_SMS";
346         /**  Allows applications to write the sync settings 
347          */
348         public static final String WRITE_SYNC_SETTINGS="android.permission.WRITE_SYNC_SETTINGS";
349     }
350     public static final class permission_group {
351         /**  Permissions for direct access to Google accounts.
352          Note that while right now this is only used for Google accounts,
353          we expect in the future to have a more general account management
354          facility so this is specified as a general platform permission
355          group for accessing accounts. 
356          */
357         public static final String ACCOUNTS="android.permission-group.ACCOUNTS";
358         /**  Used for permissions that can be used to make the user spend money
359          without their direct involvement.  For example, this is the group
360          for permissions that allow you to directly place phone calls,
361          directly send SMS messages, etc. 
362          */
363         public static final String COST_MONEY="android.permission-group.COST_MONEY";
364         /**  Group of permissions that are related to development features.  These
365          are not permissions that should appear in normal applications; they
366          protect APIs that are intended only to be used for development
367          purposes. 
368          */
369         public static final String DEVELOPMENT_TOOLS="android.permission-group.DEVELOPMENT_TOOLS";
370         /**  Used for permissions that provide direct access to the hardware on
371          the device.  This includes audio, the camera, vibrator, etc. 
372          */
373         public static final String HARDWARE_CONTROLS="android.permission-group.HARDWARE_CONTROLS";
374         /**  Used for permissions that allow access to the user¹s current
375          location. 
376          */
377         public static final String LOCATION="android.permission-group.LOCATION";
378         /**  Used for permissions that allow an application to send messages
379          on behalf of the user or intercept messages being received by the
380          user.  This is primarily intended for SMS/MMS messaging, such as
381          receiving or reading an MMS. 
382          */
383         public static final String MESSAGES="android.permission-group.MESSAGES";
384         /**  Used for permissions that provide access to networking services.  The
385          main permission here is internet access, but this is also an
386          appropriate group for accessing or modifying any network configuration
387          or other related network operations. 
388          */
389         public static final String NETWORK="android.permission-group.NETWORK";
390         /**  Used for permissions that provide access to the user¹s private data,
391          such as contacts, calendar events, e-mail messages, etc.  This includes
392          both reading and writing of this data (which should generally be
393          expressed as two distinct permissions). 
394          */
395         public static final String PERSONAL_INFO="android.permission-group.PERSONAL_INFO";
396         /**  Used for permissions that are associated with accessing and modifyign
397          telephony state: intercepting outgoing calls, reading
398          and modifying the phone state.  Note that
399          placing phone calls is not in this group, since that is in the
400          more important "takin¹ yer moneys" group. 
401          */
402         public static final String PHONE_CALLS="android.permission-group.PHONE_CALLS";
403         /**  Group of permissions that are related to system APIs.  Many
404          of these are not permissions the user will be expected to understand,
405          and such permissions should generally be marked as "normal" protection
406          level so they don¹t get displayed.  This can also, however, be used
407          for miscellaneous features that provide access to the operating system,
408          such as writing the global system settings. 
409          */
410         public static final String SYSTEM_TOOLS="android.permission-group.SYSTEM_TOOLS";
411     }
412 }

中文翻译:


程序执行需要读取到安全敏感项必需在androidmanifest.xml中声明相关权限请求, 完整列表如下:

android.permission.ACCESS_CHECKIN_PROPERTIES
允许读写访问”properties”表在checkin数据库中,改值可以修改上传( Allows read/write access to the “properties” table in the checkin database, to change values that get uploaded)

android.permission.ACCESS_COARSE_LOCATION
允许一个程序访问CellID或WiFi热点来获取粗略的位置(Allows an application to access coarse (e.g., Cell-ID, WiFi) location)

android.permission.ACCESS_FINE_LOCATION
允许一个程序访问精良位置(如GPS) (Allows an application to access fine (e.g., GPS) location)

android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
允许应用程序访问额外的位置提供命令(Allows an application to access extra location provider commands)

android.permission.ACCESS_MOCK_LOCATION
允许程序创建模拟位置提供用于测试(Allows an application to create mock location providers for testing)

android.permission.ACCESS_NETWORK_STATE
允许程序访问有关GSM网络信息(Allows applications to access information about networks)

android.permission.ACCESS_SURFACE_FLINGER
允许程序使用SurfaceFlinger底层特性(Allows an application to use SurfaceFlinger’s low level features)

android.permission.ACCESS_WIFI_STATE
允许程序访问Wi-Fi网络状态信息(Allows applications to access information about Wi-Fi networks)

android.permission.ADD_SYSTEM_SERVICE
允许程序发布系统级服务(Allows an application to publish system-level services).

android.permission.BATTERY_STATS
允许程序更新手机电池统计信息(Allows an application to update the collected battery statistics)

android.permission.BLUETOOTH
允许程序连接到已配对的蓝牙设备(Allows applications to connect to paired bluetooth devices)

android.permission.BLUETOOTH_ADMIN
允许程序发现和配对蓝牙设备(Allows applications to discover and pair bluetooth devices)

android.permission.BRICK
请求能够禁用设备(非常危险)(Required to be able to disable the device (very *erous!).)

android.permission.BROADCAST_PACKAGE_REMOVED
允许程序广播一个提示消息在一个应用程序包已经移除后(Allows an application to broadcast a notification that an application package has been removed)

android.permission.BROADCAST_STICKY
允许一个程序广播常用intents(Allows an application to broadcast sticky intents)

android.permission.CALL_PHONE
允许一个程序初始化一个电话拨号不需通过拨号用户界面需要用户确认(Allows an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call being placed.)

android.permission.CALL_PRIVILEGED
允许一个程序拨打任何号码,包含紧急号码无需通过拨号用户界面需要用户确认(Allows an application to call any phone number, including emergency numbers, without going through the Dialer user interface for the user to confirm the call being placed)

android.permission.CAMERA
请求访问使用照相设备(Required to be able to access the camera device. )

android.permission.CHANGE_COMPONENT_ENABLED_STATE
允许一个程序是否改变一个组件或其他的启用或禁用(Allows an application to change whether an application component (other than its own) is enabled or not. )

android.permission.CHANGE_CONFIGURATION
允许一个程序修改当前设置,如本地化(Allows an application to modify the current configuration, such as locale. )

android.permission.CHANGE_NETWORK_STATE
允许程序改变网络连接状态(Allows applications to change network connectivity state)

android.permission.CHANGE_WIFI_STATE
允许程序改变Wi-Fi连接状态(Allows applications to change Wi-Fi connectivity state)

android.permission.CLEAR_APP_CACHE
允许一个程序清楚缓存从所有安装的程序在设备中(Allows an application to clear the caches of all installed applications on the device. )

android.permission.CLEAR_APP_USER_DATA
允许一个程序清除用户设置(Allows an application to clear user data)

android.permission.CONTROL_LOCATION_UPDATES
允许启用禁止位置更新提示从无线模块(Allows enabling/disabling location update notifications from the radio. )

android.permission.DELETE_CACHE_FILES
允许程序删除缓存文件(Allows an application to delete cache files)

android.permission.DELETE_PACKAGES
允许一个程序删除包(Allows an application to delete packages)

android.permission.DEVICE_POWER
允许访问底层电源管理(Allows low-level access to power management)

android.permission.DIAGNOSTIC
允许程序RW诊断资源(Allows applications to RW to diagnostic resources. )

android.permission.DISABLE_KEYGUARD
允许程序禁用键盘锁(Allows applications to disable the keyguard )

android.permission.DUMP
允许程序返回状态抓取信息从系统服务(Allows an application to retrieve state dump information from system services.)

android.permission.EXPAND_STATUS_BAR
允许一个程序扩展收缩在状态栏,android开发网提示应该是一个类似windows mobile中的托盘程序(Allows an application to expand or collapse the status bar. )

android.permission.FACTORY_TEST
作为一个工厂测试程序,运行在root用户(Run as a manufacturer test application, running as the root user. )

android.permission.FLASHLIGHT
访问闪光灯,android开发网提示htc Dream不包含闪光灯(Allows access to the flashlight )

android.permission.FORCE_BACK
允许程序强行一个后退操作是否在顶层activities(Allows an application to force a BACK operation on whatever is the top activity. )

android.permission.FOTA_UPDATE
暂时不了解这是做什么使用的,android开发网分析可能是一个预留权限.

android.permission.GET_ACCOUNTS
访问一个帐户列表在Accounts Service中(Allows access to the list of accounts in the Accounts Service)

android.permission.GET_PACKAGE_SIZE
允许一个程序获取任何package占用空间容量(Allows an application to find out the space used by any package. )

android.permission.GET_TASKS
允许一个程序获取信息有关当前或最近运行的任务,一个缩略的任务状态,是否活动等等(Allows an application to get information about the currently or recently running tasks: a thumbnail representation of the tasks, what activities are running in it, etc.)

android.permission.HARDWARE_TEST
允许访问硬件(Allows access to hardware peripherals. )

android.permission.INJECT_EVENTS
允许一个程序截获用户事件如按键、触摸、轨迹球等等到一个时间流,android 开发网提醒算是hook技术吧(Allows an application to inject user events (keys, touch, trackball) into the event stream and deliver them to ANY window.)

android.permission.INSTALL_PACKAGES
允许一个程序安装packages(Allows an application to install packages. )

android.permission.INTERNAL_SYSTEM_WINDOW
允许打开窗口使用系统用户界面(Allows an application to open windows that are for use by parts of the system user interface. )

android.permission.INTERNET
允许程序打开网络套接字(Allows applications to open network sockets)

android.permission.MANAGE_APP_TOKENS
允许程序管理(创建、催后、 z- order默认向z轴推移)程序引用在窗口管理器中(Allows an application to manage (create, destroy, Z-order) application tokens in the window manager. )

android.permission.MASTER_CLEAR目前还没有明确的解释,android开发网分析可能是清除一切数据,类似硬格机

android.permission.MODIFY_AUDIO_SETTINGS
允许程序修改全局音频设置(Allows an application to modify global audio settings)

android.permission.MODIFY_PHONE_STATE
允许修改话机状态,如电源,人机接口等(Allows modification of the telephony state – power on, mmi, etc. )

android.permission.MOUNT_UNMOUNT_FILESYSTEMS
允许挂载和反挂载文件系统可移动存储(Allows mounting and unmounting file systems for removable storage. )

android.permission.PERSISTENT_ACTIVITY
允许一个程序设置他的activities显示(Allow an application to make its activities persistent. )

android.permission.PROCESS_OUTGOING_CALLS
允许程序监视、修改有关播出电话(Allows an application to monitor, modify, or abort outgoing calls)

android.permission.READ_CALENDAR
允许程序读取用户日历数据(Allows an application to read the user’s calendar data.)

android.permission.READ_CONTACTS
允许程序读取用户联系人数据(Allows an application to read the user’s contacts data.)

android.permission.READ_FRAME_BUFFER
允许程序屏幕波或和更多常规的访问帧缓冲数据(Allows an application to take screen shots and more generally get access to the frame buffer data)

android.permission.READ_INPUT_STATE
允许程序返回当前按键状态(Allows an application to retrieve the current state of keys and switches. )

android.permission.READ_LOGS
允许程序读取底层系统日志文件(Allows an application to read the low-level system log files. )

android.permission.READ_OWNER_DATA
允许程序读取所有者数据(Allows an application to read the owner’s data)

android.permission.READ_SMS
允许程序读取短信息(Allows an application to read SMS messages.)

android.permission.READ_SYNC_SETTINGS
允许程序读取同步设置(Allows applications to read the sync settings)

android.permission.READ_SYNC_STATS
允许程序读取同步状态(Allows applications to read the sync stats)

android.permission.REBOOT
请求能够重新启动设备(Required to be able to reboot the device. )

android.permission.RECEIVE_BOOT_COMPLETED
允许一个程序接收到 ACTION_BOOT_COMPLETED广播在系统完成启动(Allows an application to receive the ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting. )

android.permission.RECEIVE_MMS
允许一个程序监控将收到MMS彩信,记录或处理(Allows an application to monitor incoming MMS messages, to record or perform processing on them. )

android.permission.RECEIVE_SMS
允许程序监控一个将收到短信息,记录或处理(Allows an application to monitor incoming SMS messages, to record or perform processing on them.)

android.permission.RECEIVE_WAP_PUSH
允许程序监控将收到WAP PUSH信息(Allows an application to monitor incoming WAP push messages. )

android.permission.RECORD_AUDIO
允许程序录制音频(Allows an application to record audio)

android.permission.REORDER_TASKS
允许程序改变Z轴排列任务(Allows an application to change the Z-order of tasks)

android.permission.RESTART_PACKAGES
允许程序重新启动其他程序(Allows an application to restart other applications)

android.permission.SEND_SMS
允许程序发送SMS短信(Allows an application to send SMS messages)

android.permission.SET_ACTIVITY_WATCHER
允许程序监控或控制activities已经启动全局系统中Allows an application to watch and control how activities are started globally in the system.

android.permission.SET_ALWAYS_FINISH
允许程序控制是否活动间接完成在处于后台时Allows an application to control whether activities are immediately finished when put in the background.

android.permission.SET_ANIMATION_SCALE
修改全局信息比例(Modify the global animation scaling factor.)

android.permission.SET_DEBUG_APP
配置一个程序用于调试(Configure an application for debugging.)

android.permission.SET_ORIENTATION
允许底层访问设置屏幕方向和实际旋转(Allows low-level access to setting the orientation (actually rotation) of the screen.)

android.permission.SET_PREFERRED_APPLICATIONS
允许一个程序修改列表参数PackageManager.addPackageToPreferred() 和PackageManager.removePackageFromPreferred()方法(Allows an application to modify the list of preferred applications with the PackageManager.addPackageToPreferred() and PackageManager.removePackageFromPreferred() methods.)

android.permission.SET_PROCESS_FOREGROUND
允许程序当前运行程序强行到前台(Allows an application to force any currently running process to be in the foreground.)

android.permission.SET_PROCESS_LIMIT
允许设置最大的运行进程数量(Allows an application to set the maximum number of (not needed) application processes that can be running. )

android.permission.SET_TIME_ZONE
允许程序设置时间区域(Allows applications to set the system time zone)

android.permission.SET_WALLPAPER
允许程序设置壁纸(Allows applications to set the wallpaper )

android.permission.SET_WALLPAPER_HINTS
允许程序设置壁纸hits(Allows applications to set the wallpaper hints)

android.permission.SIGNAL_PERSISTENT_PROCESSES
允许程序请求发送信号到所有显示的进程中(Allow an application to request that a signal be sent to all persistent processes)

android.permission.STATUS_BAR
允许程序打开、关闭或禁用状态栏及图标Allows an application to open, close, or disable the status bar and its icons.

android.permission.SUBSCRIBED_FEEDS_READ
允许一个程序访问订阅RSS Feed内容提供(Allows an application to allow access the subscribed feeds ContentProvider. )

android.permission.SUBSCRIBED_FEEDS_WRITE
系统暂时保留改设置,android开发网认为未来版本会加入该功能。

android.permission.SYSTEM_ALERT_WINDOW
允许一个程序打开窗口使用 TYPE_SYSTEM_ALERT,显示在其他所有程序的顶层(Allows an application to open windows using the type TYPE_SYSTEM_ALERT, shown on top of all other applications. )

android.permission.VIBRATE
允许访问振动设备(Allows access to the vibrator)

android.permission.WAKE_LOCK
允许使用PowerManager的 WakeLocks保持进程在休眠时从屏幕消失( Allows using PowerManager WakeLocks to keep processor from sleeping or screen from dimming)

android.permission.WRITE_APN_SETTINGS
允许程序写入API设置(Allows applications to write the apn settings)

android.permission.WRITE_CALENDAR
允许一个程序写入但不读取用户日历数据(Allows an application to write (but not read) the user’s calendar data. )

android.permission.WRITE_CONTACTS
允许程序写入但不读取用户联系人数据(Allows an application to write (but not read) the user’s contacts data. )

android.permission.WRITE_GSERVICES
允许程序修改Google服务地图(Allows an application to modify the Google service map. )

android.permission.WRITE_OWNER_DATA
允许一个程序写入但不读取所有者数据(Allows an application to write (but not read) the owner’s data.)

android.permission.WRITE_SETTINGS
 允许程序读取或写入系统设置(Allows an application to read or write the system settings. )

 android.permission.WRITE_SMS
 允许程序写短信(Allows an application to write SMS messages)

 android.permission.WRITE_SYNC_SETTINGS
 允许程序写入同步设置(Allows applications to write the sync settings)

Android动画编程

分类:Android  来源:网络  时间:2011-3-7 22:37:34

本文出自http://wangstar.javaeye.com/blog/409115,感觉基础知识归纳得不错,就COPY下来方便查找。

   

动画效果编程基础--Android Animation
   
动画类型
   
Android的animation由四种类型组成
XML中
alpha
渐变透明度动画效果
scale
渐变尺寸伸缩动画效果
translate
画面转换位置移动动画效果
rotate
画面旋转动画效果
   
JavaCode中
AlphaAnimation
渐变透明度动画效果
ScaleAnimation
渐变尺寸伸缩动画效果
TranslateAnimation
画面转换位置移动动画效果
RotateAnimation
画面旋转动画效果
   
Android动画模式
Animation主要有两种动画模式:
   
一种是tweened animation(渐变动画)
XML中
JavaCode
alpha
AlphaAnimation
scale
ScaleAnimation
         
一种是frame by frame(画面转换动画)
XML中
JavaCode
translate
TranslateAnimation
rotate
RotateAnimation
      
如何在XML文件中定义动画
        
① 打开Eclipse,新建Android工程
② 在res目录中新建anim文件夹
③ 在anim目录中新建一个myanim.xml(注意文件名小写)
④ 加入XML的动画代码
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
  <alpha/>
  <scale/>
  <translate/>
  <rotate/>
</set>
复制代码
    
Android动画解析--XML
     
<alpha>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<alpha
android:fromAlpha="0.1"
android:toAlpha="1.0"
android:duration="3000" />
<!-- 透明度控制动画效果 alpha
        浮点型值:
            fromAlpha 属性为动画起始时透明度
            toAlpha   属性为动画结束时透明度
            说明:
                0.0表示完全透明
                1.0表示完全不透明
            以上值取0.0-1.0之间的float数据类型的数字
       
        长整型值:
            duration  属性为动画持续时间
            说明:    
                时间以毫秒为单位
-->
</set>
复制代码
          
<scale>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
   <scale 
          android:interpolator=
                     "@android:anim/accelerate_decelerate_interpolator"
          android:fromXScale="0.0"
          android:toXScale="1.4"
          android:fromYScale="0.0"
          android:toYScale="1.4"
          android:pivotX="50%"
          android:pivotY="50%"
          android:fillAfter="false"
          android:startOffset=“700”
          android:duration="700" />
</set>
<!-- 尺寸伸缩动画效果 scale
       属性:interpolator 指定一个动画的插入器 
       在我试验过程中,使用android.res.anim中的资源时候发现 
       有三种动画插入器:
            accelerate_decelerate_interpolator  加速-减速 动画插入器
            accelerate_interpolator        加速-动画插入器
            decelerate_interpolator        减速- 动画插入器
        其他的属于特定的动画效果
        浮点型值:
           
            fromXScale 属性为动画起始时 X坐标上的伸缩尺寸   
            toXScale   属性为动画结束时 X坐标上的伸缩尺寸    
        
            fromYScale 属性为动画起始时Y坐标上的伸缩尺寸   
            toYScale   属性为动画结束时Y坐标上的伸缩尺寸  
            startOffset  属性为从上次动画停多少时间开始执行下个动画
       
            说明:
                 以上四种属性值   
   
                    0.0表示收缩到没有
                    1.0表示正常无伸缩    
                    值小于1.0表示收缩 
                    值大于1.0表示放大
       
            pivotX     属性为动画相对于物件的X坐标的开始位置
            pivotY     属性为动画相对于物件的Y坐标的开始位置
       
            说明:
                    以上两个属性值 从0%-100%中取值
                    50%为物件的X或Y方向坐标上的中点位置
       
        长整型值:
            duration  属性为动画持续时间
            说明:   时间以毫秒为单位
  
        布尔型值:
            fillAfter 属性 当设置为true ,该动画转化在动画结束后被应用
-->
复制代码

   
<translate>
  
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="30"
android:toXDelta="-80"
android:fromYDelta="30"
android:toYDelta="300"
android:duration="2000"
/>
<!-- translate 位置转移动画效果
        整型值:
            fromXDelta 属性为动画起始时 X坐标上的位置   
            toXDelta   属性为动画结束时 X坐标上的位置
            fromYDelta 属性为动画起始时 Y坐标上的位置
            toYDelta   属性为动画结束时 Y坐标上的位置
            注意:
                     没有指定fromXType toXType fromYType toYType 时候,
                     默认是以自己为相对参照物            
        长整型值:
            duration  属性为动画持续时间
            说明:   时间以毫秒为单位
-->
</set>
复制代码

<rotate>

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate
        android:interpolator="@android:anim/accelerate_decelerate_interpolator"
        android:fromDegrees="0"
        android:toDegrees="+350"        
        android:pivotX="50%"
        android:pivotY="50%"    
        android:duration="3000" /> 
<!-- rotate 旋转动画效果
       属性:interpolator 指定一个动画的插入器
             在我试验过程中,使用android.res.anim中的资源时候发现
             有三种动画插入器:
                accelerate_decelerate_interpolator   加速-减速 动画插入器
                accelerate_interpolator               加速-动画插入器
                decelerate_interpolator               减速- 动画插入器
             其他的属于特定的动画效果
                          
       浮点数型值:
            fromDegrees 属性为动画起始时物件的角度   
            toDegrees   属性为动画结束时物件旋转的角度 可以大于360度  
       
            说明:
                     当角度为负数——表示逆时针旋转
                     当角度为正数——表示顺时针旋转             
                     (负数from——to正数:顺时针旋转)  
                     (负数from——to负数:逆时针旋转)
                     (正数from——to正数:顺时针旋转)
                     (正数from——to负数:逆时针旋转)      
     
            pivotX     属性为动画相对于物件的X坐标的开始位置
            pivotY     属性为动画相对于物件的Y坐标的开始位置
                  
            说明:        以上两个属性值 从0%-100%中取值
                         50%为物件的X或Y方向坐标上的中点位置
 
        长整型值:
            duration  属性为动画持续时间
            说明:       时间以毫秒为单位
-->
</set>
复制代码

    
如何使用XML中的动画效果
public static Animation loadAnimation (Context context, int id)
//第一个参数Context为程序的上下文   
//第二个参数id为动画XML文件的引用
//例子:
myAnimation= AnimationUtils.loadAnimation(this,R.anim.my_action);
//使用AnimationUtils类的静态方法loadAnimation()来加载XML中的动画XML文件
复制代码


如何在Java代码中定义动画
//在代码中定义 动画实例对象
private Animation myAnimation_Alpha;
private Animation myAnimation_Scale;
private Animation myAnimation_Translate;
private Animation myAnimation_Rotate; 
    
//根据各自的构造方法来初始化一个实例对象
myAnimation_Alpha=new AlphaAnimation(0.1f, 1.0f);
   
myAnimation_Scale =new ScaleAnimation(0.0f, 1.4f, 0.0f, 1.4f,
    Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
   
myAnimation_Translate=new TranslateAnimation(30.0f, -80.0f, 30.0f, 300.0f);
  
myAnimation_Rotate=new RotateAnimation(0.0f, +350.0f,
               Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF, 0.5f);
复制代码

  
Android动画解析--JavaCode
  

AlphaAnimation
  
① AlphaAnimation类对象定义
private AlphaAnimation myAnimation_Alpha;
复制代码
② AlphaAnimation类对象构造
AlphaAnimation(float fromAlpha, float toAlpha)
//第一个参数fromAlpha为 动画开始时候透明度
//第二个参数toAlpha为 动画结束时候透明度
myAnimation_Alpha=new AlphaAnimation(0.1f, 1.0f);
//说明:
//                0.0表示完全透明
//                1.0表示完全不透明
复制代码
③ 设置动画持续时间
myAnimation_Alpha.setDuration(5000);
//设置时间持续时间为 5000毫秒
复制代码

   
   
ScaleAnimation
  
① ScaleAnimation类对象定义
private AlphaAnimation myAnimation_Alpha;
复制代码
② ScaleAnimation类对象构造
ScaleAnimation(float fromX, float toX, float fromY, float toY,
           int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
//第一个参数fromX为动画起始时 X坐标上的伸缩尺寸   
//第二个参数toX为动画结束时 X坐标上的伸缩尺寸    
//第三个参数fromY为动画起始时Y坐标上的伸缩尺寸   
//第四个参数toY为动画结束时Y坐标上的伸缩尺寸 
/*说明:
                    以上四种属性值   
                    0.0表示收缩到没有
                    1.0表示正常无伸缩    
                    值小于1.0表示收缩 
                    值大于1.0表示放大
*/
//第五个参数pivotXType为动画在X轴相对于物件位置类型 
//第六个参数pivotXValue为动画相对于物件的X坐标的开始位置
//第七个参数pivotXType为动画在Y轴相对于物件位置类型  
//第八个参数pivotYValue为动画相对于物件的Y坐标的开始位置
myAnimation_Scale =new ScaleAnimation(0.0f, 1.4f, 0.0f, 1.4f,
             Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
复制代码
③ 设置动画持续时间
myAnimation_Scale.setDuration(700);
//设置时间持续时间为 700毫秒
复制代码
  
TranslateAnimation
 
     
① TranslateAnimation类对象定义
private AlphaAnimation myAnimation_Alpha;
复制代码
② TranslateAnimation类对象构造
TranslateAnimation(float fromXDelta, float toXDelta,
                       float fromYDelta, float toYDelta)
//第一个参数fromXDelta为动画起始时 X坐标上的移动位置   
//第二个参数toXDelta为动画结束时 X坐标上的移动位置     
//第三个参数fromYDelta为动画起始时Y坐标上的移动位置    
//第四个参数toYDelta为动画结束时Y坐标上的移动位置
复制代码
③ 设置动画持续时间
myAnimation_Translate.setDuration(2000);
//设置时间持续时间为 2000毫秒
复制代码
 
 
RotateAnimation
① RotateAnimation类对象定义
private AlphaAnimation myAnimation_Alpha;
复制代码
  
② RotateAnimation类对象构造
RotateAnimation(float fromDegrees, float toDegrees,
            int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
//第一个参数fromDegrees为动画起始时的旋转角度   
//第二个参数toDegrees为动画旋转到的角度  
//第三个参数pivotXType为动画在X轴相对于物件位置类型 
//第四个参数pivotXValue为动画相对于物件的X坐标的开始位置
//第五个参数pivotXType为动画在Y轴相对于物件位置类型  
//第六个参数pivotYValue为动画相对于物件的Y坐标的开始位置
myAnimation_Rotate=new RotateAnimation(0.0f, +350.0f,
               Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF, 0.5f);
复制代码
  
③ 设置动画持续时间
myAnimation_Rotate.setDuration(3000);
//设置时间持续时间为 3000毫秒
复制代码
   
 
如何使用Java代码中的动画效果

使用从View父类继承过来的方法startAnimation()来为View或是子类View等等添加一个动画效果