青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

大龍的博客

常用鏈接

統(tǒng)計(jì)

最新評論

Zipalign: an Easy Optimization --- 轉(zhuǎn)

The Android SDK includes a tool called zipalign that optimizes the way an application is packaged. Running zipalign against your application enables Android to interact it more efficiently at run time and thus has the potential to make it and the overall system run faster. We strongly encourage you to use zipalign on both new and already published applications and to make the optimized version available — even if your application targets a previous version of Android. This article describes how zipalign helps performance and how to use it to optimize your app.
Zipalign工具用于優(yōu)化Android打包的應(yīng)用.zipalign作用于你的應(yīng)用可以使Android應(yīng)用更有效率.強(qiáng)烈推薦使用zipalign優(yōu)化所有的Android應(yīng)用.本文討論zipalign如何提升應(yīng)用性能.

In Android, data files stored in each application's apk are accessed by multiple processes: the installer reads the manifest to handle the permissions associated with that application; the Home application reads resources to get the application's name and icon; the system server reads resources for a variety of reasons (e.g. to display that application's notifications); and last but not least, the resource files are obviously used by the application itself.
Android中存儲在應(yīng)用中的數(shù)據(jù)文件可以被多種應(yīng)用訪問: 比如安裝器讀取manifest來處理應(yīng)用相關(guān)的權(quán)限; Home應(yīng)用可獲取應(yīng)用的名稱和圖標(biāo); 系統(tǒng)服務(wù)器也會讀取資源(如,用于顯示應(yīng)用提示); 當(dāng)然這些資源也會被自身應(yīng)用使用.

The resource-handling code in Android can efficiently access resources when they're aligned on 4-byte boundaries by memory-mapping them. But for resources that are not aligned (that is, when zipalign hasn't been run on an apk), it has to fall back to explicitly reading them — which is slower and consumes additional memory.
當(dāng)資源通過內(nèi)存映射以4字節(jié)邊界對齊后,處理資源的代碼可以更加有效地訪問到資源.但是對于那些沒對齊的資源(即使用zipalign優(yōu)化的應(yīng)用),相對來說效率會低一些.

For an application developer, this fallback mechanism is very convenient. It provides a lot of flexibility by allowing for several different development methods, including those that don't include aligning resources as part of their normal flow.
對于應(yīng)用開發(fā)者而言,這種落后機(jī)制(即未aligned的應(yīng)用)是很方便的.

Unfortunately, for users the situation is reversed — reading resources from unaligned apks is slow and takes a lot of memory. In the best case, the only visible result is that both the Home application and the unaligned application launch slower than they otherwise should. In the worst case, installing several applications with unaligned resources increases memory pressure, thus causing the system to thrash around by having to constantly start and kill processes. The user ends up with a slow device with a poor battery life.
不幸的是,對于用戶來說正好相反 —— 讀取unaligned的應(yīng)用會很慢并且會占用很多內(nèi)存. 這可能導(dǎo)玩致Home應(yīng)用和unalignedy應(yīng)用運(yùn)行緩慢,甚至安裝好幾個unaligned的應(yīng)用會占用大量內(nèi)存導(dǎo)致系統(tǒng)內(nèi)存不足自動清理掉其它進(jìn) 程.這會降低將電池周期.

Luckily, it's very easy for you to align the resources in your application:
消除以下問題的方案是easy的:

1).Using ADT:  —— 使用ADT工具自動完成以上操作
The ADT plugin for Eclipse (starting from version 0.9.3) will automatically align release application packages if the export wizard is used to create them. To use the wizard, right click the project and choose "Android Tools" > "Export Signed Application Package..." It can also be accessed from the first page of the AndroidManifest.xml editor.

2).Using Ant: —— 使用Ant(沒用過,不清楚)
The Ant build script (starting from Android 1.6) can align application packages. Targets for older versions of the Android platform are not aligned by the Ant build script and need to be manually aligned.
Starting from the Android 1.6 SDK, Ant aligns and signs packages automatically, when building in debug mode.
In release mode, Ant aligns packages only if it has enough information to sign the packages, since aligning has to happen after signing. In order to be able to sign packages, and therefore to align them, Ant needs to know the location of the keystore and the name of the key in ant.properties. The name of the properties are key.store and key.alias respectively. If those properties are present, the signing tool will prompt to enter the store/key passwords during the build, and the script will sign and then align the apk file. If the properties are missing, the release package will not be signed, and therefore will not get aligned either.

********************推薦方式********************
3).Manually: —— 手動完成align操作,使用以下命令完成aligned操作 
In order to manually align a package, zipalign is in the tools/ folder of Android 1.6 and later SDKs. You can use it to align application packages targeting any version of Android. You should run it only after signing the apk file, using the following command: 

    zipalign -v 4 source.apk destination.apk

4).Verifying alignment: —— 驗(yàn)證alignment
The following command verifies that a package is aligned:

    zipalign -c -v 4 application.apk

We encourage you manually run zipalign on your currently published applications and to make the newly aligned versions available to users. Also, don't forget to align any new applications going forward!
推薦通過手動方式來運(yùn)行zipalign.

posted on 2012-10-30 20:00 大龍 閱讀(522) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美激情精品久久久久久黑人| 亚洲一区国产精品| 欧美激情一区二区在线| 妖精成人www高清在线观看| 久久精品麻豆| 国产精品一区二区三区久久久| 亚洲片在线资源| 免费久久99精品国产自在现线| 亚洲一区视频在线| 国产精品xxxxx| 亚洲视频电影图片偷拍一区| 亚洲国产精品va在看黑人| 久久九九国产精品| 国产一区二三区| 久久精品中文字幕一区| 亚洲视频观看| 国产精品一区二区在线观看| 亚洲欧美日韩精品综合在线观看| 99视频超级精品| 欧美日韩在线三级| 亚洲一区二区三区精品动漫| 一区二区三区**美女毛片| 欧美日精品一区视频| 亚洲新中文字幕| 亚洲综合丁香| 黄色av日韩| 亚洲第一福利视频| 欧美日韩精品系列| 欧美一区网站| 久久久久一本一区二区青青蜜月| 亚洲承认在线| 亚洲精品一区在线| 国产精品久久一卡二卡| 久久久久在线观看| 免费人成网站在线观看欧美高清| 一本色道久久综合| 欧美与黑人午夜性猛交久久久| 亚洲第一二三四五区| 亚洲啪啪91| 国产精品一区二区三区观看 | 欧美一区二视频在线免费观看| 亚洲午夜激情免费视频| 国产日本欧美一区二区三区在线| 欧美专区福利在线| 老司机67194精品线观看| 99精品久久久| 亚洲欧美大片| 亚洲人成网站影音先锋播放| 在线视频欧美日韩| 激情懂色av一区av二区av| 欧美国产在线视频| 国产精品青草综合久久久久99| 国产精品日日摸夜夜摸av| 久久综合激情| 激情综合色丁香一区二区| 亚洲国产日韩欧美在线99| 国产精品高潮粉嫩av| 久久久噜噜噜| 欧美日韩中文在线观看| 久久久最新网址| 国产精品久久99| 欧美顶级大胆免费视频| 国产精品一区亚洲| 亚洲黄网站黄| 国产亚洲精品久久飘花| 91久久精品美女| 狠狠色丁香婷婷综合久久片| 亚洲高清在线观看| 国产农村妇女毛片精品久久莱园子 | 亚洲激情综合| 国模吧视频一区| 亚洲美女视频在线观看| 在线观看一区欧美| 久久9热精品视频| 亚洲男人的天堂在线aⅴ视频| 美女尤物久久精品| 久久亚洲春色中文字幕| 国产伦精品免费视频| av成人免费| 亚洲九九精品| 牛夜精品久久久久久久99黑人| 久久久久亚洲综合| 国产伦精品一区二区三区四区免费| 亚洲片在线资源| 亚洲精品在线一区二区| 久久综合亚州| 欧美成年人网站| 在线成人av.com| 久久爱www.| 久久久久久91香蕉国产| 国产日韩欧美高清免费| 午夜精品影院| 久久精品人人做人人爽| 国产麻豆一精品一av一免费| 亚洲系列中文字幕| 午夜亚洲性色福利视频| 国产精品美女久久久浪潮软件| 日韩午夜一区| 亚洲视频精选| 国产精品久久国产愉拍| 亚洲一区二区在线播放| 亚洲一区黄色| 国产日韩一区二区| 久久黄色影院| 你懂的一区二区| 亚洲精品1区2区| 欧美二区在线观看| 亚洲美女区一区| 香蕉成人伊视频在线观看| 国产精品一区视频| 久久久噜噜噜久久狠狠50岁| 欧美韩国日本一区| 亚洲素人在线| 国产精品一卡| 久久久欧美精品| 亚洲精品在线电影| 一本色道久久加勒比88综合| 亚洲欧美久久久| 国产亚洲欧美日韩一区二区| 欧美制服丝袜第一页| 亚洲成色777777在线观看影院| 一区二区激情| 国产真实久久| 欧美精品1区2区3区| 亚洲一品av免费观看| 久久人体大胆视频| 一区电影在线观看| 国产午夜精品麻豆| 欧美激情a∨在线视频播放| 亚洲一区二区三区三| 嫩草伊人久久精品少妇av杨幂| 一区二区三区精品| 伊人精品在线| 国产精品第一区| 麻豆精品一区二区av白丝在线| 日韩视频免费观看高清在线视频 | 欧美在线视频一区二区| 亚洲国产精品一区二区www| 午夜在线不卡| 日韩亚洲精品电影| 激情亚洲一区二区三区四区| 欧美天堂亚洲电影院在线观看| 欧美一区激情视频在线观看| 最新中文字幕亚洲| 久久久久久久久伊人| 一区二区av| 91久久综合| 国内久久精品| 国产精品免费电影| 欧美极品影院| 久久亚洲色图| 午夜影视日本亚洲欧洲精品| 亚洲日本一区二区三区| 久久艳片www.17c.com| 午夜视频一区| 亚洲小视频在线观看| 日韩视频中文| 亚洲国产成人高清精品| 国产婷婷97碰碰久久人人蜜臀| 欧美日韩在线另类| 麻豆91精品| 久久综合成人精品亚洲另类欧美| 午夜国产精品影院在线观看| 一区二区激情小说| 亚洲美女网站| 日韩亚洲欧美在线观看| 欧美激情一区| 亚洲国产高清在线| 亚洲第一伊人| 亚洲国产欧美一区| 欧美大片第1页| 女生裸体视频一区二区三区| 久久亚洲视频| 免费久久99精品国产自| 欧美成人免费小视频| 免费欧美日韩国产三级电影| 玖玖综合伊人| 蜜臀av国产精品久久久久| 久久久蜜桃一区二区人| 久久久国产成人精品| 久久亚洲免费| 欧美福利网址| 欧美激情小视频| 亚洲经典三级| 亚洲精品看片| 一区二区三区日韩欧美| 在线一区观看| 午夜精品亚洲| 久久久最新网址| 欧美成人r级一区二区三区| 欧美精品黄色| 国产精品v一区二区三区| 午夜亚洲福利| 欧美成人在线网站| 欧美福利视频在线| 亚洲日韩成人| 亚洲午夜精品一区二区| 亚洲欧美三级伦理| 久久久99久久精品女同性 | 亚洲高清免费视频|