锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲无线码在线一区观看,亚洲欧洲日产国码高潮αv,爱情岛论坛网亚洲品质自拍http://www.tkk7.com/zygcs/java欏圭洰闅忕瑪zh-cnThu, 27 Mar 2025 09:40:30 GMTThu, 27 Mar 2025 09:40:30 GMT60 鏀惰棌 JNI涓插彛閫氫俊澶氭枃浠惰皟鐢ㄦ椂寮傚父http://www.tkk7.com/zygcs/archive/2013/03/05/396100.html榫氭た娣?/dc:creator>榫氭た娣?/author>Tue, 05 Mar 2013 11:26:00 GMThttp://www.tkk7.com/zygcs/archive/2013/03/05/396100.htmlhttp://www.tkk7.com/zygcs/comments/396100.htmlhttp://www.tkk7.com/zygcs/archive/2013/03/05/396100.html#Feedback0http://www.tkk7.com/zygcs/comments/commentRss/396100.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/396100.html闃呰鍏ㄦ枃

]]>
launcher淇敼--淇敼launcher鐨勫睆騫曟暟http://www.tkk7.com/zygcs/archive/2013/02/25/395699.html榫氭た娣?/dc:creator>榫氭た娣?/author>Mon, 25 Feb 2013 07:07:00 GMThttp://www.tkk7.com/zygcs/archive/2013/02/25/395699.htmlhttp://www.tkk7.com/zygcs/comments/395699.htmlhttp://www.tkk7.com/zygcs/archive/2013/02/25/395699.html#Feedback0http://www.tkk7.com/zygcs/comments/commentRss/395699.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/395699.html棣栧厛錛屽湪Launcher.java浠g爜涓紝絎?25琛?/span>

  1. static final int SCREEN_COUNT = 5;  
  2. static final int DEFAULT_SCREEN = 2;//絎竴欏墊槸浠?寮濮嬭鏁幫紝榪欓噷鏄妸絎笁涓〉闈綔涓洪粯璁ら欏?nbsp; 

絎竴涓弬鏁板畾涔夊睆騫曚釜鏁幫紝絎竴涓弬鏁版槸榛樿鐨勯欏點傚湪榪欓噷錛屼綘鍙互鍋氬嚭鑷繁鐨勪慨鏀廣備絾鏄紝浠呰繖鐐逛慨鏀癸紝榪滆繙涓嶅錛屾垜浠湅涓涓媗auncher.xml

  1. <com.android.launcher2.DragLayer  
  2.     xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"  
  4.   
  5.     android:id="@+id/drag_layer"  
  6.     android:layout_width="match_parent"  
  7.     android:layout_height="match_parent">  
  8.   
  9.     <include layout="@layout/all_apps" />  
  10.   
  11.     <!-- The workspace contains 3 screens of cells -->  
  12.     <com.android.launcher2.Workspace  
  13.         android:id="@+id/workspace"  
  14.         android:layout_width="match_parent"  
  15.         android:layout_height="match_parent"  
  16.         android:scrollbars="horizontal"  
  17.         android:fadeScrollbars="true"  
  18.         launcher:defaultScreen="2">  
  19.   
  20.         <include android:id="@+id/cell1" layout="@layout/workspace_screen" />  
  21.         <include android:id="@+id/cell2" layout="@layout/workspace_screen" />  
  22.         <include android:id="@+id/cell3" layout="@layout/workspace_screen" />  
  23.         <include android:id="@+id/cell4" layout="@layout/workspace_screen" />  
  24.         <include android:id="@+id/cell5" layout="@layout/workspace_screen" />  
  25.   
  26.     </com.android.launcher2.Workspace>  

鎴戜滑鍙互鐪嬪埌 瀵煎叆浜嗕簲涓獁orkspace_screen錛屽湪榪欓噷錛屽弬鐓т綘涓婇潰淇敼鐨勫弬鏁幫紝娣誨姞鎴栬呭垹闄orkspace_screen銆傚湪榪欓噷錛屼綘鍙兘涔熸敞鎰忓埌浜?/span>

  1. launcher:defaultScreen="2">  

鍦ㄨ繖閲屽畾涔夌殑defaultScreen銆?/span>

鍚屾椂錛岃淇敼workspace.java涓?80

  1. mDefaultScreen = a.getInt(R.styleable.Workspace_defaultScreen, 1);  

鍜宺es/xml鏂囦歡涓璬efault_workspace鍋氬嚭鐩稿簲鐨勪慨鏀廣傝繖鏍峰氨鍩烘湰涓婂彲浠ヤ簡銆?/span>



]]>
android jni涔婥 鍜?C++ 鍑芥暟瀹炵幇鐨勬瘮杈?/title><link>http://www.tkk7.com/zygcs/archive/2013/01/30/394953.html</link><dc:creator>榫氭た娣?/dc:creator><author>榫氭た娣?/author><pubDate>Wed, 30 Jan 2013 10:44:00 GMT</pubDate><guid>http://www.tkk7.com/zygcs/archive/2013/01/30/394953.html</guid><wfw:comment>http://www.tkk7.com/zygcs/comments/394953.html</wfw:comment><comments>http://www.tkk7.com/zygcs/archive/2013/01/30/394953.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zygcs/comments/commentRss/394953.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zygcs/services/trackbacks/394953.html</trackback:ping><description><![CDATA[<p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><strong>浠g爜錛?/strong></p><ol style="margin: 0px 0px 0px 35px; padding: 0px; list-style-position: initial; list-style-image: initial; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><li style="margin: 0px; padding: 0px; "><p style="margin: 0px; padding: 0px; "><strong> <span style="text-decoration: underline; ">jclass test_class = env->GetObjectClass(obj);</span></strong></p></li><li style="margin: 0px; padding: 0px; "><p style="margin: 0px; padding: 0px; "><strong><span style="text-decoration: underline; "> jfieldID id_num = env->GetFieldID(test_class, "num", "I");</span></strong></p></li></ol><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><strong>緙栬瘧閿欒鎻愮ず錛?/strong></p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">/home/miyuehu/work/WebJsTest/jni/jnitest.c:22: <strong>error: request for member 'GetObjectClass' in something not a structure or union<br /></strong>/home/miyuehu/work/WebJsTest/jni/jnitest.c:23: <strong>error: request for member 'GetFieldID' in something not a structure or union</strong></p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "> </p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><strong>娉ㄦ剰錛歫ni.h澶存枃浠朵腑瀵逛簬***.c  &  ***.cpp閲囩敤涓嶅悓鐨勫畾涔?/strong></p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><strong><br />jclass (JNICALL *GetObjectClass)   (JNIEnv *env, jobject obj);</strong></p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><strong>jclass GetObjectClass(jobject obj) {<br />        return functions->GetObjectClass(this,obj);<br />    }</strong></p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "> </p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><strong>瀵逛簬***.c</strong></p><ol style="margin: 0px 0px 0px 35px; padding: 0px; list-style-position: initial; list-style-image: initial; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><li style="margin: 0px; padding: 0px; "><p style="margin: 0px; padding: 0px; ">jclass test_class = (*env)->GetObjectClass(env, obj);</p></li><li style="margin: 0px; padding: 0px; "><p style="margin: 0px; padding: 0px; ">jfieldID id_num = (*env)->GetFieldID(env, test_class, "num", "I");</p></li></ol><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "> </p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "> </p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">瀵逛簬<strong> ***.cpp</strong></p><ol style="margin: 0px 0px 0px 35px; padding: 0px; list-style-position: initial; list-style-image: initial; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "><li style="margin: 0px; padding: 0px; "><p style="margin: 0px; padding: 0px; ">jclass test_class = env->GetObjectClass(obj); </p></li><li style="margin: 0px; padding: 0px; "><p style="margin: 0px; padding: 0px; ">jfieldID id_num = env->GetFieldID(test_class, "num", "I"); </p></li></ol><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; "> </p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">鍦?nbsp;C 涓紝</p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">JNI 鍑芥暟璋冪敤鐢?#8220;(*env)->”浣滃墠緙錛岀洰鐨勬槸涓轟簡鍙栧嚭鍑芥暟鎸囬拡鎵寮曠敤鐨勫箋?/p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">鍦?nbsp;C++ 涓紝</p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">JNIEnv 綾繪嫢鏈夊鐞嗗嚱鏁版寚閽堟煡鎵劇殑鍐呰仈鎴愬憳鍑芥暟銆?/p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">涓嬮潰灝嗚鏄庤繖涓粏寰殑宸紓錛屽叾涓紝榪欎袱琛屼唬鐮佽闂悓涓鍑芥暟錛屼絾姣忕璇█閮芥湁鍚勮嚜鐨勮娉曘?/p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">C 璇硶錛歫size len = (*env)->GetArrayLength(env,array);</p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">C++ 璇硶錛歫size len =env->GetArrayLength(array);</p><img src ="http://www.tkk7.com/zygcs/aggbug/394953.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zygcs/" target="_blank">榫氭た娣?/a> 2013-01-30 18:44 <a href="http://www.tkk7.com/zygcs/archive/2013/01/30/394953.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>ANR瓚呮椂鏃墮棿鐨勫畾涔?.http://www.tkk7.com/zygcs/archive/2012/11/27/392094.html榫氭た娣?/dc:creator>榫氭た娣?/author>Tue, 27 Nov 2012 13:15:00 GMThttp://www.tkk7.com/zygcs/archive/2012/11/27/392094.htmlhttp://www.tkk7.com/zygcs/comments/392094.htmlhttp://www.tkk7.com/zygcs/archive/2012/11/27/392094.html#Feedback0http://www.tkk7.com/zygcs/comments/commentRss/392094.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/392094.htmlANR瓚呮椂鏃墮棿鐨勫畾涔?/span>

android\frameworks\base\services\java\com\android\server\am\ActivityManagerService.java

1.       broadcast瓚呮椂鏃墮棿涓?/span>10縐?/span>

static final int BROADCAST_TIMEOUT = 10*1000;

2.       鎸夐敭鏃犲搷搴旂殑瓚呮椂鏃墮棿涓?/span>5縐?/span>

    static final int KEY_DISPATCHING_TIMEOUT = 5*1000;



]]>
Android緙栫▼涔嬭В鍐砤ndroid-support-v4鎵撳寘闂http://www.tkk7.com/zygcs/archive/2012/10/13/389516.html榫氭た娣?/dc:creator>榫氭た娣?/author>Sat, 13 Oct 2012 11:06:00 GMThttp://www.tkk7.com/zygcs/archive/2012/10/13/389516.htmlhttp://www.tkk7.com/zygcs/comments/389516.htmlhttp://www.tkk7.com/zygcs/archive/2012/10/13/389516.html#Feedback0http://www.tkk7.com/zygcs/comments/commentRss/389516.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/389516.html濡傛灉宸ョ▼寮曞叆浜咥ndroid-support-v4鐨刯ar綾誨簱錛岄偅涔堝湪宸ョ▼鎵撳寘娣鋒穯鏃訛紝灝變細鍑虹幇鎶ラ敊鎻愮ず銆備緥濡傛彁紺轟綘錛歒ou may need to specify additional library jars (using '-libraryjars')銆?/p>

榪欓噷鍏堢粰鍑鴻В鍐蟲柟妗堬紝紼嶅悗鎴戜滑鍐嶆潵瑙i噴濡備綍澶勭悊綾諱技鎯呭喌錛?/p>

鍦╬roguard.cfg閲岀殑鍚庨潰錛屾坊鍔犲涓嬪唴瀹癸細

1.-libraryjars /android-support-v4.jar 
2.-dontwarn android.support.v4.** 
3.-keep class android.support.v4.** { *; }  4.-keep public class * extends android.support.v4.**  5.-keep public class * extends android.app.Fragment  鐒跺悗浣犲啀鎵撳寘鐪嬬湅錛屽簲璇ュ彲浠ユ甯哥敓鎴恆pk瀹夎鍖呬簡銆?/p>

鎵撳寘鍑洪敊錛?br />鎯呭喌涓錛?br /> "綾? can't find referenced class 綾?" 瀛楅潰涓婄殑鎰忔濆氨鏄被1鎵句笉鍒扮被2鐨勫紩鐢紱瀹冧細寤鴻浣狅細"You may need to specify additional library jars (using '-libraryjars').";
闇瑕佷嬌鐢?libraryjars鍔犱笂欏圭洰涓嬌鐢ㄥ埌鐨勭涓夋柟搴撳氨O(jiān)K浜嗐?br />渚嬪錛?libraryjars /android-support-v4.jar
娉ㄦ剰錛氳繖閲屽紩鐢ㄦ柟寮忔槸褰撳墠宸ョ▼鐨勬牴鐩綍錛堜篃鍙互閰嶇疆鍏朵粬鐩綍錛夛紝涔熷氨鏄錛屼綘瑕佹妸絎笁鏂筳ar鏀懼埌褰撳墠鐩綍涓嬶紝鍚﹀垯灝變細璀﹀憡璇存壘涓嶅埌jar鏂囦歡錛?/p>

鎯呭喌浜岋細
渚嬪錛?can't find superclass or interface android.os.Parcelable$ClassLoaderCreator錛岀鍒拌繖鏍風殑鎯呭喌錛屽彲浠ヤ嬌鐢?dontwarn com.xx.yy.**錛屼笉瀵歸敊璇彁鍑鴻鍛娿?br />娉ㄦ剰錛氫嬌鐢ㄨ繖涓柟寮忕殑璇濓紝瑕佺‘淇濊嚜宸辨病鏈夌敤鍒拌繖涓簱閲岄潰鐨勭被錛佸惁鍒欏氨浼氭姏ClassNotFoundException錛?/p>

鎯呭喌涓夛細
鍦ㄥ伐紼嬩腑紜疄鐢ㄥ埌浜嗚綾伙紝閲囩敤涓婇潰鏂瑰紡榪樻槸涓嶈銆傝繖涓椂鍊欏氨瑕佸啀澧炲姞涓欏癸細-keep class com.xx.yy.** { *;}錛岃褰撳墠綾諱笉娣鋒穯銆?/p>

灝忕粨錛?br />瀵逛簬寮曠敤絎笁鏂瑰寘鐨勬儏鍐碉紝鍙互閲囩敤涓嬮潰鏂瑰紡閬垮厤鎵撳寘鍑洪敊錛?br />-libraryjars /aaa.jar
-dontwarn com.xx.yy.**
-keep class com.xx.yy.** { *;}

鏈鍚庢墦鍖呮垚鍔燂紝榪樿鍦ㄦ満瀛愪笂璺戣窇錛岀湅鐪嬫湁娌℃湁闂銆?br />



鍘熸枃閾炬帴錛?a >http://www.linuxidc.com/Linux/2012-07/66798.htm

]]>
android Memory Management, OutOfMemoryError Notehttp://www.tkk7.com/zygcs/archive/2012/09/29/388847.html榫氭た娣?/dc:creator>榫氭た娣?/author>Sat, 29 Sep 2012 07:53:00 GMThttp://www.tkk7.com/zygcs/archive/2012/09/29/388847.htmlhttp://www.tkk7.com/zygcs/comments/388847.htmlhttp://www.tkk7.com/zygcs/archive/2012/09/29/388847.html#Feedback0http://www.tkk7.com/zygcs/comments/commentRss/388847.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/388847.html1銆

 

 銆銆Android妗嗘灦寮哄埗姣忎釜榪涚▼鐨?4 MB鍐呭瓨闄愬埗銆傚湪涓浜涙棫鐨勮澶囷紝濡傚湪G1錛岄檺鍒朵負16 MB 鏇翠綆錛屾洿閲嶈鐨勬槸錛岀敱浣嶅浘浣跨敤鐨勫唴瀛橀檺鍒躲傚鐞嗗浘鍍忕殑搴旂敤紼嬪簭錛屽畠鏄緢瀹規(guī)槗杈懼埌姝ら檺鍒訛紝騫惰幏寰椾笌OOM 寮傚父姝諱骸 鐨勮繃紼嬶細E / dalvikvm鍫嗭紙12517錛夛細1048576瀛楄妭澶栭儴鍒嗛厤榪欎釜 榪囩▼涓繃澶х殑E / GraphicsJNI錛?2517錛夛細 VM灝嗕笉浼氳鎴戜滑鍒嗛厤1048576瀛楄妭 / AndroidRuntime錛?2517錛夛細鍏抽棴VM / dalvikvm錛?2517錛夛細涓婚I(yè)D = 1錛氱嚎紼嬫湭鎹曡幏鐨勫紓甯擱鍑猴紙闆嗗洟= 0x4001d7f0 錛?E / AndroidRuntime錛?2517錛夛細鑷村懡寮傚父錛氫富瑕?鐢?shù)瀛? AndroidRuntime錛?2517錛夛細java.lang.OutOfMemoryError錛氫綅鍥劇殑澶у皬瓚呰繃VM鐨勯綆?錛岃繖涓檺鍒舵槸浣庡緱紱昏氨 銆傝澶囷紝鍍?12MB鐨勭墿鐞哛AM鐨凬exus涔嬩竴錛岃緗瘡涓繘紼嬬殑鍓嶅彴媧誨姩鍙湁5錛呯殑RAM鐨勫唴瀛橀檺鍒舵槸涓涓剼锠㈢殑閿欒 銆備絾鏃犺濡備綍錛屼簨鎯呮槸濡備綍鍜屾垜浠敓媧?鍗蟲壘鍒板浣曡В鍐沖畠銆?/font>

榪滆繙瓚呰繃闄愬埗鐨勫唴瀛樺垎閰嶆柟寮忔湁涓ょ 錛?/font>

銆銆涓縐嶆柟娉曟槸浠庢湰鏈轟唬鐮佸垎閰嶅唴瀛?銆備嬌鐢∟DK錛堟湰鍦板紑鍙戝伐鍏峰寘錛夊拰JNI錛屽畠鍙兘浠嶤綰э紙濡傜殑malloc / free鎴栨柊寤?鍒犻櫎錛夊垎閰嶅唴瀛橈紝榪欐牱鐨勫垎閰嶆槸涓嶈鍏ュ24 MB鐨勯檺鍒?銆傝繖鏄湡鐨勶紝浠庢湰鏈轟唬鐮佸垎閰嶅唴瀛樻槸涓轟粠Java鏂逛究錛屼絾瀹冨彲浠ヨ鐢ㄦ潵瀛樺偍鍦≧AM涓殑鏁版嵁錛堝嵆浣垮浘鍍忔暟鎹級鐨勪竴浜涘ぇ閲戦 銆?/font>

銆銆鍙︿竴縐嶆柟寮忥紝鍏朵腑鐨勪綔鍝佷互鍙婂浘鍍忕殑錛屾槸浣跨敤OpenGL鐨勭汗鐞?綰圭悊鍐呭瓨涓嶈鍏ラ檺鍒?/span> 錛岃鏌ョ湅鎮(zhèn)ㄧ殑搴旂敤紼嬪簭紜疄鍒嗛厤澶氬皯鍐呭瓨鍙互浣跨敤android.os.Debug.getNativeHeapAllocatedSize錛?錛?/span>錛屽彲浠ヤ嬌鐢ㄤ笂闈粙緇嶇殑涓ょ鎶鏈殑Nexus涔嬩竴錛屾垜鍙互杞繪澗鍦頒負涓涓崟涓鐨勫墠鍙拌繘紼嬪垎閰?00MB - 10鍊嶄互涓婄殑榛樿24 MB鐨勯檺鍒?錛屼粠涓婇潰鏉ョ湅浣跨敤navtive浠g爜鍒嗛厤鍐呭瓨鏄笉鍦?4MB鐨勯檺鍒跺唴鐨?/span>錛堝紑鏀劇殑GL鐨勮川鍦頒篃鏄嬌鐢╪avtive浠g爜鍒嗛厤鍐呭瓨鐨勶級 銆?/font>

銆姣忎釜 android 騫沖彴鍐呭瓨闄愬埗涓嶄竴鏍鳳紝浠庢渶寮濮嬬殑 16M 鍒?24M錛屼互鍙婂悗鏉ョ殑 32M錛?4M錛屾垨璁鎬互鍚庝細鏇村ぇ銆?/p>

銆銆閭e浣曡幏鍙栧崟涓?app 鍐呭瓨闄愬埗澶у皬鍛紵

銆銆class : ActivityManager

ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryClass();

銆銆褰撶劧錛孉ctivityManager 涓嶅崟鍗曢檺涓庢錛岃澶氬 android 紼嬪簭綆$悊鐨勫伐鍏鳳紝閮芥潵婧愪笌姝わ紝鎴栬呬粠榪欓噷榪涜鎵╁睍銆?/span> 

 


android涓嶅悓璁懼鍗曚釜榪涚▼鍙敤鍐呭瓨鏄笉涓鏍風殑錛屽彲浠ユ煡鐪?system/build.prop鏂囦歡銆?/span>

dalvik.vm.heapstartsize=5m
dalvik.vm.heapgrowthlimit=48m
dalvik.vm.heapsize=256m 

heapsize鍙傛暟琛ㄧず鍗曚釜榪涚▼鍙敤鐨勬渶澶у唴瀛橈紝浣?/span>濡傛灉瀛樺湪濡備笅鍙傛暟錛?/p>

dalvik.vm.heapgrowthlimit=48m琛ㄧず鍗曚釜榪涚▼鍐呭瓨琚檺瀹氬湪48m,鍗崇▼搴忚繍琛岃繃紼嬩腑瀹為檯鍙兘浣跨敤48m鍐呭瓨

android涓婄殑搴旂敤鏄痡ava錛屽綋鐒墮渶瑕佽櫄鎷熸満錛岃宎ndroid涓婄殑搴旂敤鏄甫鏈夌嫭绔嬭櫄鎷熸満鐨勶紝涔熷氨鏄瘡寮涓涓簲鐢ㄥ氨浼氭墦寮涓涓嫭绔嬬殑铏氭嫙鏈恒傝繖鏍瘋璁$殑鍘熷洜鏄彲浠ラ伩鍏嶈櫄鎷熸満宕╂簝瀵艱嚧鏁翠釜緋葷粺宕╂簝錛屼絾浠d環(huán)灝辨槸闇瑕佹洿澶氬唴瀛樸?span>浠ヤ笂榪欎簺璁捐紜繚浜哸ndroid鐨勭ǔ瀹氭э紝姝e父鎯呭喌涓嬫渶澶氬崟涓▼搴忓穿婧冿紝浣嗘暣涓郴緇熶笉浼氬穿婧冿紝涔熸案榪滄病鏈夊唴瀛樹笉瓚崇殑鎻愮ず鍑虹幇銆?/span>


銆鍦ˋndroid涓紝涓涓狿rocess 鍙兘浣跨敤16M鍐呭瓨錛堬紵錛夛紝瑕佹槸瓚呰繃浜嗚繖涓檺瀹氬氨浼氳煩鍑鴻繖涓紓甯?/p>

銆銆For Android specific we should use the 'recycle' method rather than 'gc', because 'recycle' will free the memory at the same time, but calling 'gc' doesn't guaranty to run and free the memory for same time(if it is not too critical, we should not call gc in our code) and results can very every time.
One more thing using 'recycle' is faster than the 'gc' and it improves the performance.

鍗籌細bitmap.recycle();

銆銆biamap=null;

鏁堟灉瑕佸ソ浜?/p>

銆銆biamap=null;

銆銆system.gc();

閫氳繃DDMS涓殑Heap閫夐」鍗$洃瑙嗗唴瀛樻儏鍐碉細

1.Heap瑙嗗浘涓儴鏈変竴涓猅ype鍙仛data object錛屽嵆鏁版嵁瀵硅薄錛屼篃灝辨槸鎴戜滑鐨勭▼搴忎腑澶ч噺瀛樺湪鐨勭被綾誨瀷鐨勫璞°?/p>

2.鍦╠ata object涓琛屼腑鏈変竴鍒楁槸“Total Size”錛屽叾鍊煎氨鏄綋鍓嶈繘紼嬩腑鎵鏈塉ava鏁版嵁瀵硅薄鐨勫唴瀛樻婚噺銆?/p>

濡傛灉浠g爜涓瓨鍦ㄦ病鏈夐噴鏀懼璞″紩鐢ㄧ殑鎯呭喌錛屽垯data object鐨凾otal Size鍊煎湪姣忔GC鍚庝笉浼氭湁鏄庢樉鐨勫洖钀斤紝闅忕潃鎿嶄綔嬈℃暟鐨勫澶歍otal Size鐨勫間細瓚婃潵瓚婂ぇ錛?br />  鐩村埌鍒拌揪涓涓笂闄愬悗瀵艱嚧榪涚▼琚玨ill鎺夈?/p>

2銆銆浠婂ぉ鍒氶亣鍒扮殑鎯呭喌錛氬彂鐜癵ridview鐨刧etview涓嬌鐢?/span>

澶嶅埗浠g爜
銆銆銆銆@Override
        public View getView(int position, View convertView, ViewGroup parent) {
            final View GridItem = mInflater.inflate(R.layout.store_catg_item,null, false);
銆銆銆銆銆銆銆TextView text = (TextView) GridItem.findViewById(R.id.store_catg_item_text);
            ImageView cover = (ImageView) GridItem.findViewById(R.id.store_catg_item_cover);
            Bitmap coverimg = ImageUtilities.getCachedCover(magaList
                    .get(position).id+ReaderConfigures.THUMB_SUFFIX_PLANE);
            String title;
            if(isCatg){
                title= magaList.get(position).category;
                text.setText(title.toUpperCase());
            }else{
                title= magaList.get(position).pubname;
                text.setVisibility(View.INVISIBLE);
            }
            GridItem.setTag(title);
            cover.setImageBitmap(coverimg);
            return GridItem;
        }
澶嶅埗浠g爜

 

婊戝姩鏃跺唴瀛樹細涓嶆柇娑紝鐩村埌OutOfMemory錛屼嬌鐢℉older鍚庝究涓嶄細鍙戠敓璇ヨ鍐碉紝鍏蜂綋鍘熷洜鏈粩緇嗘煡鎵撅紝鏍囪涓涓嬨?/p>

 1.瀵逛簬甯歌寮鍙戣呰岃█闇瑕佷簡瑙?Java鐨勫洓縐嶅紩鐢ㄦ柟寮忥紝姣斿寮哄紩鐢紝杞紩鐢紝寮卞紩鐢ㄤ互鍙婅櫄寮曠敤銆備竴浜涘鏉備簺鐨勭▼搴忓湪闀挎湡榪愯寰堝彲鑳藉嚭鐜扮被浼糘utOfMemoryError鐨勫紓甯搞?br />
2.騫朵笉瑕佽繃澶氱殑鎸囨湜gc錛屼笉鐢ㄧ殑瀵硅薄鍙互鏄劇ず鐨勮緗負絀猴紝姣斿obj=null錛宩ava鐨刧c浣跨敤鐨勬槸涓涓湁鍚戝浘錛屽垽鏂竴涓璞℃槸鍚︽湁鏁堢湅鐨勬槸鍏朵粬鐨勫璞¤兘鍒拌揪榪欎釜瀵硅薄鐨勯《鐐癸紝鏈夊悜鍥劇殑鐩稿浜庨摼琛ㄣ佷簩鍙夋爲鏉ヨ寮閿鏄彲鎯寵岀煡銆?br />
3.Android涓烘瘡涓▼搴忓垎閰嶇殑瀵瑰唴瀛樺彲浠ラ氳繃Runtime綾葷殑totalMemory() freeMemory() 涓や釜鏂規(guī)硶鑾峰彇VM鐨勪竴浜涘唴瀛樹俊鎭紝

Runtime.getRuntime().freeMemory();

Formatter.formatFileSize(BaseActivity.baseContext,Runtime.getRuntime().freeMemory()));//鏍煎紡鍖栬緭鍑?/p>

瀵逛簬緋葷粺heap鍐呭瓨鑾峰彇錛屽彲浠ラ氳繃Dalvik.VMRuntime綾葷殑getMinimumHeapSize() 鏂規(guī)硶鑾峰彇鏈灝忓彲鐢ㄥ爢鍐呭瓨錛屽悓鏃舵樉紺洪噴鏀捐蔣寮曠敤鍙互璋冪敤璇ョ被鐨刧cSoftReferences() 鏂規(guī)硶錛岃幏鍙栨洿澶氱殑榪愯鍐呭瓨銆?br />
4.瀵逛簬澶氱嚎紼嬬殑澶勭悊錛屽鏋滃茍鍙戠殑綰跨▼寰堝錛屽悓鏃舵湁棰戠箒鐨勫垱寤哄拰閲婃斁錛屽彲浠ラ氳繃concurrent綾葷殑綰跨▼姹犺В鍐崇嚎紼嬪垱寤虹殑鏁堢巼鐡墮銆?br />
5. 涓嶈鍦ㄥ驚鐜腑鍒涘緩榪囧鐨勬湰鍦板彉閲忋?/p>

3.

銆銆The default heap size of android3.0 is 48M.Large background pictrue,button icon and the other pictrues used as ui all consume memory,and even if you have entered another activity,the resource of the previous activity still be keeped.So you had better not use the big pictrue in UI.

銆銆鍦╫nDestroy涓細鐢?(BitmapDrawable)mBtn.getBackground()).setCallback(null)娓呯悊鑳屾櫙鍥俱傛寜閬撶悊鏉ヨ鍥劇墖璧勬簮搴旇宸茬粡娓呯悊鎺変簡鐨勩備粩緇嗙湅Bitmap鐨勬簮浠g爜錛屽畠鍏跺疄璧風殑浣滅敤鏄攢姣乯ava瀵硅薄BitmapDrawable錛岃?span style="color: #3366ff">android涓轟簡鎻愰珮鏁堢巼錛孊itmap鐪熸鐨勪綅鍥炬暟鎹槸鍦╪dk涓敤c鍐欑殑錛屾墍浠ョ敤setCallback鏄笉鑳介攢姣佷綅鍥炬暟鎹殑錛屽簲璇ヨ皟鐢˙itmap鐨剅ecycle()鏉ユ竻鐞嗗唴瀛樸?/span>鍦╫nDestroy鍔犱笂((BitmapDrawable)mBtn.getBackground()).getBitmap().recycle()錛岃繖鏍瘋窇涓嬫潵錛屽唴瀛樻儏鍐靛緢鐞嗘兂錛屼笉綆″湪鍝釜activity涓紝浣跨敤鐨勮祫婧愪粎浠呮槸褰撳墠activity鐢ㄥ埌鐨勶紝灝變笉浼氳薄涔嬪墠鍒版渶鍚庝竴涓猘ctivity鐨勬椂鍊欙紝鎵鏈変箣鍓嶄嬌鐢ㄧ殑璧勬簮閮界瘡縐湪鍐呭瓨涓?/span>

銆銆浣嗘柊鐨勯棶棰樺張鍑虹幇浜嗭紝褰撹繑鍥炰箣鍓嶇殑activity鏃訛紝浼氬嚭鐜?#8220;try to use a recycled bitmap"鐨勫紓甯搞傝繖鐪熸槸鎸変簡钁姦璧蜂簡鐡㈠晩錛屽唴蹇冮偅涓伯涓с傘傘傛病鍔炴硶錛岀戶緇垎鏋愩傜湅鏉ユ槸鍚庡姞涓妑ecycle寮曡搗鐨勶紝 浣嶅浘鑲畾鍦ㄥ唴瀛樹腑鏈夊紩鐢紝鍦ㄨ繑鍥炰箣鍓嶇殑activity鏃訛紝鍥犱負浣嶅浘鏁版嵁鍏跺疄宸茬粡琚攢姣佷簡錛屾墍浠ユ墠閫犳垚鐩墠鐨勬儏鍐點傚湪鐪嬩簡setBackgroundResource鐨勬簮鐮佷互鍚庯紝鎭嶇劧澶ф?zhèn)熷Q宎ndroid瀵逛簬鐩存帴閫氳繃璧勬簮id杞藉叆鐨勮祫婧愬叾瀹炴槸鍋氫簡cache鐨勪簡錛岃繖鏍蜂笅嬈″啀闇瑕佹璧勬簮鐨勬椂鍊欑洿鎺ヤ粠cache涓緱鍒幫紝榪欎篃鏄負鏁堢巼鑰冭檻銆備絾榪欐牱鍋氫篃閫犳垚浜嗙敤榪囩殑璧勬簮閮戒細鍦ㄥ唴瀛樹腑錛岃繖鏍風殑璁捐涓嶆槸寰堥傚悎浣跨敤浜嗗緢澶氬ぇ鍥劇墖璧勬簮鐨勫簲鐢紝榪欐牱绱Н涓嬫潵搴旂敤鐨勫唴瀛樺嘲鍊兼槸寰堥珮鐨勩傜湅浜唖dk鍚庯紝鎴戠敤錛?/p>

Bitmap bm = BitmapFactory.decodeResource(this.getResources(), R.drawable.splash);
BitmapDrawable bd = new BitmapDrawable(this.getResources(), bm);

mBtn.setBackgroundDrawable(bd);

鏉ヤ唬鏇縨Btn.setBackgroundResource(R.drawable.splash)銆?/p>

閿姣佺殑鏃跺欎嬌鐢細

BitmapDrawable bd 錛?(BitmapDrawable)mBtn.getBackground();

mBtn.setBackgroundResource(0);//鍒繕浜嗘妸鑳屾櫙璁句負null錛岄伩鍏峯nDraw鍒鋒柊鑳屾櫙鏃跺欏嚭鐜皍sed a recycled bitmap閿欒

bd.setCallback(null);
bd.getBitmap().recycle();

榪欐牱璋冩暣鍚庯紝閬垮厤浜嗗湪搴旂敤閲岀紦瀛樻墍鏈夌殑璧勬簮錛岃妭鐪佷簡瀹濊吹鐨勫唴瀛橈紝鑰屽叾瀹炶繖鏍蜂篃涓嶄細閫犳垚澶ぇ鏁堢巼闂錛屾瘯绔熼噸鏂拌澆鍏ヨ祫婧愭槸闈炲父蹇燂紝涓嶄細瀵規(guī)ц兘閫犳垚寰堜弗閲嶇殑褰卞搷錛屽湪xoom閲屾垜娌℃湁鎰熷彈鍒板拰涔嬪墠鏈変粈涔堝尯鍒?/p>

鎬諱箣錛屽湪android涓婁嬌鐢ㄥぇ閲忎綅鍥炬槸涓瘮杈冪棝鑻︾殑浜嬶紝鍐呭瓨闄愬埗鐨勫瓨鍦ㄥ搴旂敤鏄釜寰堝ぇ鐨勭摱棰堛備絾涓嶇敤鍥犲檸璐歸錛屽叾瀹炲紕鏄庣櫧浜嗗畠閲岄潰鐨勬満鍒訛紝搴旂敤鍙互紿佺牬榪欎簺闄愬埗鐨勩傝繖鍙槸鍏朵腑鐨勪竴縐嶅鐞嗘柟娉曪紝榪樺彲浠ヨ冭檻B(tài)itmapFactory.Options鐨刬nSampleSize鏉ュ噺灝戝唴瀛樺崰鐢ㄣ?/p>

嫻忚澶у浘鐨勫簲鐢紝鍙互浣跨敤JNI鐨勬柟娉曞姞杞藉浘鐗?/span>



寮曠敤:http://www.cnblogs.com/qiengo/archive/2012/04/25/2468372.html

]]>
淇敼android4.0 Launcher2 妗岄潰鐨勫垪鏁幫紝琛屾暟http://www.tkk7.com/zygcs/archive/2012/09/25/388538.html榫氭た娣?/dc:creator>榫氭た娣?/author>Tue, 25 Sep 2012 13:14:00 GMThttp://www.tkk7.com/zygcs/archive/2012/09/25/388538.htmlhttp://www.tkk7.com/zygcs/comments/388538.htmlhttp://www.tkk7.com/zygcs/archive/2012/09/25/388538.html#Feedback2http://www.tkk7.com/zygcs/comments/commentRss/388538.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/388538.html
浠婂ぉ闇瑕佺粰瀹㈡埛淇敼妗岄潰鐨勫浘鏍囨帓鍒楁柟娉曪紝緗戜笂鎼滀簡濂藉璧勬枡錛岄兘鏄潙鐖圭殑娌$敤鐨勶紝鍗冮亶涓寰嬪埌澶勬妱琚殑銆?br />鍙ソ鑺辯偣綺懼姏鐪嬬湅android婧愪唬鐮侊紝


  packages/apps/Launcher2/src/com/android/launcher2/Workspace.java

    private static final int DEFAULT_CELL_COUNT_X = 6;  //   鍒楁暟
    private static final int DEFAULT_CELL_COUNT_Y = 4;  //      琛屾暟

淇敼DEFAULT_CELL_COUNT_X錛孌EFAULT_CELL_COUNT_Y 鍗沖彲銆?img src ="http://www.tkk7.com/zygcs/aggbug/388538.html" width = "1" height = "1" />

]]>
ubuntu10.04 浣跨敤 QThttp://www.tkk7.com/zygcs/archive/2012/09/17/387879.html榫氭た娣?/dc:creator>榫氭た娣?/author>Mon, 17 Sep 2012 03:44:00 GMThttp://www.tkk7.com/zygcs/archive/2012/09/17/387879.htmlhttp://www.tkk7.com/zygcs/comments/387879.htmlhttp://www.tkk7.com/zygcs/archive/2012/09/17/387879.html#Feedback0http://www.tkk7.com/zygcs/comments/commentRss/387879.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/387879.html
sudo aptitude install libqt3-headers libqt3-mt-dev libqt3-compat-headers  libqt3-mt




]]>
ubuntu 鎭㈠gnome-panelhttp://www.tkk7.com/zygcs/archive/2012/08/04/384753.html榫氭た娣?/dc:creator>榫氭た娣?/author>Sat, 04 Aug 2012 03:59:00 GMThttp://www.tkk7.com/zygcs/archive/2012/08/04/384753.htmlhttp://www.tkk7.com/zygcs/comments/384753.htmlhttp://www.tkk7.com/zygcs/archive/2012/08/04/384753.html#Feedback0http://www.tkk7.com/zygcs/comments/commentRss/384753.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/384753.html 

Ubuntu閲嶅惎panel 鐨勫姙娉?

璧烽榪涘叆緇堢錛?渚濇杈撳叆浠ヤ笅鍙蜂護
1銆乬conftool --recursive-unset /apps/panel
2銆乺m -rf ~/.gconf/apps/panel
3銆乸kill gnome-panel

鎭㈠鏀墮泦緇忕鍥炬爣
vi /etc/NetworkManager/nm-system-settings.conf
鎵懼埌濡備笅琛岋細
managed=false
騫舵壒鏀逛負錛?br />managed=true


 



]]>
webview 鎶ndroid.database.sqlite.SQLiteCantOpenDatabaseExceptionhttp://www.tkk7.com/zygcs/archive/2012/07/02/382023.html榫氭た娣?/dc:creator>榫氭た娣?/author>Mon, 02 Jul 2012 12:11:00 GMThttp://www.tkk7.com/zygcs/archive/2012/07/02/382023.htmlhttp://www.tkk7.com/zygcs/comments/382023.htmlhttp://www.tkk7.com/zygcs/archive/2012/07/02/382023.html#Feedback0http://www.tkk7.com/zygcs/comments/commentRss/382023.htmlhttp://www.tkk7.com/zygcs/services/trackbacks/382023.html
07-02 19:47:38.950: E/SQLiteDatabase(969): Failed to open the database. closing it.
07-02 19:47:38.950: E/SQLiteDatabase(969): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1013)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:962)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1043)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1036)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:778)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:215)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.webkit.WebViewDatabase.initDatabase(WebViewDatabase.java:223)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.webkit.WebViewDatabase.init(WebViewDatabase.java:209)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.webkit.WebViewDatabase.access$000(WebViewDatabase.java:38)
07-02 19:47:38.950: E/SQLiteDatabase(969):  at android.webkit.WebViewDatabase$1.run(WebViewDatabase.java:190)
07-02 19:47:38.950: W/dalvikvm(969): threadid=12: thread exiting with uncaught exception (group=0x409e01f8)
07-02 19:47:38.970: E/AndroidRuntime(969): FATAL EXCEPTION: Thread-103
07-02 19:47:38.970: E/AndroidRuntime(969): java.lang.NullPointerException
07-02 19:47:38.970: E/AndroidRuntime(969):  at android.webkit.WebViewDatabase.initDatabase(WebViewDatabase.java:231)
07-02 19:47:38.970: E/AndroidRuntime(969):  at android.webkit.WebViewDatabase.init(WebViewDatabase.java:209)
07-02 19:47:38.970: E/AndroidRuntime(969):  at android.webkit.WebViewDatabase.access$000(WebViewDatabase.java:38)
07-02 19:47:38.970: E/AndroidRuntime(969):  at android.webkit.WebViewDatabase$1.run(WebViewDatabase.java:190)
07-02 19:47:38.970: W/ActivityManager(144):   Force finishing activity com.jw.Advertisement/.ADVActivity

鎯充簡寰堜箙涓嶇煡閬撴槸鍝噷鐨勯棶棰樸?br />鍚庢潵鎶婂師鏉ョ殑APK鍒犻櫎錛?閲嶆柊瀹夎APK 錛屽眳鐒跺ソ浜嗐?img src ="http://www.tkk7.com/zygcs/aggbug/382023.html" width = "1" height = "1" />

]]>
主站蜘蛛池模板: 免费毛片网站在线观看| 亚洲女同成av人片在线观看| 亚洲短视频男人的影院| 色爽黄1000部免费软件下载| 永久中文字幕免费视频网站| 亚洲午夜电影一区二区三区| 最近中文字幕2019高清免费| 色婷婷六月亚洲婷婷丁香| 久久九九久精品国产免费直播| 亚洲成a人一区二区三区| 色www免费视频| 亚洲精品国产自在久久| xxxxx做受大片视频免费| 午夜影院免费观看| 国产美女精品视频免费观看 | 免费AA片少妇人AA片直播| 亚洲人成电影亚洲人成9999网| 99久久人妻精品免费一区| 国产女高清在线看免费观看| 亚洲国产成人AV网站| 亚洲av中文无码| 91精品成人免费国产| 久久精品国产亚洲AV网站| 在线观看免费av网站| 亚洲sss综合天堂久久久| 成在线人永久免费视频播放| 亚洲国产精品一区| 8x8x华人永久免费视频| 亚洲国产日韩女人aaaaaa毛片在线 | 亚洲国产精品丝袜在线观看| 好吊色永久免费视频大全| 久久精品九九亚洲精品天堂| 精品亚洲成A人在线观看青青| 国产免费黄色大片| 国产精品无码免费专区午夜 | 久久伊人久久亚洲综合| 777爽死你无码免费看一二区| 亚洲中文字幕久久精品无码VA| 97精品免费视频| 亚洲资源最新版在线观看| 免费大香伊蕉在人线国产|