??xml version="1.0" encoding="utf-8" standalone="yes"?>BlogJava-Java,J2EE,Weblogic,Oraclehttp://www.fpcwrs.live/zygcs/java目随笔zh-cnSun, 25 Aug 2019 23:20:53 GMTSun, 25 Aug 2019 23:20:53 GMT60 收藏 JNI串口通信多文件调用时异常http://www.fpcwrs.live/zygcs/archive/2013/03/05/396100.html龚椿?/dc:creator>龚椿?/author>Tue, 05 Mar 2013 11:26:00 GMThttp://www.fpcwrs.live/zygcs/archive/2013/03/05/396100.htmlhttp://www.fpcwrs.live/zygcs/comments/396100.htmlhttp://www.fpcwrs.live/zygcs/archive/2013/03/05/396100.html#Feedback0http://www.fpcwrs.live/zygcs/comments/commentRss/396100.htmlhttp://www.fpcwrs.live/zygcs/services/trackbacks/396100.html阅读全文

]]>
launcher修改--修改launcher的屏q数http://www.fpcwrs.live/zygcs/archive/2013/02/25/395699.html龚椿?/dc:creator>龚椿?/author>Mon, 25 Feb 2013 07:07:00 GMThttp://www.fpcwrs.live/zygcs/archive/2013/02/25/395699.htmlhttp://www.fpcwrs.live/zygcs/comments/395699.htmlhttp://www.fpcwrs.live/zygcs/archive/2013/02/25/395699.html#Feedback0http://www.fpcwrs.live/zygcs/comments/commentRss/395699.htmlhttp://www.fpcwrs.live/zygcs/services/trackbacks/395699.html首先Q在Launcher.java代码中,W?25?/span>

  1. static final int SCREEN_COUNT = 5;  
  2. static final int DEFAULT_SCREEN = 2;//W一|?开始计敎ͼq里是把W三个页面作为默认首?nbsp; 

W一个参数定义屏q个敎ͼW一个参数是默认的首c在q里Q你可以做出自己的修攏V但是,仅这点修改,q远不够Q我们看一下launcher.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>  

我们可以看到 导入了五个workspace_screenQ在q里Q参照你上面修改的参敎ͼd或者删除workspace_screen。在q里Q你可能也注意到?/span>

  1. launcher:defaultScreen="2">  

在这里定义的defaultScreen?/span>

同时Q要修改workspace.java?80

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

和res/xml文g中default_workspace做出相应的修攏V这样就基本上可以了?/span>



]]>
android jni之C ?C++ 函数实现的比?/title><link>http://www.fpcwrs.live/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.fpcwrs.live/zygcs/archive/2013/01/30/394953.html</guid><wfw:comment>http://www.fpcwrs.live/zygcs/comments/394953.html</wfw:comment><comments>http://www.fpcwrs.live/zygcs/archive/2013/01/30/394953.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.fpcwrs.live/zygcs/comments/commentRss/394953.html</wfw:commentRss><trackback:ping>http://www.fpcwrs.live/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>代码Q?/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>~译错误提示Q?/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>注意Qjni.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)->”作前~Q目的是Z取出函数指针所引用的倹{?/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 cL有处理函数指针查扄内联成员函数?/p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">下面说明这个细微的差异Q其中,q两行代码访问同一函数Q但每种语言都有各自的语法?/p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">C 语法Qjsize len = (*env)->GetArrayLength(env,array);</p><p style="margin: 0px; padding: 0px; color: #454545; font-family: Tahoma, Helvetica, Arial, STHeiti; background-color: #ffffff; ">C++ 语法Qjsize len =env->GetArrayLength(array);</p><img src ="http://www.fpcwrs.live/zygcs/aggbug/394953.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.fpcwrs.live/zygcs/" target="_blank">龚椿?/a> 2013-01-30 18:44 <a href="http://www.fpcwrs.live/zygcs/archive/2013/01/30/394953.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ANR时旉的定?.http://www.fpcwrs.live/zygcs/archive/2012/11/27/392094.html龚椿?/dc:creator>龚椿?/author>Tue, 27 Nov 2012 13:15:00 GMThttp://www.fpcwrs.live/zygcs/archive/2012/11/27/392094.htmlhttp://www.fpcwrs.live/zygcs/comments/392094.htmlhttp://www.fpcwrs.live/zygcs/archive/2012/11/27/392094.html#Feedback0http://www.fpcwrs.live/zygcs/comments/commentRss/392094.htmlhttp://www.fpcwrs.live/zygcs/services/trackbacks/392094.htmlANR时旉的定?/span>

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

1.       broadcast时旉?/span>10U?/span>

static final int BROADCAST_TIMEOUT = 10*1000;

2.       按键无响应的时旉?/span>5U?/span>

    static final int KEY_DISPATCHING_TIMEOUT = 5*1000;



]]>
Android~程之解决android-support-v4打包问题http://www.fpcwrs.live/zygcs/archive/2012/10/13/389516.html龚椿?/dc:creator>龚椿?/author>Sat, 13 Oct 2012 11:06:00 GMThttp://www.fpcwrs.live/zygcs/archive/2012/10/13/389516.htmlhttp://www.fpcwrs.live/zygcs/comments/389516.htmlhttp://www.fpcwrs.live/zygcs/archive/2012/10/13/389516.html#Feedback0http://www.fpcwrs.live/zygcs/comments/commentRss/389516.htmlhttp://www.fpcwrs.live/zygcs/services/trackbacks/389516.html如果工程引入了Android-support-v4的jarcdQ那么在工程打包hӞ׃出现报错提示。例如提CZQYou may need to specify additional library jars (using '-libraryjars')?/p>

q里先给x案,E后我们再来解释如何处理cM情况Q?/p>

在proguard.cfg里的后面Q添加如下内容:

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  然后你再打包看看Q应该可以正常生成apk安装包了?/p>

打包出错Q?br />情况一Q?br /> "c? can't find referenced class c?" 字面上的意思就是类1找不到类2的引用;它会你:"You may need to specify additional library jars (using '-libraryjars').";
需要?libraryjars加上目中用到的第三方库就OK了?br />例如Q?libraryjars /android-support-v4.jar
注意Q这里引用方式是当前工程的根目录Q也可以配置其他目录Q,也就是说Q你要把W三方jar攑ֈ当前目录下,否则׃警告说找不到jar文gQ?/p>

情况二:
例如Q?can't find superclass or interface android.os.Parcelable$ClassLoaderCreatorQ碰到这L情况Q可以?dontwarn com.xx.yy.**Q不寚w误提告?br />注意Q用这个方式的话,要确保自己没有用到这个库里面的类Q否则就会抛ClassNotFoundExceptionQ?/p>

情况三:
在工E中实用到了该c,采用上面方式q是不行。这个时候就要再增加一:-keep class com.xx.yy.** { *;}Q让当前cMh?/p>

结Q?br />对于引用W三方包的情况,可以采用下面方式避免打包出错Q?br />-libraryjars /aaa.jar
-dontwarn com.xx.yy.**
-keep class com.xx.yy.** { *;}

最后打包成功,q要在机子上跑跑Q看看有没有问题?br />



原文链接Q?a href="http://www.linuxidc.com/Linux/2012-07/66798.htm">http://www.linuxidc.com/Linux/2012-07/66798.htm

]]>
android Memory Management, OutOfMemoryError Notehttp://www.fpcwrs.live/zygcs/archive/2012/09/29/388847.html龚椿?/dc:creator>龚椿?/author>Sat, 29 Sep 2012 07:53:00 GMThttp://www.fpcwrs.live/zygcs/archive/2012/09/29/388847.htmlhttp://www.fpcwrs.live/zygcs/comments/388847.htmlhttp://www.fpcwrs.live/zygcs/archive/2012/09/29/388847.html#Feedback0http://www.fpcwrs.live/zygcs/comments/commentRss/388847.htmlhttp://www.fpcwrs.live/zygcs/services/trackbacks/388847.html1 

 

   Android框架强制每个q程?4 MB内存限制。在一些旧的设备,如在G1Q限制ؓ16 MB 更低Q更重要的是Q由位图使用的内存限制。处理图像的应用E序Q它是很Ҏ辑ֈ此限Ӟq获得与OOM 异常M 的过E:E / dalvikvm堆(12517Q:1048576字节外部分配q个 q程中过大的E / GraphicsJNIQ?2517Q: VM不会让我们分配1048576字节 / AndroidRuntimeQ?2517Q:关闭VM / dalvikvmQ?2517Q:主题ID = 1Q线E未捕获的异帔R出(集团= 0x4001d7f0 Q?E / AndroidRuntimeQ?2517Q:致命异常Q主?电子/ AndroidRuntimeQ?2517Q:java.lang.OutOfMemoryErrorQ位囄大小过VM的预?Q这个限制是低得谱 。设备,?12MB的物理RAM的Nexus之一Q设|每个进E的前台zd只有5Q的RAM的内存限制是一个愚蠢的错误 。但无论如何Q事情是如何和我们生z?x到如何解军_?/font>

q远过限制的内存分配方式有两种 Q?/font>

  一U方法是从本Z码分配内?。用NDKQ本地开发工具包Q和JNIQ它可能从CU(如的malloc / free或新?删除Q分配内存,q样的分配是不计入对24 MB的限?。这是真的,从本Z码分配内存是ZJava方便Q但它可以被用来存储在RAM中的数据Q即使图像数据)的一些大金额 ?/font>

  另一U方式,其中的作品以及图像的Q是使用OpenGL的纹?U理内存不计入限?/span> Q要查看您的应用E序实分配多少内存可以使用android.os.Debug.getNativeHeapAllocatedSizeQ?Q?/span>Q可以用上面介l的两种技术的Nexus之一Q我可以LCؓ一个单一的前台进E分?00MB - 10倍以上的默认24 MB的限?Q从上面来看使用navtive代码分配内存是不?4MB的限制内?/span>Q开攄GL的质C是用navtive代码分配内存的) ?/font>

  每个 android q_内存限制不一P从最开始的 16M ?24MQ以及后来的 32MQ?4MQ或总后会更大?/p>

  那如何获取单?app 内存限制大小呢?

  class : ActivityManager

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

  当然QActivityManager 不单单限与此Q许多对 android E序理的工P都来源与此,或者从q里q行扩展?/span> 

 


android不同讑֤单个q程可用内存是不一LQ可以查?system/build.prop文g?/span>

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

heapsize参数表示单个q程可用的最大内存,?/span>如果存在如下参数Q?/p>

dalvik.vm.heapgrowthlimit=48m表示单个q程内存被限定在48m,即程序运行过E中实际只能使用48m内存

android上的应用是javaQ当焉要虚拟机Q而android上的应用是带有独立虚拟机的,也就是每开一个应用就会打开一个独立的虚拟机。这栯计的原因是可以避免虚拟机崩溃D整个pȝ崩溃Q但代h是需要更多内存?span>以上q些设计保了android的稳定性,正常情况下最多单个程序崩溃,但整个系l不会崩溃,也永q没有内存不的提示出现?/span>


 在Android中,一个Process 只能使用16M内存Q?Q,要是过了这个限定就会蟩个异?/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.

卻Ibitmap.recycle();

  biamap=null;

效果要好?/p>

  biamap=null;

  system.gc();

通过DDMS中的Heap选项卡监视内存情况:

1.Heap视图中部有一个Type叫做data objectQ即数据对象Q也是我们的程序中大量存在的类cd的对象?/p>

2.在data object一行中有一列是“Total Size”Q其值就是当前进E中所有Java数据对象的内存总量?/p>

如果代码中存在没有释攑֯象引用的情况Q则data object的Total Size值在每次GC后不会有明显的回落,随着操作ơ数的增多Total Size的g来大Q?br />  直到到达一个上限后Dq程被kill掉?/p>

2  今天刚遇到的情况Q发现gridview的getview中?/span>

复制代码
    @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;
        }
复制代码

 

滑动时内存会不断涨,直到OutOfMemoryQ用Holder后便不会发生该请况,具体原因未仔l查找,标记一下?/p>

 1.对于常规开发者而言需要了?Java的四U引用方式,比如强引用,软引用,弱引用以及虚引用。一些复杂些的程序在长期q行很可能出现类似OutOfMemoryError的异常?br />
2.q不要过多的指望gcQ不用的对象可以昄的设|ؓI,比如obj=nullQjava的gc使用的是一个有向图Q判断一个对象是否有效看的是其他的对象能到达q个对象的顶点,有向囄相对于链表、二叉树来说开销是可惌知?br />
3.Android为每个程序分配的对内存可以通过RuntimecȝtotalMemory() freeMemory() 两个Ҏ获取VM的一些内存信息,

Runtime.getRuntime().freeMemory();

Formatter.formatFileSize(BaseActivity.baseContext,Runtime.getRuntime().freeMemory()));//格式化输?/p>

对于pȝheap内存获取Q可以通过Dalvik.VMRuntimecȝgetMinimumHeapSize() Ҏ获取最可用堆内存Q同时显C释放Y引用可以调用该类的gcSoftReferences() ҎQ获取更多的q行内存?br />
4.对于多线E的处理Q如果ƈ发的U程很多Q同时有频繁的创建和释放Q可以通过concurrentcȝU程池解决线E创建的效率瓉?br />
5. 不要在@环中创徏q多的本地变量?/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.

  在onDestroy中会?(BitmapDrawable)mBtn.getBackground()).setCallback(null)清理背景图。按道理来说囄资源应该已经清理掉了的。仔l看Bitmap的源代码Q它其实L作用是销毁java对象BitmapDrawableQ?span style="color: #3366ff">androidZ提高效率QBitmap真正的位图数据是在ndk中用c写的Q所以用setCallback是不能销毁位图数据的Q应该调用Bitmap的recycle()来清理内存?/span>在onDestroy加上((BitmapDrawable)mBtn.getBackground()).getBitmap().recycle()Q这栯下来Q内存情况很理想Q不在哪个activity中,使用的资源仅仅是当前activity用到的,׃会象之前到最后一个activity的时候,所有之前用的资源都篏U在内存中?/span>

  但新的问题又出现了,当返回之前的activityӞ会出?#8220;try to use a recycled bitmap"的异常。这真是按了葫芦起了瓢啊Q内心那个沮丧。。。没办法Ql分析。看来是后加上recycle引v的, 位图肯定在内存中有引用,在返回之前的activityӞ因ؓ位图数据其实已经被销毁了Q所以才造成目前的情c在看了setBackgroundResource的源码以后,恍然大悟Qandroid对于直接通过资源id载入的资源其实是做了cache的了Q这样下ơ再需要此资源的时候直接从cache中得刎ͼq也是ؓ效率考虑。但q样做也造成了用q的资源都会在内存中Q这L设计不是很适合使用了很多大囄资源的应用,q样累积下来应用的内存峰值是很高的。看了sdk后,我用Q?/p>

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

mBtn.setBackgroundDrawable(bd);

来代替mBtn.setBackgroundResource(R.drawable.splash)?/p>

销毁的时候用:

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

mBtn.setBackgroundResource(0);//别忘了把背景设ؓnullQ避免onDrawh背景时候出现used a recycled bitmap错误

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

q样调整后,避免了在应用里缓存所有的资源Q节省了宝贵的内存,而其实这样也不会造成太大效率问题Q毕竟重新蝲入资源是非常快速,不会Ҏ能造成很严重的影响Q在xoom里我没有感受到和之前有什么区别?/p>

MQ在android上用大量位图是个比较痛苦的事,内存限制的存在对应用是个很大的瓶颈。但不用因噎贚wQ其实弄明白了它里面的机Ӟ应用可以H破q些限制的。这只是其中的一U处理方法,q可以考虑BitmapFactory.Options的inSampleSize来减内存占用?/p>

览大图的应用,可以使用JNI的方法加载图?/span>



引用:http://www.cnblogs.com/qiengo/archive/2012/04/25/2468372.html

]]>
修改android4.0 Launcher2 桌面的列敎ͼ行数http://www.fpcwrs.live/zygcs/archive/2012/09/25/388538.html龚椿?/dc:creator>龚椿?/author>Tue, 25 Sep 2012 13:14:00 GMThttp://www.fpcwrs.live/zygcs/archive/2012/09/25/388538.htmlhttp://www.fpcwrs.live/zygcs/comments/388538.htmlhttp://www.fpcwrs.live/zygcs/archive/2012/09/25/388538.html#Feedback2http://www.fpcwrs.live/zygcs/comments/commentRss/388538.htmlhttp://www.fpcwrs.live/zygcs/services/trackbacks/388538.html
今天需要给客户修改桌面的图标排列方法,|上搜了好多资料Q都是坑爹的没用的,千遍一律到处抄袭的?br />只好q_֊看看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_XQDEFAULT_CELL_COUNT_Y 卛_?img src ="http://www.fpcwrs.live/zygcs/aggbug/388538.html" width = "1" height = "1" />

]]>
ubuntu10.04 使用 QThttp://www.fpcwrs.live/zygcs/archive/2012/09/17/387879.html龚椿?/dc:creator>龚椿?/author>Mon, 17 Sep 2012 03:44:00 GMThttp://www.fpcwrs.live/zygcs/archive/2012/09/17/387879.htmlhttp://www.fpcwrs.live/zygcs/comments/387879.htmlhttp://www.fpcwrs.live/zygcs/archive/2012/09/17/387879.html#Feedback0http://www.fpcwrs.live/zygcs/comments/commentRss/387879.htmlhttp://www.fpcwrs.live/zygcs/services/trackbacks/387879.html
sudo aptitude install libqt3-headers libqt3-mt-dev libqt3-compat-headers  libqt3-mt




]]>
ubuntu 恢复gnome-panelhttp://www.fpcwrs.live/zygcs/archive/2012/08/04/384753.html龚椿?/dc:creator>龚椿?/author>Sat, 04 Aug 2012 03:59:00 GMThttp://www.fpcwrs.live/zygcs/archive/2012/08/04/384753.htmlhttp://www.fpcwrs.live/zygcs/comments/384753.htmlhttp://www.fpcwrs.live/zygcs/archive/2012/08/04/384753.html#Feedback0http://www.fpcwrs.live/zygcs/comments/commentRss/384753.htmlhttp://www.fpcwrs.live/zygcs/services/trackbacks/384753.html 

Ubuntu重启panel 的办?

起首q入l端Q?依次输入以下号o
1、gconftool --recursive-unset /apps/panel
2、rm -rf ~/.gconf/apps/panel
3、pkill gnome-panel

恢复攉l管图标
vi /etc/NetworkManager/nm-system-settings.conf
扑ֈ如下行:
managed=false
q批改ؓQ?br />managed=true


 



]]>
webview 报android.database.sqlite.SQLiteCantOpenDatabaseExceptionhttp://www.fpcwrs.live/zygcs/archive/2012/07/02/382023.html龚椿?/dc:creator>龚椿?/author>Mon, 02 Jul 2012 12:11:00 GMThttp://www.fpcwrs.live/zygcs/archive/2012/07/02/382023.htmlhttp://www.fpcwrs.live/zygcs/comments/382023.htmlhttp://www.fpcwrs.live/zygcs/archive/2012/07/02/382023.html#Feedback0http://www.fpcwrs.live/zygcs/comments/commentRss/382023.htmlhttp://www.fpcwrs.live/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删除Q?重新安装APK Q居然好了?img src ="http://www.fpcwrs.live/zygcs/aggbug/382023.html" width = "1" height = "1" />

]]>
ħǹ