雜項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

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