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

大龍的博客

常用鏈接

統計

最新評論

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 大龍 閱讀(528) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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>
            久久青草久久| 欧美大胆人体视频| 野花国产精品入口| 欧美日韩精品免费| 亚洲欧美色一区| 中文一区二区在线观看| 国产精品老女人精品视频| 亚洲四色影视在线观看| 亚洲一区二区日本| 国产丝袜一区二区| 欧美国产一区二区在线观看| 欧美大秀在线观看| 亚洲男人第一av网站| 午夜精品久久久久久久99热浪潮 | 久久深夜福利免费观看| 在线观看91久久久久久| 亚洲国产高清一区二区三区| 欧美国产1区2区| 亚洲综合色丁香婷婷六月图片| 亚洲一区国产一区| 精品91久久久久| 亚洲靠逼com| 国产精品五区| 亚洲国产一区二区视频| 国产精品伦理| 欧美高清视频在线播放| 欧美三级欧美一级| 欧美1区2区视频| 国产精品v亚洲精品v日韩精品| 久久久青草青青国产亚洲免观| 免费一级欧美在线大片| 亚洲欧美一区二区激情| 美女啪啪无遮挡免费久久网站| 一区二区成人精品| 久久亚洲私人国产精品va媚药| 亚洲视频香蕉人妖| 久久综合国产精品台湾中文娱乐网| 亚洲夜晚福利在线观看| 久久综合色播五月| 欧美在线免费观看| 欧美午夜不卡视频| 亚洲国产人成综合网站| 国产在线高清精品| 一区二区三区四区国产| 亚洲欧洲午夜| 久久精品麻豆| 欧美在线亚洲一区| 欧美视频中文一区二区三区在线观看| 裸体素人女欧美日韩| 国产精品剧情在线亚洲| 亚洲美女电影在线| 最新国产精品拍自在线播放| 欧美在线啊v| 欧美一区二区三区成人| 国产精品白丝黑袜喷水久久久| 亚洲激情第一区| 亚洲欧洲日本mm| 裸体女人亚洲精品一区| 久久麻豆一区二区| 国产在线国偷精品产拍免费yy| 一区二区三区四区五区精品视频 | 一区二区三区日韩欧美精品| 久久永久免费| 欧美成人自拍视频| 亚洲福利专区| 免费人成精品欧美精品| 欧美成人精品高清在线播放| 精品成人一区二区三区| 午夜在线精品| 久久久久久高潮国产精品视| 国产亚洲精品aa午夜观看| 亚洲免费在线观看| 久久精品成人一区二区三区 | 久久免费黄色| 久色成人在线| 亚洲清纯自拍| 欧美日韩亚洲一区二区三区在线观看 | 亚洲在线观看免费视频| 欧美三级在线播放| 亚洲一区二区三区涩| 香蕉成人久久| 一区二区亚洲| 欧美绝品在线观看成人午夜影视| 亚洲激情亚洲| 亚洲欧美日韩精品久久久久 | 久久国产精品99国产精| 美女脱光内衣内裤视频久久网站| 在线日韩成人| 欧美日韩中文字幕日韩欧美| 国产精品99久久久久久久vr| 久久国产福利| 91久久精品网| 国产精品成人免费视频 | 午夜在线观看免费一区| 免费在线亚洲欧美| 一区二区三区久久| 国产一区二区三区久久精品| 美女尤物久久精品| 亚洲视频在线免费观看| 久久一区二区精品| 亚洲视频一二| 在线日韩av| 国产精品久久久久久久久免费桃花 | 亚洲免费视频观看| 男同欧美伦乱| 亚洲欧美精品| 在线日韩av片| 国产精品美女午夜av| 免费成人高清| 欧美制服丝袜第一页| 亚洲精品日韩激情在线电影| 久久国产精品99国产| 日韩视频在线一区二区三区| 国产欧美一区二区在线观看| 欧美激情网友自拍| 久久精品国产在热久久| 一区二区高清| 欧美激情一区二区三区在线 | 亚洲免费不卡| 原创国产精品91| 国产日韩在线亚洲字幕中文| 欧美精品尤物在线| 另类亚洲自拍| 久久久欧美精品| 午夜精品区一区二区三| 中日韩高清电影网| 亚洲精品男同| 欧美激情成人在线视频| 久久中文欧美| 久久九九国产精品| 欧美在线二区| 午夜宅男欧美| 亚洲欧美日韩中文视频| 日韩一级黄色av| 91久久黄色| 亚洲全黄一级网站| 亚洲国内自拍| 亚洲激情影视| 亚洲国产网站| 亚洲精品美女在线观看播放| 亚洲国产专区校园欧美| 亚洲成人在线视频播放| 亚洲第一区色| 亚洲国产欧美一区二区三区丁香婷| 国产一区二区三区不卡在线观看| 国产精品免费视频观看| 国产精品极品美女粉嫩高清在线| 欧美深夜影院| 国产精品国产亚洲精品看不卡15| 欧美日韩三级视频| 欧美四级电影网站| 国产精品久久久一区麻豆最新章节| 欧美色图五月天| 国产精品推荐精品| 国产一区二区按摩在线观看| 国产主播一区二区| 亚洲第一中文字幕在线观看| 亚洲国产欧美在线| 一区二区三区精品视频在线观看| 一区二区三区免费看| 亚洲一区二区在线免费观看视频| 亚洲男同1069视频| 久久免费高清视频| 欧美成人dvd在线视频| 亚洲人成在线播放| 亚洲午夜一级| 久久精品国产999大香线蕉| 久久伊人一区二区| 欧美精品一级| 国产精品一区二区在线观看网站 | 亚洲人成高清| 亚洲一区二区在线免费观看视频| 午夜在线视频一区二区区别| 久久午夜精品一区二区| 亚洲第一二三四五区| 夜夜精品视频| 久久国产手机看片| 欧美日本高清视频| 国产午夜亚洲精品不卡| 亚洲精品一二区| 久久国产精品久久w女人spa| 亚洲春色另类小说| 亚洲一区三区电影在线观看| 另类亚洲自拍| 国产精品视频久久一区| 1204国产成人精品视频| 亚洲欧美三级在线| 欧美黄色日本| 午夜在线精品偷拍| 欧美日韩亚洲在线| 在线观看一区欧美| 午夜在线一区二区| 亚洲黄色免费网站| 欧美在线观看网址综合| 欧美日韩中文在线| 亚洲三级性片| 久久综合九色综合欧美狠狠| 99国产一区二区三精品乱码| 美女福利精品视频| 国产一区二区久久|