杂项7



emulator 中变形 ,用dp 处理,判断错 
BroadcastReceiver 和
http://hi.baidu.com/worldofhua/blog/item/bb07bdfe2c24473c5d600866.html
http://mobile.51cto.com/android-223416_5.htm
http://www.cnblogs.com/hdjjun/archive/2010/06/02/1749863.html


Cursor  SQLiteDatabase
SQLiteOpenHelper A helper class to manage database creation and version management. 
SQLiteQueryBuilder


UriMatch
if (token.equals("#")) {
    child.mWhich = NUMBER;
} else if (token.equals("*")) {
    child.mWhich = TEXT;
} else {
    child.mWhich = EXACT;
}
Uri 
getQueryParameter(String key)
getLastPathSegment()
qBuilder.appendWhere("_id=" + uri.getLastPathSegment());


http://www.u148.net/article/1327.html
RPG=Role-playing Game:角色扮演游戏 
ACT=Action Game:动作游戏 
AVG=Adventure Game:冒险游戏 
与RPG不同的是,AVG的特色是故事情节往往是以完成一个任务或解开某些迷题的形式出现的,而且在游戏过程中刻意强调谜题的重要性。
SLG=Simulation Game:策略游戏  策略游戏可分为回合制和即时制两种,
RTS=Real-Time Strategy Game:即时战略游戏  即时战术游戏”,多以控制一个小队完成任务的方式,突出战术的作用
FTG=Fighting Game:格斗游戏 
STG= Shooting Game:射击类游戏 
FPS=First Personal Shooting Game:第一人称视角射击游戏 
严格来说它是属于动作游戏的一个分支,但和RTS一样
PZL=Puzzle Game:益智类游戏 
RCG=Racing Game:竞速游戏[也有称作为RAC的] 
CAG=Card Game:卡片游戏 
TAB=Table Game:桌面游戏 
MSC=Music Game∶音乐游戏 




//Activity 转为 View  
Window subActivity = getLocalActivityManager().startActivity(  
  "subActivity", intent);  
//容器添加View  
container.addView(subActivity.getDecorView(),  
  LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); 
可以在任何一个子view 里面 显示,包含popup window 
  ActivityGroup LocalActivityManager
  


  




          
 


  用popup window ,和 frame view 来模拟 菜单,对话框
  SystemServer 是 Android JAVA 层的系统服务模块,这个模块主要功能就是管理供 Android 应用开发的 system service.
   zygote 进程启动的同时启动 SystemServer 
   


 
http://flysnow.iteye.com/blog/828415
  EditView 类型 一共有三种分别为integer(正整数)、signed(带符号整数)和decimal(浮点数)。


   actionDone 完成,对应常量EditorInfo.IME_ACTION_DONE 效果




writeFeedBack 封装一下好啊




Cursor query (boolean distinct, String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit)
不需要写sql ,OD mapping  。


http://www.iteye.com/problems/39047
web.setBackgroundColor(0); 




http://www.eoeandroid.com/thread-8133-1-1.html
Android 各种音量的获取和设置 


MediaPlayer
AudioManager 
使用
 DTMF (Dual Tone Multiple Frequencies)  tones 双音多频
 


 


 progressbar stytle
 ?
 A style attribute resource allows you to reference the value of an attribute in the currently-applied theme
 Referencing a style attribute essentially says, "use the style that is defined by this attribute, in the current theme."
 ?[<package_name>:][<resource_type>/]<resource_name>  refer Style ,resource_type must style 
 indeterminate
         style="?android:attr/progressBarStyleHorizontal"
         android:textColor="?android:textColorSecondary"
         
        <!-- Secondary text color. -->
        <attr name="textColorSecondary" format="reference|color" />
        
        style 也可以应用
          define format="enum" attribute        
  http://stackoverflow.com/questions/3160974/referencing-enumerated-style-attributes-from-xml-in-android
TypedArray obtainStyledAttributes(
            AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) 
    com.android.internal.R.attr.textViewStyle 只是一个属性, 具体的style 其实 在 theme 里面定义       
          * @param set The base set of attribute values.  May be null.
         * @param attrs The desired attributes to be retrieved.
         * @param defStyleAttr An attribute in the current theme that contains a
         *                     reference to a style resource that supplies
         *                     defaults values for the StyledAttributes.  Can be
         *                     0 to not look for defaults.
         * @param defStyleRes A resource identifier of a style resource that
         *                    supplies default values for the StyledAttributes,
         *                    used only if defStyleAttr is 0 or can not be found
         *                    in the theme.  Can be 0 to not look for defaults.           
            
 attri define          <!-- Horizontal ProgressBar style. This is a horizontal progress bar. -->
         <attr name="progressBarStyleHorizontal" format="reference" />
          android:progressDrawable="@color/level_progress"
         
          we can use style 
   
   theme.xml define 
    The default system theme.
   <style name="Theme">      
http://android.tgbus.com/Android/tutorial/201103/346634.shtml
http://limingnihao.iteye.com/category/131144?show_full=true    




http://henzil.easymorse.com/?p=364
theme 种类


android resource
http://since2006.com/android/2.1-drawables.php


 <style name="Theme.Dialog">
 389         <item name="android:windowFrame">@null</item>
 390         <item name="android:windowTitleStyle">@android:style/DialogWindowTitle</item>
 391         <item name="android:windowBackground">@android:drawable/panel_background</item>
 392         <item name="android:windowIsFloating">true</item>
 393         <item name="android:windowContentOverlay">@null</item>
 394         <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
 395         <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>


google android system  icon
http://www.iconspedia.com/icon/google-android--738.html


menu design ,why forget before code 


theme scheme


解决办法之一:eclipse -> window -> Preferences -> Android -> 
DDMS -> ADB connection time out(ms).把这个时间设置的长一些,默认是5秒




float window why need set background new drawable 


mWindowManager.addView(mPopupView, p);


webview 
http://apps.hi.baidu.com/share/detail/17288809
http://localhost:8080/notice/main.php




why webview show error encode , cache ? need no use cache
css file 




24 个线程,webview ,http and asynTask 
5.8M ,用掉 4 M  
实践知识,具体度量,便于掌握度。


http://androinica.com/2010/08/how-to-install-apps-to-the-sd-card-by-default-on-android-2-2-froyo/
adb shell pm setInstallLocation 2. 


mPopupWindow.update(); why
dismiss


PopupWindow#setBackgroundDrawable(new BitmapDrawable())
http://stackoverflow.com/questions/3121232/android-popup-window-dismissal






android style 
      
   <item name="android:colorBackgroundCacheHint">@null</item>
 <item name="android:windowBackground">@android:drawable/panel_background</item>
 
 dismiss
 
 html style ,only p can set align . why 


 MAC OS X 做到极致
 
 imageMaxWidth 
 
 \n 处理
  
  
 06-08 12:57:55.906: ERROR/AndroidRuntime(992): java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams  




some time we need set para
bottomView.setLayoutParams(new ListView.LayoutParams(650,65));
2 has three bottom view




ZoomControls extends LinearLayout ,use frameView
        AlphaAnimation anim = new AlphaAnimation(startAlpha, endAlpha);
        anim.setDuration(500);
        startAnimation(anim);
        setVisibility(visibility);
        
        uncaughtexception
        
        oncreaete 
        
        Error handle
        why need register every 
        https://github.com/tomquist/Android-Error-Reporter
        http://stackoverflow.com/questions/601503/how-do-i-obtain-cr
        ash-data-from-my-android-application
        
06-08 15:40:09.646: DEBUG/AndroidRuntime(1895): Shutting down VM
06-08 15:40:09.646: WARN/dalvikvm(1895): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
06-08 15:40:09.686: INFO/AndroidRuntime(1895): AndroidRuntime onExit calling exit(0)
06-08 15:40:09.755: INFO/ActivityManager(61): Process com.javgame.goldisland (pid 1895) has died.
06-08 15:40:09.755: WARN/ActivityManager(61): Scheduling restart of crashed service com.javgame.goldisland/.service.MainService in 5000ms
06-08 15:40:09.777: INFO/WindowManager(61): WIN DEATH: Window{45102d50 com.javgame.goldisland/com.javgame.goldisland.MainActivity paused=false}




http://www.javaask.com/mobile/android/2011/0318/4037.html
android 程序错误处理        


http://code.google.com/p/android-send-me-logs/




adb shell dumpsys activity


一个概念错误,影响全部概念和推理


platform tool .need update adt.
when update adt ,update all 
,can not install plugin correctly 
reinstall 
feature ,update
android sdk page 
new feature and start SDK package 
学习 思路, search 


http://www.eoeandroid.com/thread-66487-1-1.html
 onSaveInstanceState
If called, this method will occur before onStop(). There are no guarantees about whether it will occur before or after onPause().
crash will not invoke it
onRestoreInstanceState (Bundle savedInstanceState)
This method is called between onStart() and onPostCreate(Bundle).


 onPostCreate (Bundle savedInstanceState) shuold named with postStart since it is invoke after onStrat
 after onStart() and onRestoreInstanceState(Bundle) ,normal appliction should not override it 
 onPostResume ()
 
 sdcard
 mksdcard 200M sdcard
 


  
  need define <T> before method .
  public  <T> T exitApp(Class<T> t) {
      Object a =null;
      return (T)a ;
  }
  String aa = exitApp(String.class);
  只定义泛型方法 ,前面要加一个 <T> ,定义 泛型类的名称
  


  progresscolor is  a layer list 
  
  2.3 以后 可以很方便的混淆Android代码了,
  http://blog.csdn.net/sodino/archive/2010/12/13/6072914.aspx
  


   
   drawable setbound .
   some drawable scale ,such as shape drawable .
   some drawable only set paint size (clip),such as Bitmap drawable .
   clipDrawable ,can clip all and int many type (gravity )


   Drawable 要用两个实例


   update ,invalid nomally not need manual invoke 
   
   Xfermode 
   http://blog.csdn.net/wylwhd/archive/2011/02/12/6180272.aspx
   
        //   generate a new bitmap through paint on canvas 
         Bitmap output = Bitmap
                .createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
        Canvas canvas = new Canvas(output);


//
        Matrix matrix = new Matrix();
        matrix.postScale(scale, scale);
        Bitmap scaledBmp = Bitmap.createBitmap(bmp, 0, 0, bmpW, bmpH, matrix, true);
        
        android:reqTouchScreen=["undefined" | "notouch" | "stylus" | 
                                            "finger"] />
                                            
                                            grant-uri-permission
                                            
     


why can not use inside   
audio manager 测试,分布,报错


crop find parameter 
porter duff color filter
Xfermode  PorterDuff.Mode
http://www.imobilebbs.com/wordpress/?p=1402
http://yueguc.iteye.com/blog/782494


Gradien 
RotateDrawable
drawable define 
colorDrawable ,embed color Drawable ( use color tag in other drawable ) and color difference ,define ,use 


长按home键时不出现activity的图标
就是不让图标显示在recent app list,
将manifest里对应activity的属性加上 android:excludeFromRecents="true"


9. 使用第三方apk打开pdf文件
private final String  pdf_file = "file:///sdcard/a.pdf" ;
private String data_type = "application/pdf".toLowerCase();
Uri uri= Uri.parse(pdf_file);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(uri,data_type );
startActivity(intent);


取安装
PackageManager manager = getPackageManager();
     Intent mainIntent = new Intent(Intent.ACTION_VIEW, null);
     mainIntent.setType(data_type );
        final List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);
        if (apps.size() == 0){
         Log.i("******", "no activity can open the file ");
         return  false;
        }




Android为每个程序分配的对内存可以通过Runtime类的totalMemory() freeMemory() 两个方法获取VM的一些内存信息,
对于系统heap内存获取,可以通过Dalvik.VMRuntime类的getMinimumHeapSize() 方法获取最小可用堆内存,同时显示释放软引用可以调用该类的


gcSoftReferences() 方法,获取更多的运行内存。


http://blog.csdn.net/zhanghw0917/category/692320.aspx


构建 Android 手机 RSS 阅读器
http://www.ibm.com/developerworks/cn/education/xml/x-androidrss/index.html
http://www.ibm.com/developerworks/xml/tutorials/x-androidrss/


conduct download manager ,register and manager status .


AssetFileDescriptor








06-14 17:05:51.035: WARN/CropImage(7428): CropImg mBitmap was null, retreive frm URIfile:///mnt/sdcard/dcim/Camera/2011-06-14_16-33-46_400.jpg




http://stackoverflow.com/questions/5709601/problem-with-com-android-camera-action-crop-on-motorola-defy


http://www.walletapp.net/crop-image




   
When I Use cropImage in android 2.2 emulator .
It throw below exception when I save crop image .
ERROR/AndroidRuntime(629): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@44fb6308
ERROR/AndroidRuntime(629):     at android.graphics.Canvas.throwIfRecycled(Canvas.java:955)


I move "mBitmap.recycle()"  from onPause() to onDestroy() method .
Then it work .


why crop image 


intermediate 中间的 
misnomer 不适当的名字






性能问题, 网络性能。
图片显示
缓存,系统缓存,
全局变量。
OOM 问题,赶不上打开新需求。
Android Issues


http://www.cnblogs.com/qwhg/archive/2010/09/13/1824965.html
那么其初始化堆最大大小应该就是16M,那么我们在网上查到了诸多关于解码图像超过8M就会出错的论断是如何得出来的呢?
为了确保我们外部分配内存成功,我们应该保证当前已分配的内存加上当前需要分配的内存值,大小不能超过当前堆的最大内存值


Android-避免出现bitmap内存限制OUT OF MEMORY的一种方法
http://disanji.net/2011/02/21/android-bitmap-out-of-memory/
手工释放
我们还可以预存储一些位置上的bitmap,比如存储显示区域位置外向上3个向下3个位置的bitmap




http://andynjux.blogbus.com/logs/71404520.html
java 施用内存 ,C 施用内存 ,这两个内存的和必需小于16M,一朝内存分配给Java后,以后这块内存纵然开释后,也只能给Java的施用,反正C就别想用到这块的内存了,
而Bitmap的生成是路程经过过程malloc进行内存分配的,占用的是C的内存




HttpClient
URLConnection connection = url.openConnection();
connection.setUseCaches(true);
http://hc.apache.org/httpcomponents-client-ga/tutorial/html/caching.html
but we can not use httpclient cache in android 
AndroidHttpClient  DefaultHttpClient
RequestLine
Httprequset entity。
httpresponse
Protocol schemes
Http 没有把connetion 暴露出来其实,关闭 response 的流,也就关闭connetion ,回到到connection manager了。
abort ,可以退出 
para and context 


http://stackoverflow.com/questions/2160619/android-ellipsize-multiline-textview


AMD Fusion Developer Summit
APU指的是加速处理器(Accelerated Processing Unit),是AMD近年推出的全新计算架构,其中结合了x86的CPU核心和GPU(图形处理单元)核心,能够充分利用擅长于串行处理、主频较高、运算能力更强的CPU,与擅长并行处理、能耗更低、核心数更多的GPU两者的长


处,是异构计算技术潮流的代表之一。由于通过增加CPU时钟频率和内核数量而提高计算能力的传统方式遇到了散热和能耗瓶颈,计算机业界近年来已经将进一步提升计算能力的关注点转移到GPU等专用计算单元身上。GPU虽然工作频率较低,但具有更多的内核数和并行计


算能力,总体性能-芯片面积比和性能-功耗比都很高,却长期远远没有得到充分利用。
此前微软在IE9发布时强调的硬件加速、充分利用PC的能力等等,其实说的也是如何用好GPU。


cancel image


private void brightnessMax() {    
     WindowManager.LayoutParams lp = getWindow().getAttributes();    
     lp.screenBrightness = 1.0f;    
     getWindow().setAttributes(lp);    
}   
screenBrightness这个值的范围为0-1。 0最暗,1最亮。这个值也可取小于0的值,表示使用用户首选的亮度值...
遮挡




seekbar 组件,修改比较麻烦,需要用点图片小技巧


BitmapDrawable 
setGravity(int gravity)
Set the gravity used to position/stretch the bitmap within its bounds.
void setTargetDensity(int density)






剪切出错,可以用其他进程跑这个activity ,用匿名activity 来包装?


android.provider.Settings 设置类,和设置action
http://stackoverflow.com/questions/5032588/cant-apply-screen-brightness-settings-programmatically-in-android
全黑问题,
颜色调节




FrameAnimation has no reset ,tween Animation has reset method
Drawable.Callback 
FrameAnimation use unscheduleDrawable(Drawable who, Runnable what) 
stop 


06-17 12:54:10.853: ERROR/dalvikvm-heap(4801): 278520-byte external allocation too large for this process.
06-17 12:54:10.853: ERROR/(4801): VM won't let us allocate 278520 bytes




HttpRoute


逻辑清楚,方法越小,越聚合越好,camera ,违法了这个规则。
优美


一个好的软件,更好的方法。
WIfi 和 timer ,最好是wifi 自动,语音播报,动态优化
中文RSS地址分类目录
http://getrss.org/cat.php?id=43
http://news.newhua.com/news/2010/1112/107892_2.shtml




weight 
wifi state 
http://stackoverflow.com/questions/2676044/broadcast-intent-when-network-state-has-changend
按100GB算的  SSD才100多MB/S
硬盘速度 104MB/S
USB 速度
一般都是100MB/S,盒子的接口也没问题,你的数据有了,就是USB2.0的接口速度,
最慢的是硬盘的内存传输速度,事实上现在所有的电脑瓶颈基本上都在这,CPU,内存的发展这么快,硬盘的发展跟上不了,
你所用的硬盘内总传输速度也就是400Mbit不到的样子也就是20M字节每秒
480M说的是USB总线的带宽. 不
这是由USB总线协议规定的.


协议规定 USB的总线带宽为共用, 有4种传输模式, 
1,中断方式, 16字节一包数据.
2.BuLK方式, 512 字节一包数据
3.同步方式, 1024字节一包数据
4.通讯方式,64字节一包数据


当前普通硬盘的读取速度大概是100M/S左右,而固态硬盘的读取速度则是250M/S。但是,这并不是指其速度仅为普通硬盘的2.5倍,值得指出的是:这里的读取速度是指连续读取速度,实际计算的时候,由于普通硬盘还有寻道时间等开销,所以实际上固态硬盘的读取速度


要达到普通硬盘的7~8倍以上。
USB2.0的最高传输速率为480Mbps,即60MB/s。不过,大家要注意这是理论传输值,如果几台设备共用一个USB通道,主控制芯片会对每台设备可支配的带宽进行分配、控制。


u盘一般都比内存卡的速度要快(高速卡除外),何况你还是放在手机里面的,等于你的手机当读卡器用,速度又慢了下来。一般普速的内存卡读取速度在6mb/s左右,写入速度在3mb/s左右,
但是U盘的读取速度在12mb/s左右,写入速度也在8mb/s左右,这个是行货的大概数据。
功能上是一样的,内存卡将存储芯片直接集成到PCB板上,成本更低。U盘也是如此,价格基本上稍微贵一点。不要直接接触那个黄色的金手指。
金手指(connecting finger)是内存条上与内存插槽之间的连接部件,所有的信号都是通过金手指进行传送的。金手指由众多金黄色的导电触片组成,
表面镀金而且导电触片排列如手指状,所以称为“金手指”
 
 闪存卡(Flash Card)是利用闪存(Flash Memory)技术达到存储电子信息的存储器
 、Secure Digital(SD卡)TransFlash  CF卡
 SDHC是“High Capacity SD Memory Card”的缩写,即“高容量SD存储卡”。2006年5月SD协会发布了最新版的SD 2.0的系统规范,在其中规定SDHC是符合新的规范、且容量大于2GB小于等于32GB的SD卡。
速度(读):15(MB/s) 
速度(写) :6~7(MB/s) 


WIFI模块都是b版本的,最快下行速度是4M bps




Http 性能
http://blog.csdn.net/hitustc/archive/2009/11/20/4843670.aspx




手机 说明书
豌豆荚 原理 创新
还是Adb  wifi 连接
通过adb 连接手机,能够操作手机


Zipalign 
http://www.hiapk.com/bbs/thread-45267-1-1.html




 
开放的另一面:从法庭材料解读 Google 如何控制硬件商
http://android.zone.it.sohu.com/forums/thread-5877400-1-1.html






http://en.wikipedia.org/wiki/List_of_Open_Source_Android_Applications
wansha 问题分析 ,冷静分析。
内存溢出的原因。
缓存,过快加载。






24pt
#622f00


http://byandby.iteye.com/blog/848299
相机拍照


jxta
http://technica.blogbus.com/logs/15909321.html
http://wenku.baidu.com/view/b6d3851fc5da50e2524d7f82.html




scrollView

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章