聽
鍘熸枃鑷細http://android.eoe.cn/topic/ui
聽
鍒涘缓瀵逛袱绉嶄互涓婂睆骞曞昂瀵哥殑澶歛pk鏀寔锛圕reating Multiple APKs with 2+ Dimensions锛?/h3>涓轰簡鍦ㄥ紑鍙慳ndroid搴旂敤绋嬪簭鐨勬椂鍊欏姞浠ュ埄鐢╣oogle瀹夊崜甯傚満鐨勫apk鏀寔鐗规€э紝鍒氬紑濮嬪氨閲囧彇涓€浜涜壇濂界殑鎺柦鍘诲鍔犲澶歛pk鐨勬敮鎸侊紝鏄潪甯搁噸瑕佺殑锛岃繖鏍峰彲浠ュ湪灏嗘潵寮€鍙戠殑杩囩▼涓噺灏戜笉蹇呰鐨勯夯鐑︺€傝繖涓€鑺傚皢鍚戞偍灞曠ず濡備綍涓轰綘鐨刟pp鍒涘缓澶歛pk鏀寔--涓嶅悓鐨刟pk鏀寔涓嶅悓鐨勫睆骞曞ぇ灏忋€傝繕灏嗚幏寰椾竴浜涚淮鎶ゅapk浠g爜搴撳敖鍙兘鐨勭畝鍗曠殑宸ュ叿銆?/p>
纭鎮ㄦ槸鍚﹂渶瑕佸apk鏀寔褰撲綘璇曞浘鍒涘缓涓€涓敮鎸佽法澶歛ndroid璁惧鐨勫簲鐢ㄧ▼搴忔椂锛屽緢鑷劧鐨勪綘甯屾湜浣犵殑搴旂敤绋嬪簭鍙互鍦ㄦ墍鏈夌殑璁惧涓婇兘鐪嬭捣鏉ユ渶濂姐€備綘鏃㈡兂鍒╃敤澶у睆骞曠殑绌洪棿锛屼篃甯屾湜鑳藉湪灏忓睆骞曚笂杩愯锛屾兂鍒╃敤鏂癮pi鐨勭壒寰侊紝涔熸兂鍦ㄦ渶鏂拌澶囦笂鐨勭湅鍒扮殑绾圭悊鐗瑰緛鍚屾椂鑳藉湪鏃ц澶囦笂鍚屾牱鍙互鐪嬪埌銆?br >鍒氬紑濮嬬殑鏃跺€欒涓洪€氳繃鍒涘缓澶氫釜apk鍘绘敮鎸佸璁惧鏄渶濂界殑瑙e喅鏂规锛屼絾鏄線寰€涓嶆槸杩欐牱銆傝€屾槸浣跨敤鍗曚釜鐨刟pk鍘绘浛浠e涓猘pk锛屽紑鍙戞寚鍗椾腑鏈夊幓瀹屾垚杩欎釜鐩爣鏈夌敤鐨勪俊鎭紝鍖呮嫭濡備綍浣跨敤鏀寔搴?/a>鐨勪俊鎭€傝繕鍙互瀛︿範鍒板浣曞啓鍙兘杩愯鍦ㄧ壒瀹歛pi鐗堟湰鐨勪唬鐮佺殑鏂规硶锛岃€屼笉鍘讳娇鐢ㄥ儚鍙嶅皠杩欐牱鐨勯潪甯告秷鑰楄祫婧愮殑鎶€鏈€?/p>
濡傛灉浣犺兘璁╀綘鐨勫簲鐢ㄧ▼搴忓彧浣跨敤涓€涓猘pk锛屽皢鏈夊涓嬪嚑鐐瑰ソ澶勶細
- * 鍙戝竷鍜屾祴璇曠畝鍗?/li>
- * 鍙渶缁存姢涓€涓唬鐮佸簱
- * 搴旂敤绋嬪簭鍙互閫傚簲涓嶅悓閰嶇疆鐨勮澶?/li>
- * App鍙互璺ㄨ澶囪繍琛?/li>
- * 浣犱笉蹇呰€冭檻market鐨勮姹傦紝apk鐨勫崌绾ф垨鑰卆pk灞炰簬鍝被璁惧
鍋囪鎮ㄥ凡缁忕爺绌朵簡杩欎釜鏂囨。锛屽凡缁忓涔犱簡閾炬帴椤甸潰鐨勫唴瀹癸紝骞朵笖纭畾澶歛pk鏀寔鐨勭▼搴忔槸浣犻渶瑕佺殑锛岄偅涔堣缁х画鐪嬩笅闈㈢殑灏忚妭銆?/p>
鐢诲嚭浣犵殑闇€姹?/h3>棣栧厛鍒涘缓涓€涓畝鍗曠殑鍥捐〃鏉ュ揩閫熺‘瀹氫綘闇€瑕佸灏戜釜APK, 姣忎釜Apk瑕嗙洊鐨勫睆骞曞昂瀵歌寖鍥淬€傝櫧鐒跺垰寮€濮嬪惉璧锋潵闈炲父瀹规槗锛屼絾鏄瘡涓猵ai鐗堟湰鐨刟pk鍘诲疄鐜扮洰鏍囨湁鏄瘮杈冨洶闅剧殑锛岀壒鍒槸缁忓父鏈夐噸鍙犵殑閮ㄥ垎銆傚垢杩愮殑鏄紝閫氳繃鏈柟娉曪紝浣犱細寰堝鏄撶粯鍒跺嚭浣犵殑闇€姹?渚涗互鍚庡紑鍙戝弬鑰冦€傝鎴戜滑鍏堣璁轰竴涓嬪浣曟牴鎹睆骞曞昂瀵稿拰api鐗堟湰锛屼负apk鍒掑垎瀵瑰簲鐨勮澶囪寖鍥淬€傞鍏堟槸鍒涘缓涓€涓浘琛紝琛屽拰鍒楀搴斾竴涓€硷紝骞朵笖閮界敤棰滆壊濉厖锛屾瘡绉嶉鑹蹭唬琛ㄤ竴涓猘pk銆?br >
涓婇潰鐨勪緥瀛愭湁鍥涗釜apk锛岃摑鑹茬殑鏄负鎵€鏈夌殑small/normall灞忓箷璁惧鐨勫紑鍙戠殑锛岀豢鑹茬殑鏄负鎵€鏈夌殑large灞忓箷璁惧寮€鍙戠殑锛岀孩鑹茬殑鏄负xlarge璁惧睆骞曡澶囧紑鍙戠殑锛岃繖涓夌apk瀵瑰簲鐨凙PI鑼冨洿鏄?-10銆傜传鑹茬殑鏄竴涓壒渚嬶紝瀹冨彲浠ラ€傚簲鎵€鏈夌殑灞忓箷澶у皬锛屼絾鏄粎鏀寔API11鎴栬€呬互涓婄郴缁熴€傛洿閲嶈鐨勪竴鐐规槸锛屽綋浣犵瀰涓€鐪艰繖涓浘琛ㄧ殑鏃跺€欙紝浣犺兘蹇€熺殑鐪嬪嚭鏉ュ摢涓猘pk瀵瑰簲浠€涔圓PI锛屽搴斾粈涔堝睆骞曞ぇ灏忋€傛澶栦綘杩樺彲浠ヤ负姣忎竴涓猘pk璧蜂竴涓潪甯告媺椋庣殑寮€鍙戜唬鍙枫€傚綋鎴戜滑鐨勫洟闃熸垚鍛橀棶鎴戜滑锛屸€滄垜浠槸涓嶆槸璇ユ祴璇曠孩鑹茬殑閭d釜apk浜嗏€濓紝鑰屼笉鏄鈥滄垜浠槸涓嶆槸璇ユ祴璇曡繖涓敮鎸丄PI3-10锛屾敮鎸亁large灞忓箷锛屽苟涓斾笉鏄湪鎽╂墭鐨刋oom骞虫澘涓婄殑apk浜嗏€濓紝鏄剧劧锛屽墠涓€绉嶆柟寮忔洿瀹规槗鐞嗚В銆傝繕鏈夛紝鎶婅繖涓渶姹傚浘琛ㄦ墦鍗颁笅鏉ワ紝鍒嗗彂缁欐瘡涓€涓洟闃熸垚鍛樸€?/p>
鎶婃墍鏈夌殑鍏辩敤浠g爜鍜屽叡鐢ㄨ祫婧愭斁鍦ㄥ悓涓€涓簱宸ョ▼閲? Put All Common Code and Resources in a Library Project)鏃犺浣犳槸淇敼涓€涓凡缁忓瓨鍦ㄧ殑Android搴旂敤绋嬪簭杩樻槸寮€濮嬪垱寤轰竴涓柊鐨勭▼搴忥紝棣栧厛鏈€閲嶈鐨勪换鍔″氨鏄垱寤轰竴涓叡鐢ㄤ唬鐮佸簱锛堝鏍囬鎵€璇寸殑搴撳伐绋嬶級銆傛妸閭d簺鍙渶鏇存柊涓€娆″氨鍙互鍑忓皯椤圭洰鐨勫紑鍙戞椂闂达紝鍑忓皯椤圭洰閿欒鐨勪唬鐮佹垨鑰呰祫婧愭斁杩涜繖涓簱宸ョ▼閲岋紙姣斿鍙互鏀惧湪浠g爜搴撻噷鐨勫儚鏈湴鍖栬瑷€瀛楃涓诧紝棰滆壊涓婚锛屽叡鐢╞ug鐨勪慨澶嶇瓑锛夈€?/p>
娉ㄦ剰锛?/strong>聽濡備綍鍒涘缓搴撻」鐩殑缁嗚妭锛屼笉鏄湰鑺傝璁茶В鐨勮寖鍥达紝鎮ㄥ彲浠ラ€氳繃涓嬮潰鐨勯摼鎺ュ揩閫熺殑浜嗚В濡備綍鍒涘缓搴撳伐绋嬶細
- *聽鍒涘缓搴撳伐绋嬶紙鍦╡clipse涓級
- *聽鍒涘缓搴撳伐绋嬶紙鍛戒护琛岋級
濡傛灉浣犳兂鎶婂凡鏈夌殑搴旂▼搴忚浆鎴愬apk鐨勬敮鎸侊紝闇€瑕侀噸鏂扮粍缁囦綘鐨勪唬鐮佷腑鐨勬墍鏈夌殑鏈湴鍖栧瓧绗︿覆鏂囦欢锛屽€煎垪琛紝棰滆壊涓婚锛岃彍鍗曞浘鏍囷紝甯冨眬鏂囦欢锛岃繖浜涜法apk鐨勪笉浼氭敼鍙樼殑璧勬簮鏂囦欢锛屽苟鎶婁粬浠斁鍒板簱宸ョ▼閲屻€傝繕鏈夋妸閭d簺涓嶄細鏀瑰彉澶鐨勪唬鐮佹斁鍒板簱宸ョ▼閲屻€傝繖鏍蜂綘灏嗕細鍙戠幇锛屼綘鍙互浠庝竴涓猘pk缁ф壙鍙︿竴涓猘pk閭d簺绫荤殑锛屾墿灞曚竴鍒颁袱涓柟娉曪紙鍑芥暟锛夈€?/p>
濡傛灉浣犲垰寮€濮嬪垱寤轰竴涓柊搴旂敤绋嬪簭锛岄鍏堣灏介噺鍦ㄤ竴涓簱宸ョ▼涓啓浠g爜锛屽鏋滃繀瑕佺殑鎯呭喌涓嬪仛鎴愪竴涓嫭绔嬬殑apk銆傝繖鏍峰湪浠ュ悗闀挎椂闂寸殑寮€鍙戣繃绋嬩腑锛岄暱杩滅湅鏉ユ槸闈炲父瀹规槗绠$悊鐨勶紝鍙互涓€鐐逛竴鐐圭殑娣诲姞鍏辩敤浠g爜鍜岃祫婧愶紝骞跺湪鏁版湀涔嬪悗鎸囧嚭杩欎簺浠g爜鎴栬€呰祫婧愬湪涓嶇粡淇敼鐨勬儏鍐典笅鏄惁璇ョЩ鍔ㄥ埌搴撻噷銆?/p>
鍒涘缓鏂扮殑APK宸ョ▼锛圕reate New APK Projects锛?/h3>瀵逛簬闇€瑕佸彂甯冪殑姣忎釜APK锛岃鍒嗗埆涓烘瘡涓狝PK鍒涘缓Android宸ョ▼銆備负浜嗕究浜庣鐞嗭紝鎶婂簱宸ョ▼鍜屾墍鏈夌浉鍏崇殑APK宸ョ▼鏀惧湪鐩稿悓鐨勭埗鐩綍涓嬶紝鍚屾椂闇€瑕佽浣忔瘡涓狝PK闇€瑕佺浉鍚岀殑鍖呭悕锛岃櫧鐒朵粬浠湪杩欎釜搴撻噷涓嶅繀椤诲幓鍏变韩浠栦滑鐨勫寘鍚嶃€傛瘮濡傦紝濡傛灉浣犳湁4涓狝PK锛屾濡傚墠闈㈢殑瑙勫垯鎵€鎻忚堪鐨勶紝浣犵殑鏍圭洰褰曚細鍍忚繖鏍凤細
1 2 3 4 5 6 7 8 9 10 11
alexlucas:~/code/multi-apks-root$ ls foo-blue foo-green foo-lib foo-purple foo-red
涓€鏃﹁繖涓伐绋嬪垱寤轰箣鍚庯紝鎶婅繖涓簱宸ョ▼寮曠敤鍒版瘡涓狝PK宸ョ▼锛屽鏋滃彲浠ョ殑璇濓紝鍦ㄥ簱宸ョ▼閲屽畾涔夊惎鍔ˋctivity锛屽苟鍦ˋPK宸ョ▼閲岀户鎵胯繖涓狝ctivity銆傛湁浜嗚繖涓湪搴撳伐绋嬩腑瀹氫箟鐨勫惎鍔ˋctivity锛屽彲浠ユ妸浣犵殑鎵€鏈夊簲鐢ㄧ▼搴忕殑鍒濆鍖栧伐浣滄斁鍦ㄤ竴涓湴鏂癸紝杩欐牱涓€鏉ユ瘡涓竴涓崟鐙殑APK灏变笉闇€瑕侀噸鏂板疄鐜拌繖浜涘儚鍒濆鍖栧垎鏋愶紝杩愯璁稿彲妫€鏌ョ瓑鍏朵粬鐨勪竴浜涘垵濮嬪寲宸ヤ綔锛屼笉鐢ㄤ竴涓釜APK鐨勫幓鍐欙紝缁存姢璧锋潵涔熶細绠€鍗曞ソ澶氥€?/p>
璋冩暣Manifests鏂囦欢锛圓djust the Manifests锛?/h3>褰撶敤鎴蜂粠google瀹夊崜甯傚満涓嬭浇瀵瑰APK鏀寔鐨勭▼搴忔椂锛屾纭殑APK浣跨敤涓や釜绠€鍗曡鍒欙細
1.maifest宸茬粡琛ㄦ槑杩欎釜APK鏄悎鏍肩殑
2.瀵逛簬鎵€鏈夌殑鍚堟牸APK,鏀寔鐨凙ndroid API鐗堟湰鍙锋渶楂樿€呬紭鍏堣鍙戠幇銆?/p>
涓嬮潰鎴戜滑灏嗕互涓句緥鐨勬柟寮忚瑙o紝棣栧厛锛屽亣璁炬垜浠凡缁忎簡瑙d簡鍓嶉潰鎵€杩扮殑澶欰PK鐨勬弿杩帮紝骞朵笖杩欎簺apk鏀寔鎵€鏈夌殑灞忓箷灏哄锛岃€屼笉鏄粎浠呭彧鏀寔鐩爣灏哄鐨勫睆骞曪紝璁╂垜浠噸鏂扮湅涓€涓嬪墠闈㈢殑琛ㄦ牸锛?br >Since it鈥檚 okay for coverage to overlap, we can describe the area covered by each APK like so:
鍥犱负浠栦滑鏈夐噸鍚堢殑閮ㄥ垎锛屾垜浠彲浠ュ儚涓嬮潰涓€鏍峰幓鎻忚堪姣忎釜apk
-
- 钃濊壊鐨勮鐩栨墍鏈夌殑灞忓箷灏哄锛屾渶浣庢敮鎸乻dk鏄?
-
- 缁胯壊鐨勮鐩栧ぇ灞忓箷鎴栬€呮洿澶х殑灞忓箷锛屾渶浣庣殑sdk鏄?銆?/li>
-
- 绾㈣壊鐨勮鐩栫殑鏄秴澶у睆骞曠殑锛堝钩甯哥殑骞虫澘锛夛紝鏈€浣庢敮鎸乻dk9
-
- 绱壊鐨勮鐩栨墍鏈夌殑灞忓箷灏哄锛屾敮鎸佹渶浣巗dk11
璇锋敞鎰忥紝鍦ㄤ笂杩扮殑瑙勫垯涓湁寰堝閲嶅悎鐨勫湴鏂广€備妇涓緥瀛愶紝涓€涓獂larger灞忓箷鐨勮澶囷紝绯荤粺鐗堟湰鏄疉PI11,杩欎釜4涓猘pk鍏ㄩ兘鍙互鍦ㄨ繖涓澶囦笂杩愯锛屾垜浠牴鎹渶楂樼増鏈紭鍏堣鎼滃埌鐨勫師鍒欙紝鎴戜滑鍙互鎶婁粬浠殑浼樺厛绾у垪鍑烘潵锛?/p>
绱壊 鈮?绾㈣壊 鈮?缁胯壊 鈮?钃濊壊
涓轰粈涔堝厑璁搁噸鍙犲憿锛?br >鐜板湪鎴戜滑杩涗竴姝ュ亣璁撅紝绱壊鐨刟pk闇€瑕佷竴浜涘繀椤荤殑涓滆タ锛岃€屽叾浠栫殑涓ょapk涓嶉渶瑕佹湁銆俫oogle瀹夊崜甯傚満鐨勫紑鍙戣€呮寚鍗楅〉闈笂鍒楀嚭浜嗘墍鏈夌殑鍙兘杩囨护鎺変綘鐨勭▼搴忕殑缃瓉绁搁銆備负浜嗘洿濂界殑璁茶В渚嬪瓙锛屾垜浠户缁亣璁撅紝绱壊鐨刟pk闇€瑕佸墠缃憚鍍忓ご锛屽叧閿偣灏卞湪浜庯紝蹇呴』瑕佹眰鏈夊墠缃憚鍍忓ご锛屼絾鏄苟涓嶆槸鎵€鏈夌殑API11鎴栦互涓婅澶囦笂閮介厤鏈夊墠缃憚鍍忓ご锛屾槸涓嶆槸寰堟亹鎬栥€?/p>
骞歌繍鐨勬槸锛屽鏋滅敤鎴峰湪google瀹夊崜甯傚満浣跨敤杩欐牱鐨勮澶囨祻瑙堣蒋浠剁殑鏃跺€欙紝瀹夊崜甯傚満鐨勫紩鎿庨鍏堜細鍒癿anifest鏂囦欢閲岄潰鍘绘煡鐪嬫槸鍚﹀繀椤昏鏈夌殑鍓嶇疆鎽勫儚澶达紝濡傛灉蹇呴』瑕佹眰鏈夊墠缃憚鍍忓ご锛屽洜涓虹传鑹茬殑apk鍜岃澶囦笉鍖归厤锛岃繖涓传鑹茬殑apk灏嗕細琚拷鐣ユ帀锛涚劧鍚庡啀鏌ョ湅绾㈣壊鐨刟pk锛屽洜涓虹孩鑹茬殑apk鍗虫敮鎸亁larger灞忓箷锛屽鍓嶇疆鎽勫儚澶翠篃娌℃湁纭€х殑瑕佹眰锛実oogle play浼氳涓虹孩鑹茬殑apk鍙互鍜岃澶囧尮閰嶏紝绋嬪簭灏卞彲浠ヤ粠google play涓婁笅杞戒笅鏉ヨ瘯鐢ㄤ簡锛屽洜涓鸿嚦灏戞湁涓€涓敮鎸佽繖涓澶囩殑apk銆?/p>
涓轰簡鎶婃墍鏈夌殑apk鍒嗗埆澶勭悊锛岃瀹氫竴涓ソ鐨勭増鏈彿浣跨敤瑙勫垯鐗瑰埆閲嶈锛屽湪寮€鍙戣€呮寚鍗椾笂鏈夋帹鑽愮殑鐗堟湰鍙疯鍒?a href="http://docs.eoeandroid.com/guide/google/play/publishing/multiple-apks.html#VersionCodes" >Version Codes銆傝繖涓€閮ㄥ垎杩樻槸姣旇緝鍊煎緱闃呰鐨勶紝鍩烘湰瑕佺偣鏄负涓€缁刟pk璁惧畾瑙勫垯锛屾垜浠敤涓や釜鏁板瓧浠h〃鏈€浣庢敮鎸佺殑绯荤粺鐗堟湰鍙凤紝鐢ㄤ袱涓暟瀛椾唬琛ㄦ敮鎸佺殑鏈€澶ф垨鑰呮渶灏忓睆骞曞ぇ灏忥紝鍙﹀鐨勪笁涓暟瀛椾唬琛ㄨ嚜宸辩殑绋嬪簭鐨勭増鏈€傞€氳繃杩欑鏂瑰紡锛屽綋璁惧鐨勭郴缁熷崌绾х殑鏃跺€欙紝姣斿浠?0鍗囩骇鍒?1锛宎pk鍗囩骇鐨勬椂鍊欙紝鍦ㄦ墍鏈夌殑apk涓紝浼樺厛琚崌绾х殑apk鏄綋鍓嶅畨瑁呭湪璁惧涓婄殑閭d釜apk銆備笅闈㈡槸涓€涓増鏈彿浣跨敤瑙勫垯鐨勪竴涓緥瀛愶紝鍙互瀹氫箟鎴愬涓嬫牸寮忥紝
钃濊壊: 0304001, 0304002, 0304003...
缁胯壊: 0334001, 0334002, 0334003
绾㈣壊: 0344001, 0344002, 0344003...
绱壊: 1104001, 1104002, 1104003...
杩欎笁绉嶅湪绋嬪簭鐨刴anifests鏂囦欢涓畾涔夊垎鍒涓嬶細
钃濊壊:
1 2 3 4 5 6 7 8
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0304001" android:versionName="1.0" package="com.example.foo"> <uses-sdk android:minSdkVersion="3" /> <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" /> ...
缁胯壊:
1 2 3 4 5 6 7 8
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0334001" android:versionName="1.0" package="com.example.foo"> <uses-sdk android:minSdkVersion="3" /> <supports-screens android:smallScreens="false" android:normalScreens="false" android:largeScreens="true" android:xlargeScreens="true" /> ...
绾㈣壊:
1 2 3 4 5 6 7 8
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0344001" android:versionName="1.0" package="com.example.foo"> <uses-sdk android:minSdkVersion="3" /> <supports-screens android:smallScreens="false" android:normalScreens="false" android:largeScreens="false" android:xlargeScreens="true" /> ...
绱壊:
1 2 3 4 5 6 7 8
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1104001" android:versionName="1.0" package="com.example.foo"> <uses-sdk android:minSdkVersion="11" /> <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" /> ...
娉ㄦ剰涓€涓嬶紝鍦ㄦ妧鏈笂锛屼竴涓猘pk瑕佷箞鏈夋敮鎸佺殑鐗瑰畾灞忓箷鐨勬爣璁帮紝瑕佷箞鏈夊吋瀹规€х殑灞忓箷鐨勬爣璁帮紝鏀寔鐨勫睆骞曟槸浼樺厛鑰冭檻鐨勩€備絾鏄鏋滃悓鏃舵湁杩欎袱涓爣璁版槸寰堜笉濂界殑鍋氭硶锛岃繖鏍蜂細澧炲姞棰濆鐨勫鏉傛€э紝澧炲姞鏈轰細鎬ч敊璇€傚悓鏃惰繕瑕佹敞鎰忥紝涓嶈浣跨敤榛樿鐨勫€硷紙small鍜宯ormal榛樿鎯呭喌涓嬫€绘槸true锛夛紝鍦╩anifesets涓簲璇ユ槑纭寚瀹氬睆骞曞ぇ灏忕殑鍊笺€傝繖鏍蜂細鍑忓皯浠ュ悗鐨勯夯鐑?--椤轰究涓句釜渚嬪瓙锛宮anifest鐨勭洰鏍噑dk瑕佹眰灏忎簬9锛屽鏋滀娇鐢ㄩ粯璁ゅ€硷紝xlarge鑷姩璁剧疆涓篺alse锛寈large鐨勫睆骞曞皢涓嶄細鏀寔锛屽洜姝ゆ渶濂借鏄庣‘鎸囧畾銆?/p>
鍙戝竷鍓嶇殑妫€鏌?Go Over Pre-launch Checklist)寰€google play涓婁笂浼犵▼搴忎箣鍓嶏紝涓€瀹氳鏍规嵁涓嬮潰鐨勬潯鐩粩缁嗙殑妫€鏌ヤ笅绋嬪簭銆傝浣忥紝杩欎簺鏉$洰涓庡apk鏀寔鍏崇郴闈炲父瀵嗭紝浣嗘槸杩欓噷骞舵病鏈夊垪鍑烘墍鏈夌殑闇€瑕佹鏌ユ竻鍗曘€?/p>
- * 鎵€鏈夌殑apk蹇呴』鏈夌浉鍚岀殑鍖呭悕
- * 鎵€鏈夌殑apk蹇呴』鐢ㄧ浉鍚岀殑鏁板瓧璇佷功绛惧悕
- * 濡傛灉杩欎簺apk鏈夌郴缁熺増鏈噸鍚堢殑鍦版柟锛屾渶浣庣郴缁熺増鏈彿鏈€澶х殑閭d釜apk蹇呴』鏈変竴涓洿楂樼増鏈彿锛圛f the APKs overlap in platform version, the one with the higher minSdkVersion must have a higher version code锛?/li>
- * 浠讳綍涓€绉嶄綘灏嗘湁鏀寔鐨勫睆骞曞ぇ灏忛兘瑕佸湪manifest涓缃垚true,濡傛灉涓嶆兂鏀寔鐨勫氨璁剧疆鎴恌alse銆?/li>
- * 浠旂粏妫€瑙唌anifest鐨勮繃婊ゆ潯浠舵槸鍚︽湁鍐茬獊鐨勫湴鏂癸紙姣斿锛屼竴涓猘pk鍙敮鎸亁lager鐨勫睆骞曠殑璁惧锛屽氨涓嶈琚墍鏈夌殑璁惧鐪嬪埌锛?/li>
- * 姣忎竴涓猘pk鐨刴enifest蹇呴』鑷冲皯鏀寔涓€绉嶅睆骞曪紝openGL texture鎴栬€呯郴缁熺増鏈€?/li>
- * 姣忎竴涓猘pk鑷冲皯鍦ㄤ竴涓璁惧涓婃祴璇曡繃銆傞櫎闈炰綘鏄负瀹氬埗鐨勮澶囧紑鍙戠▼搴忋€?/li>
鎶婄▼搴忔彁浜ゅ埌google甯傚満涔嬪墠锛岃繕瑕佸缂栬瘧杩囩殑绋嬪簭杩涜妫€鏌ワ紝纭繚娌℃湁涓€浜涘叾浠栫殑鏄庢樉鐨勯棶棰樿€屽奖鍝嶄綘鐨勭▼搴忓湪google甯傚満涓婅鍙戠幇銆備娇鐢╝apt锛圓ndroid Asset Packaging Tool锛屾槸鐢熸垚鍜屾墦鍖卆ndroid搴旂敤绋嬪簭鐨勯噸瑕佹瀯寤哄伐鍏凤級杩欎釜宸ュ叿杩涜缂栬瘧妫€鏌ョ壒鍒殑绠€鍗曚究鍒┿€?/p>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
>aapt dump badging package: name='com.example.hello' versionCode='1' versionName='1.0' sdkVersion:'11' uses-permission:'android.permission.SEND_SMS' application-label:'Hello' application-icon-120:'res/drawable-ldpi/icon.png' application-icon-160:'res/drawable-mdpi/icon.png' application-icon-240:'res/drawable-hdpi/icon.png' application: label='Hello' icon='res/drawable-mdpi/icon.png' launchable-activity: name='com.example.hello.HelloActivity' label='Hello' icon='' uses-feature:'android.hardware.telephony' uses-feature:'android.hardware.touchscreen' main supports-screens: 'small' 'normal' 'large' 'xlarge' supports-any-density: 'true' locales: '--_--' densities: '120' '160' '240'
褰撲綘鍦ㄦ鏌apt鐨勮緭鍑烘椂锛岀‘淇濇敮鎸佺殑灞忓箷鍜屽吋瀹圭殑灞忓箷鐨勫€间笉鍐茬獊锛屼笉瑕佸湪manifest涓殑"uses-feature"娣诲姞涓€浜涗綘骞朵笉闇€瑕佺殑绯荤粺鏉冮檺.濡備笂闈㈢殑渚嬪瓙锛岃繖涓猘pk涓嶄細琚緢澶氱殑璁惧鐪嬪埌銆?/p>
涓轰粈涔堝憿锛熶緥瀛愪腑鏄剧ず锛屽鍔犱簡SEND_SMS鐨勬潈闄愯姹傦紝杩欎釜鐗瑰緛闇€瑕佸鍔燼ndroid.hardware.telephony纭欢鏀寔銆備粠api11 Honeycomb寮€濮嬫槸閽堝骞虫澘鐢佃剳鐨勭郴缁燂紝娌℃湁鎵撶數璇濈殑纭欢鏀寔锛孏oogle play灏嗕細杩囨护鎺変笉鏀寔鎵撶數璇濈殑璁惧锛屽彧鏈堿PI鐗堟湰鍖归厤锛屽悓鏃舵敮鎸佹墦鐢佃瘽鐨勭‖浠舵敮鎸佹墠涓嶄細琚繃婊ゆ帀銆?/p>
鍙互闈炲父瀹规槗鐨勫湪manifest涓慨澶嶈繖涓棶棰橈細
1
<uses-feature android:name="android.hardware.telephony" android:required="false" />
android.hardvare.touchscreen 鏉冮檺瑕佹眰涔熸湰涓嶆纭殑鍔犺繘鍘讳簡锛屽鏋滀綘鎯充綘鐨刟pk鑳借娌℃湁瑙︾鍔熻兘鐨刟ndroid绯荤粺鐨勬櫤鑳界數瑙嗕篃鑳藉湪甯傚満涓婃悳绱㈠埌锛岃繘琛屽涓嬭缃細
1
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />v
褰撲綘瀹屾垚浜嗗彂甯冨墠鐨勬鏌ワ紝浣犲氨鍙互鍚慻oogle play涓婃彁浜や綘鐨刟pk浜嗐€傚彂甯冨畬涔嬪悗鍐嶅幓google play鍋氭渶鍚庝竴鐐规鏌ワ紝鍘讳笂闈㈡悳绱綘鐨勭▼搴忥紝涓嬭浇涓嬫潵锛屼互纭繚浣犵殑鐩爣璁惧鍙互鎼滃埌锛屽苟鑳戒娇鐢ㄣ€傛伃鍠滄偍锛岀幇鍦ㄦ偍宸茬粡瀹屾垚浜嗘湰鑺傝绋嬶紒锛侊紒
openwnn_pref_ja.xml
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="openwnn_pref_ja" >
<PreferenceCategory android:title="@string/preference_key_setting_menu" >
<CheckBoxPreference
android:key="key_sound"
android:summary="@string/preference_key_sound_summary"
android:title="@string/preference_key_sound_title" />
<CheckBoxPreference
android:key="key_vibration"
android:summary="@string/preference_key_vibration_summary"
android:title="@string/preference_key_vibration_title" />
<CheckBoxPreference
android:defaultValue="true"
android:key="popup_preview"
android:summary="@string/preference_preview_summary"
android:title="@string/preference_preview_title" />
<CheckBoxPreference
android:defaultValue="true"
android:key="auto_caps"
android:summary="@string/preference_auto_caps_summary"
android:title="@string/preference_auto_caps_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/preference_conversion_menu" >
<CheckBoxPreference
android:defaultValue="true"
android:key="opt_enable_learning"
android:summary="@string/preference_input_learning_summary"
android:title="@string/preference_input_learning_title" />
<CheckBoxPreference
android:defaultValue="true"
android:key="opt_prediction"
android:summary="@string/preference_prediction_summary"
android:title="@string/preference_prediction_title" />
<CheckBoxPreference
android:defaultValue="true"
android:dependency="opt_prediction"
android:key="opt_spell_correction"
android:summary="@string/preference_correct_spell_summary"
android:title="@string/preference_correct_spell_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/preference_dictionary_menu" >
<PreferenceScreen
android:key="user_dictionary_edit_words"
android:persistent="false"
android:summary="@string/preference_user_dictionary_edit_words_summary_ja"
android:title="@string/preference_dictionary_menu_ja" >
</PreferenceScreen>
<PreferenceScreen
android:key="user_dictionary_edit_words"
android:persistent="false"
android:summary="@string/preference_user_dictionary_edit_words_summary_en"
android:title="@string/preference_dictionary_menu_en" >
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory android:title="@string/preference_aboutime_menu" >
<Preference
android:key="openwnn_version"
android:summary="@string/openwnn_japanese_copyright"
android:title="@string/openwnn_japanese" />
</PreferenceCategory>
</PreferenceScreen>