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

大龍的博客

常用鏈接

統計

最新評論

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>
            性色一区二区| 一本到高清视频免费精品| 欧美永久精品| 午夜欧美精品| 久久久久久综合| 久久精品动漫| 蜜臀av国产精品久久久久| 男人的天堂亚洲| 欧美日韩精品久久久| 欧美日韩亚洲一区三区| 国产精品国产精品| 国产三区二区一区久久| 在线免费观看日本一区| 一区二区三区产品免费精品久久75 | 欧美日本一区二区三区 | 欧美激情一区二区| 欧美日韩一区二区国产| 国产区在线观看成人精品| 在线观看日韩一区| 艳女tv在线观看国产一区| 先锋影音网一区二区| 久热精品在线| 99re6热在线精品视频播放速度| 亚洲自拍另类| 欧美激情女人20p| 国产精品一区二区三区乱码 | 亚洲国产mv| 夜夜嗨av一区二区三区中文字幕 | 午夜精品久久久久久久久久久久久 | 久久国产欧美精品| 亚洲国产高清aⅴ视频| 亚洲肉体裸体xxxx137| 亚洲欧美视频一区二区三区| 欧美专区亚洲专区| 亚洲日本国产| 久久精品日产第一区二区| 国产精品xxx在线观看www| 亚洲欧洲日产国产网站| 欧美中文在线免费| 国语自产精品视频在线看| 亚洲激情视频网| 久久综合久久综合这里只有精品| 亚洲欧美日韩成人高清在线一区| 狼狼综合久久久久综合网| 亚洲天堂av在线免费观看| 欧美成人在线免费视频| 狠狠色综合网| 欧美一级久久久久久久大片| 亚洲精品一区中文| 毛片av中文字幕一区二区| 韩国自拍一区| 久久视频一区二区| 久久精品国语| 国产在线视频不卡二| 亚洲欧美在线免费| 亚洲视屏一区| 欧美午夜免费电影| 亚洲欧美日韩国产中文在线| 日韩视频在线观看| 欧美日韩精品一区二区在线播放| 91久久精品一区二区别| 欧美激情在线狂野欧美精品| 久久精品亚洲精品| 在线观看精品一区| 蜜臀91精品一区二区三区| 久久精品国产在热久久 | 欧美福利网址| 亚洲黄色毛片| 亚洲激情成人网| 欧美日韩ab| 亚洲欧美日韩精品久久亚洲区| 亚洲视频在线观看三级| 国产精品亚洲产品| 久久精选视频| 久久综合激情| 日韩视频免费观看高清完整版| 亚洲高清视频一区二区| 欧美日韩国产不卡在线看| 亚洲深夜av| 欧美在线你懂的| 亚洲激情不卡| 一本色道**综合亚洲精品蜜桃冫| 欧美日韩视频一区二区| 欧美在线免费一级片| 久久久久一区二区三区| 一本色道久久88亚洲综合88| 亚洲欧美成aⅴ人在线观看| 一色屋精品视频在线观看网站| 欧美二区在线看| 国产精品国产三级国产aⅴ浪潮| 欧美在线黄色| 欧美1区视频| 欧美一区二区视频在线观看2020| 久久综合久久88| 亚洲私人影院| 久久精品国产99国产精品澳门| 亚洲精品视频在线看| 一本色道久久99精品综合| 亚洲欧美日韩电影| 亚洲国产综合视频在线观看| 一区二区三区四区五区精品| 影音先锋日韩资源| 亚洲视频999| 美女日韩欧美| 亚洲欧美区自拍先锋| 久久激情视频| 亚洲综合激情| 欧美1区3d| 久久天天躁夜夜躁狠狠躁2022| 欧美午夜电影网| 亚洲二区视频| 极品少妇一区二区| 亚洲图片在线观看| 一区二区三区成人精品| 久久男女视频| 久久精品视频在线播放| 欧美三级日本三级少妇99| 亚洲高清视频一区| 亚洲国产精品www| 久久精品国产亚洲a| 午夜在线精品| 欧美午夜精品| 99这里只有久久精品视频| 亚洲黄色免费电影| 久久综合色8888| 欧美v亚洲v综合ⅴ国产v| 国内精品久久久久影院薰衣草| 亚洲在线视频| 午夜久久资源| 国产精品视频精品视频| 日韩五码在线| 一区二区三区四区国产| 欧美激情视频给我| 亚洲国产老妈| 91久久精品久久国产性色也91| 久久久久网址| 免费视频一区| 亚洲区中文字幕| 欧美国产综合一区二区| 亚洲高清电影| 亚洲欧洲一区二区在线观看| 免费黄网站欧美| 亚洲高清自拍| 99riav1国产精品视频| 欧美高清在线一区| 免费日韩av电影| 亚洲国产精品第一区二区| 亚洲乱码国产乱码精品精可以看 | 国产精品亚洲а∨天堂免在线| 在线一区二区日韩| 香蕉久久夜色精品国产| 国产日韩精品综合网站| 久久精品麻豆| 亚洲国产精品福利| 亚洲视频电影图片偷拍一区| 国产精品免费电影| 久久久九九九九| 亚洲国产一成人久久精品| 在线亚洲欧美视频| 国产精品视频久久久| 欧美亚洲三级| 欧美国产日本在线| 99视频精品全国免费| 国产精品美女www爽爽爽视频| 欧美在线一二三区| 91久久综合亚洲鲁鲁五月天| 亚洲欧美一区二区原创| 国语自产在线不卡| 欧美精品自拍| 性做久久久久久久久| 欧美黄色大片网站| 99re6热在线精品视频播放速度| 亚洲在线免费观看| 欧美黄色aaaa| 欧美在线看片| 日韩手机在线导航| 国产午夜亚洲精品羞羞网站| 乱中年女人伦av一区二区| 一区二区三区免费看| 久久久亚洲人| 亚洲尤物影院| 亚洲国产欧美在线| 国产精品久线观看视频| 久久综合色8888| 亚洲综合国产| 亚洲激情在线视频| 久久一区二区三区国产精品| 亚洲色图制服丝袜| 91久久久久久久久| 国外精品视频| 国产精品无码专区在线观看| 欧美国产极速在线| 久久久久久久高潮| 亚洲欧美日韩国产中文| 91久久综合亚洲鲁鲁五月天| 狂野欧美性猛交xxxx巴西| 欧美中在线观看| 亚洲一区在线播放| 在线视频精品| 亚洲人成人一区二区在线观看|