Time of Update: 2018-12-05
最近在一個android項目上引用另外一個自己寫的jar檔案出現了問題。表現為在eclipse的build
Time of Update: 2018-12-05
Android 傳送簡訊 sms layout布局檔案main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"
Time of Update: 2018-12-05
1: 由Package Name擷取其package的環境變數根據此變數可以擷取相應package的resource Context authContext = createPackageContext(desc.packageName, 0); icon = authContext.getResources().getDrawable(desc.iconId); label =
Time of Update: 2018-12-05
廣播機制實現
Time of Update: 2018-12-05
由於以往我寫過不少使用boost庫開發的項目,而最近準備移植一些代碼到android上(上層介面以及jni層我不管,也沒研究過,現在只完成代碼的移植編譯,具體如何調用,由其它人負責),所以先要解決的就是boost庫本身的移植問題。在google上找了一些相關的資料,然後在http://stackoverflow.com上找到一個給力的文章:http://stackoverflow.com/questions/14036311/official-boost-library-support-for-
Time of Update: 2018-12-05
1.應用開發中經常會遇到價格顯示問題 如價格顯示(¥ 358,179,682)這種格式 通用方法private String getString(String str) { if (str.equals("") || str == "") { return ""; } else { Locale.setDefault(Locale.CHINA);// 中文語言環境下
Time of Update: 2018-12-05
android螢幕解析度適配是蛋疼的事啊,搞了哥一下午,小米手機480*800 三星GT-I9220 1200*800
Time of Update: 2018-12-05
這個問題遇到好幾次了,一直沒整理下來,這次記錄下,先描述下:在一個activity裡彈出一個dialog,這個時候點擊返回鍵的時候想直接把activity finish掉,但是此時返回鍵的監聽被dialog給屏蔽了,只能先finish掉dialog解決方案:只能監聽dialog的back事件了 dialog.setOnKeyListener(new OnKeyListener() { public
Time of Update: 2018-12-05
在項目中經常用到對資料的插入、刪除等操作,有時候服務端返回的資料會帶有中文單引號,這樣直接插入會報語法錯誤,處理方法兩種第一種:把所有單引號替換掉 String regexp = "\'"; String deleteSql = "delete from " + DBConstants.DB_TABLE.TABLE_HISTORY + " where " +
Time of Update: 2018-12-05
1. /** * 擷取是否有網路連接方法 * * @param context * @return */ public static NetworkInfo getActiveNetwork(Context context) { if (context == null) return null; ConnectivityManager mConnMgr =
Time of Update: 2018-12-05
步驟:通過new URL(目標網址字串)得到URL對象url---->調用url的openConnection方法獲得一個HttpURLConnection對象connection---->調用connection的getInputStream方法獲得一個InputStream對象,訪問結束,接下來就是io操作了。執行個體: 16 public class DownloadDemoActivity extends Activity { 17 /**
Time of Update: 2018-12-05
什麼是9.png: 可能做過工作列美化的同學都會知道,我靠,framework-res.apk\res\drawable-hdpi 目錄下有非常非常多的XXXXXX.9.png圖片。千萬不要以為這個9隻是png格式圖片的命名區分,其實他是一種特殊的格式,在png圖片的基礎上動了些手腳,而且這種手腳你會看不見摸不著(詳情見下面具體內容)。
Time of Update: 2018-12-05
class SMSDBObserver extends ContentObserver {private Context ctx;public SMSDBObserver(Handler handler, Context ctx) {super(handler);this.ctx = ctx;}@SuppressWarnings("static-access")public void onChange(boolean selfChange) {super.onChange(selfChange)
Time of Update: 2018-12-05
轉載:http://blog.csdn.net/kellycan/article/details/6457030 在Android開發過程中,當我們只需要編譯某個修改過的模組時,使用mm命令可以使你不用編譯整個Android項目,而只需單獨編譯該模組即可,這樣速度是不是很快呢?具體的步驟如下:1. 在Android原始碼目錄下:[c-sharp] view plaincopyprint?cd mydroid source build/envsetup.sh cd mydroid
Time of Update: 2018-12-05
from:http://blog.csdn.net/wlr_tang/article/details/6792387 【1】在PC上安裝nfs服務sudo apt-get install nfs-kernel-server配置nfs伺服器,把掛在目錄設定在/nfs/rootfssudo vi /etc/exports在exports檔案最後添加一行:/nfs/rootfs *(rw,sync,no_root_squash) 啟動nfs服務$sudo /etc/init.d/portmap
Time of Update: 2018-12-05
Animations是一套實現動畫的APIAnimations的分類1、Tweened Animations漸層動畫、補間動畫提供了旋轉、移動、伸展和淡出等效果2、Frame-by-Frame Animations可以建立一個Drawable序列,這些Drawable可以按照指定的時間間歇一個一個的顯示。Tweened
Time of Update: 2018-12-05
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="king.demo" android:versionCode="1" android:versionName="1.0"> <application
Time of Update: 2018-12-05
添加秘密程式,通過撥號啟動AndroidManifest.xml<receiver android:name=".secret"> <intent-filter> <action android:name="android.provider.Telephony.SECRET_CODE" /> <data android:scheme="android_secret_code" android:host="1234"/&
Time of Update: 2018-12-05
1.Webservice.GetVcardByUserNo(String userId,String userNo);這個是封裝了的webservice介面。2.在程式中連續兩次調用該介面時,ksoap2在解析第二次調用返回的結果時拋異常。 異常資訊如下:org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@438
Time of Update: 2018-12-05
不設定Activity的android:configChanges時,切屏會重新調用各個生命週期設定Activity的android:configChanges時,切屏不會重新調用聲明周期,只會執行onConfigurationChanged方法。在android中每次螢幕的切換動會重啟Activity,所以應該在Activity銷毀前儲存當前活動的狀態,在Activity再次Create的時候載入配置。在activity加上android:configChanges="keyboardHidd