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

大龍的博客

常用鏈接

統計

最新評論

Zipalign: an Easy Optimization --- 轉

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工具用于優化Android打包的應用.zipalign作用于你的應用可以使Android應用更有效率.強烈推薦使用zipalign優化所有的Android應用.本文討論zipalign如何提升應用性能.

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中存儲在應用中的數據文件可以被多種應用訪問: 比如安裝器讀取manifest來處理應用相關的權限; Home應用可獲取應用的名稱和圖標; 系統服務器也會讀取資源(如,用于顯示應用提示); 當然這些資源也會被自身應用使用.

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.
當資源通過內存映射以4字節邊界對齊后,處理資源的代碼可以更加有效地訪問到資源.但是對于那些沒對齊的資源(即使用zipalign優化的應用),相對來說效率會低一些.

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.
對于應用開發者而言,這種落后機制(即未aligned的應用)是很方便的.

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的應用會很慢并且會占用很多內存. 這可能導玩致Home應用和unalignedy應用運行緩慢,甚至安裝好幾個unaligned的應用會占用大量內存導致系統內存不足自動清理掉其它進 程.這會降低將電池周期.

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: —— 驗證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!
推薦通過手動方式來運行zipalign.

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

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            国内一区二区在线视频观看| 欧美大片在线观看一区| 欧美特黄a级高清免费大片a级| 日韩特黄影片| 一本色道久久综合狠狠躁篇怎么玩| 欧美色视频在线| 欧美一级在线播放| 久久视频在线视频| 一本一本久久a久久精品综合麻豆| 99re成人精品视频| 国产日韩欧美高清| 欧美大尺度在线| 欧美新色视频| 久久综合久久综合这里只有精品| 另类天堂av| 午夜精品久久久久久久久| 欧美在线资源| 一区二区免费在线视频| 午夜国产一区| 亚洲精品亚洲人成人网| 亚洲男人的天堂在线| 亚洲激情在线观看| 亚洲免费在线电影| 亚洲精选一区二区| 久久爱91午夜羞羞| 一区二区三区国产在线| 欧美专区亚洲专区| 亚洲一区影院| 欧美成人激情视频| 久久亚洲一区二区| 欧美午夜精品久久久久久孕妇| 久久美女艺术照精彩视频福利播放| 欧美日本视频在线| 免费成人激情视频| 国产精品嫩草影院一区二区| 欧美国产1区2区| 国内激情久久| 亚洲一区二区三区在线看| 91久久精品国产91久久性色tv| av成人国产| 久久综合久久综合这里只有精品 | 久久久无码精品亚洲日韩按摩| 99re视频这里只有精品| 久久夜色撩人精品| 久久久久一区| 国产日韩欧美电影在线观看| 一区二区三区精品国产| 日韩亚洲一区二区| 欧美二区视频| 亚洲大片免费看| 国产在线播放一区二区三区| 亚洲小视频在线观看| 宅男精品视频| 欧美另类人妖| 亚洲麻豆国产自偷在线| 亚洲精选在线观看| 欧美国产日本| 亚洲另类在线一区| av成人免费| 欧美三级在线播放| 99国产精品久久久久久久| 一本久道久久综合狠狠爱| 欧美激情小视频| 日韩午夜中文字幕| 亚洲尤物在线视频观看| 国产精品成人一区二区网站软件| 日韩天天综合| 亚洲欧美成人一区二区三区| 国产精品久久久99| 午夜欧美精品久久久久久久| 久久成人免费日本黄色| 国产亚洲精品bt天堂精选| 午夜精品短视频| 老司机午夜精品视频在线观看| 激情成人亚洲| 欧美成人一区二区三区在线观看 | 欧美v亚洲v综合ⅴ国产v| 影视先锋久久| 欧美激情一区二区久久久| 亚洲欧洲精品一区二区三区不卡 | 日韩一区二区高清| 午夜性色一区二区三区免费视频| 国产精品美女久久久免费| 欧美在线视频a| 亚洲国产精彩中文乱码av在线播放| 亚洲国产中文字幕在线观看| 欧美精品日韩一区| 午夜精品成人在线视频| 欧美国产91| 午夜影院日韩| 亚洲成在人线av| 欧美日韩在线电影| 久久久九九九九| 亚洲免费成人av电影| 久久精品在线免费观看| 日韩特黄影片| 激情综合电影网| 国产精品成人免费视频| 久久精品一本久久99精品| 一本大道av伊人久久综合| 另类图片国产| 篠田优中文在线播放第一区| 亚洲国产中文字幕在线观看| 欧美在线观看视频在线| 91久久久久久| 久久综合久久久| 亚洲欧美国产一区二区三区| 亚洲国产精品久久久久婷婷老年 | 国产精品推荐精品| 欧美国产精品人人做人人爱| 性8sex亚洲区入口| 99精品视频一区| 欧美国产日韩在线| 久久精品国产综合精品| 亚洲午夜影视影院在线观看| 在线看视频不卡| 国产欧美在线观看一区| 欧美日韩黄色大片| 欧美成人激情视频| 久久久久久久久久久久久女国产乱| 日韩午夜三级在线| 亚洲国产精品久久久久| 久久亚洲精选| 久久久不卡网国产精品一区| 亚洲专区一区| 亚洲图片自拍偷拍| 亚洲视频导航| 在线视频中文亚洲| 在线视频欧美精品| 99热这里只有精品8| 91久久夜色精品国产网站| 悠悠资源网久久精品| 激情久久综艺| 激情久久五月| 亚洲第一免费播放区| 精品二区久久| 在线免费高清一区二区三区| 一区一区视频| 亚洲国产精品成人精品| 亚洲大胆在线| 亚洲激情在线| 99国产精品99久久久久久粉嫩| 亚洲国产精品黑人久久久 | 欧美日韩视频专区在线播放 | 在线观看一区二区视频| 红桃视频一区| 亚洲高清av在线| 99精品国产99久久久久久福利| av72成人在线| 亚洲欧美在线看| 羞羞漫画18久久大片| 欧美在线视频导航| 久久综合网色—综合色88| 美脚丝袜一区二区三区在线观看| 欧美成人综合在线| 亚洲精品乱码久久久久久日本蜜臀 | 亚洲精品一区二区三区福利| 一本色道久久综合亚洲精品按摩 | 亚洲精品国产精品乱码不99| 日韩视频不卡| 亚洲一区久久久| 久久国产欧美日韩精品| 蜜臀av一级做a爰片久久| 欧美美女bbbb| 国产伦精品一区二区三区视频孕妇| 国产日韩欧美电影在线观看| 亚洲第一成人在线| 国产精品亚洲一区二区三区在线| 国产亚洲激情| 99国内精品久久| 午夜在线成人av| 欧美成人午夜影院| 亚洲调教视频在线观看| 久久免费高清视频| 欧美午夜一区二区| 尤物精品国产第一福利三区 | 狠狠色丁香婷婷综合久久片| 日韩视频永久免费| 久久久久久伊人| 亚洲精品视频一区二区三区| 久久国产夜色精品鲁鲁99| 欧美日韩午夜激情| 尹人成人综合网| 亚洲欧美日韩精品久久久久| 欧美国产日产韩国视频| 亚洲尤物影院| 欧美极品在线播放| 国内一区二区三区| 午夜精品久久久久久99热| 亚洲第一在线综合网站| 午夜伦理片一区| 欧美日韩一区二区三区免费| 在线观看日韩av电影| 性感少妇一区| 制服丝袜亚洲播放| 欧美激情一区二区三区在线 | 国产亚洲成年网址在线观看| 99国内精品| 亚洲激情综合| 另类欧美日韩国产在线|