原创 Application中的Context和Activity中的Context區別

網上搜集的, 沒做梳理, 有點亂 1. Application的Context是一個全局靜態變量,SDK的說明是隻有當你引用這個context的生命週期超過了當前activity的生命週期,而和整個應用的生命週期掛鉤時,纔去使用這個a

原创 獲取屏幕寬度, 高度及Density(顯示密度)

/** * 獲取屏幕的寬度 * * @return */ public static int getScreenWidth() { WindowManager ma

原创 How about some Android graphics true facts

How about some Android graphics true facts?(Edit: there have been a number of comments treating this as being written a

原创 Robolectric: Test-Drive Your Android Code

http://pivotal.github.com/robolectric/

原创 Follow up to “Android graphics true facts”, or The Reason Android is Laggy

Edit: +Dianne Hackborn has written a response to this post. She clarifies things about Android that I got wrong, and f

原创 iOS vs. Android ICS: Hardware Accelerated Graphics Pipelines

Earlier this year, Flipboard developer Charles Ying (@charlietuna) fairly & accurately criticised Android’s immature g

原创 (Android)The currently displayed page contains invalid values 解決方法

這是個簡答的問題,但是出現的地方有很多種,其實一共就這兩種解決方法,多餘的不說,直接說解決方法。1 當項目中遇到時: 項目丟失了default.pr

原创 10種技巧可提升Android應用運行效果

隨着手機平臺的發展和所提供應用的提升,質量成爲應用成功的最重要因素。如果那些應用無法提供強大的功能和穩定的用戶體驗,那就會很快被用戶卸載。開發者需要記住的是,雖然Android智能手機和平板電腦的速度日益提升,但其應用仍然運行在資源有

原创 Android ListView 去除底色、選中色、陰影

去除ListView滑到頂部和底部時邊緣的黑色陰影: Xml代碼   android:fadingEdge="none"      去除拖動時默認的黑色背景: Xml代碼   android:cacheColorHi

原创 This attribute must be localized錯誤

eclipse中編譯沒有問題,但是在make自己建立的項目的時候,提示了錯誤“This attribute must be localized”,這種問題一般情況是因爲在res/xml文件夾下的中或者在res/layout下的文件中出現了

原创 Google I/O 2011, Android Accelerated Rendering

http://www.slideshare.net/romainguy/google-io-2011-android-accelerated-rendering

原创 Android中在Activity之間傳遞數據的另一種方法, 使用application context

在Android中編寫過程序的開發人員都知道。在Activity、等組件之間傳遞數據(尤其是複雜類型的數據)很不方便。一般可以使用Intent來傳遞可序列化或簡單類型的數據。看下面的代碼。   Intent intent = new 

原创 命令行下查看android sqlit3數據庫信息

找到adb, 一般位於android sdk的的tools/(老版本)或者 platform-tools/ (新版本) ,如果沒有後者,則可以通過 SDK and AVD Manager 來安裝 "Android SDK Platfor

原创 Android獲取兩個日期之間間隔的天數

/** * 獲取兩個日期之間的間隔天數 * @return */ public static int getGapCount(Date startDate, Date endDate) { Calendar

原创 android.database.cursorindexoutofboundsexception錯誤解決 及獲取某行某列信息

/** * 獲取某行某列信息 * @param info * @param column * @return */ public static int getIntValue(ItemInfo info, Stri