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

大龍的博客

常用鏈接

統計

最新評論

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>
            久久久久久国产精品mv| 一区二区91| 女主播福利一区| 国产人成一区二区三区影院| 亚洲国产一二三| 狠狠干综合网| 欧美激情一区二区三级高清视频 | 午夜精品婷婷| 欧美日韩在线播放三区四区| 亚洲国产一二三| 欧美成人免费全部观看天天性色| 亚洲图色在线| 国精产品99永久一区一区| 欧美专区福利在线| 亚洲第一色在线| 中日韩视频在线观看| 亚洲人成网站999久久久综合| 亚洲毛片在线| 激情偷拍久久| 亚洲国产成人av在线| 亚洲黄色三级| 国产精品日韩在线| 亚洲黄色免费网站| 国产精品一香蕉国产线看观看| 91久久精品美女高潮| 国产在线精品一区二区夜色| 亚洲永久免费| 麻豆精品在线观看| 亚洲美女中出| 国产午夜亚洲精品不卡| 亚洲激情社区| 亚洲国产乱码最新视频| 麻豆成人精品| 亚洲啪啪91| 好看不卡的中文字幕| av成人手机在线| 日韩视频三区| 久久中文欧美| 国产精品va在线播放| 亚洲国产老妈| 日韩视频精品| 欧美日韩一区二区三区免费看| 亚洲大片av| 夜夜爽www精品| 国产精品久久久久久久久久ktv| 99精品视频免费| 欧美亚洲一区在线| 狠狠色丁香久久婷婷综合丁香| 亚洲激情网站免费观看| 99在线热播精品免费| 欧美激情综合在线| 亚洲国产日韩综合一区| 亚洲永久免费| 国产亚洲精品久久久久婷婷瑜伽| 麻豆精品网站| 亚洲欧美激情精品一区二区| 免费黄网站欧美| 在线观看91精品国产麻豆| 欧美14一18处毛片| 久久嫩草精品久久久久| 中日韩视频在线观看| 国产精品一区二区久久| 久久国产精品黑丝| 亚洲精品永久免费| 久久欧美中文字幕| 午夜精品999| 亚洲一区二区三区四区在线观看| 亚洲福利免费| 国产亚洲综合性久久久影院| 免费不卡在线观看av| 男男成人高潮片免费网站| 狠狠做深爱婷婷久久综合一区| 亚洲精品视频免费在线观看| 免费亚洲婷婷| 欧美日韩一级黄| 欧美不卡高清| 国产日产欧美一区| 国产一区二区三区久久久久久久久| 日韩午夜三级在线| 亚洲视频香蕉人妖| 亚洲免费黄色| 欧美国产国产综合| 亚洲国产精品电影| 狠狠色丁香久久综合频道 | 欧美一区二区三区视频在线观看| 亚洲第一综合天堂另类专| 这里只有精品视频| 亚洲香蕉在线观看| 国产精品久久久久久久浪潮网站| 亚洲高清影视| 亚洲福利专区| 欧美激情精品久久久久久免费印度| 久久精品综合网| 亚洲视频免费看| 国产精品美女久久久久久免费| 免费日韩一区二区| 久久夜色精品国产欧美乱| 国产一区二区黄色| 欧美va亚洲va国产综合| 久久久久免费观看| 国产视频精品xxxx| 亚洲精品国产精品国自产在线| 久久久久久夜| 136国产福利精品导航网址应用| 日韩亚洲不卡在线| 国产精品免费福利| 久久在线视频| 欧美视频在线观看 亚洲欧| 久久久国产一区二区| 理论片一区二区在线| a91a精品视频在线观看| 欧美成人免费小视频| 欧美成人一区二区三区| 欧美影院久久久| 久久国产精品久久久久久电车| 国产欧美日韩精品在线| 小黄鸭视频精品导航| 久久婷婷人人澡人人喊人人爽| 激情综合色丁香一区二区| 久久亚洲精品一区二区| 亚洲黄色在线视频| 亚洲一区二区三区精品视频| 国产精品视频一二三| 久久久99精品免费观看不卡| 欧美国产视频在线| 欧美精品粉嫩高潮一区二区| 亚洲欧洲在线一区| 久久九九精品| 欧美国产一区二区| 亚洲视频在线观看免费| 欧美专区在线| 极品少妇一区二区三区精品视频| 美女精品一区| 亚洲影院免费| 亚洲电影免费| 欧美一区午夜视频在线观看| 亚洲福利视频一区二区| 欧美视频日韩视频| 久久久久久高潮国产精品视| 91久久精品www人人做人人爽 | 欧美激情一区二区三区在线视频| 亚洲精品一区在线观看| 久久精品一二三| 亚洲精品在线免费观看视频| 国产精品一国产精品k频道56| 久久国产精品一区二区三区四区 | 久久精品国产免费看久久精品| 巨胸喷奶水www久久久免费动漫| 亚洲人成高清| 好吊日精品视频| 国产精品国产三级国产普通话99 | 亚洲精品久久久久久久久| 欧美久久久久久久久久| 亚洲欧美日韩一区在线| 亚洲第一精品夜夜躁人人躁| 亚洲制服丝袜在线| 亚洲激情成人| 娇妻被交换粗又大又硬视频欧美| 欧美日韩一区二区免费视频| 久久久国产精品一区二区三区| 亚洲视频一区二区免费在线观看| 母乳一区在线观看| 欧美一区免费| 亚洲性线免费观看视频成熟| 91久久国产综合久久蜜月精品| 国产日韩欧美成人| 欧美日韩在线播放| 欧美电影免费观看| 久久免费99精品久久久久久| 午夜精品视频在线观看| 一区二区三区欧美成人| 亚洲精品日韩在线观看| 欧美成人免费在线观看| 久久久视频精品| 久久久亚洲影院你懂的| 欧美综合国产| 久久精品国产视频| 欧美影院久久久| 亚洲一区中文| 亚洲男人影院| 午夜亚洲视频| 欧美一站二站| 久久国产精品一区二区三区四区 | 亚洲免费一区二区| 在线成人免费观看| 亚洲视频成人| 免费视频一区二区三区在线观看| 羞羞视频在线观看欧美| 亚洲精品四区| 亚洲毛片在线观看| 亚洲最新色图| 亚洲午夜精品网| 亚洲综合视频网| 午夜精品亚洲| 欧美尤物巨大精品爽| 久久精品亚洲| 欧美va亚洲va香蕉在线| 亚洲福利国产精品| 亚洲精品网站在线播放gif| 日韩五码在线|