創作

2015年6月15日 星期一

Android 資源優化紀錄

1.單例模式,可以減少記憶體使用量。(不用一直New)

2.Adapter 以ViewHolder去管控。

3.Bitmap 在移除之後,記得 bitmap.recycle();  (要注意時間點,recycle時間點錯誤,會出現 嘗試使用已移除的Bitmap 錯誤)


2015年6月4日 星期四

SQLite 語法紀錄


  1. 新增移除類:

    • 創建表單(沒有才創):
      • create table if not exists table_name ( column1 , column2 );
      • create table if not exists table_name column1 uniquecolumn2 char ); 
        • unique->唯一值,如果有相同,則不新增
    • 刪除表單:
      • drop table if exists table_name;
    • 新增欄位 (SQL不允許一次新增多個欄位,必須一個一個加):
      • alter table table_name add column column3 column_type

  2. 查詢類組:
    1. 表的所有內容:
      select * from table_name;
    2. 表內特定 column:
      select column_1,column_2 from albums;
    3. 表內特定column的名稱:(舉例,我要找這個表內 老師名稱內有 judy的所有資料)
      select * from table_name where teacher like 'judy%';


2015年5月28日 星期四

Android - File 取得檔案資訊

1.取得總容量(Api18)

 
File getfile=new File(android.os.Environment.getExternalStorageDirectory());
StatFs stat = new StatFs(getFile.getPath());        
long freeSize =  stat.getFreeBytes();//剩餘空間     
long totalbytess = stat.getTotalBytes();//總空間
System.out.println("@@@@ [FileCache] totalbytess:"+totalbytess);


2.取得外部SD卡/USB路徑
   參考連結
   Path = System.getenv("EXTERNAL_STORAGE_EXTSD");
   Path = System.getenv("EXTERNAL_STORAGE_USB1");

2015年5月27日 星期三

兩個禮拜的新生活

兩個禮拜工作,印證了前公司的不足,

不管是薪水方面,案子分工方面,制度方面,主管們的觀念方面,

前公司唯一贏的地方,就在於女生比較多.....= =


體檢報告,肝指數爆表,正常指數11-40,我爆到120。

好慘好慘,得好好養肝了。


怎麼說,目前過得很輕鬆,但是技術成長比在前公司快多了,

而這邊的同事,還不賴,有種二部的FU(現在也是二部)

美中不足的是找吃得好難找阿,工業區,荒郊野外的。

重回劍三!~