編輯:關於Android編程
Mark一下
public void Msg1(String str)
{
Toast toast = new Toast(this);
Toast toast1 = toast.makeText(this, str, Toast.LENGTH_LONG);
toast1.show();
}
//獲取ID號
final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
final String tmDevice, tmSerial, tmPhone, androidId;
tmDevice = "" + tm.getDeviceId();
tmSerial = "" + tm.getSimSerialNumber();
androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
String uniqueId = deviceUuid.toString();
Msg1(uniqueId);
//獲取手機型號
String strPhoneModule = android.os.Build.MODEL;
Msg1(strPhoneModule);
//獲取系統版本
String strSystemType = android.os.Build.VERSION.RELEASE;
Msg1(strSystemType);
//獲取本機號碼
TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
String strPhoneNum = phoneMgr.getLine1Number();
Msg1(strPhoneNum);
Android網絡編程(八)源碼解析OkHttp中篇[復用連接池]
1.引子在了解OkHttp的復用連接池之前,我們首先要了解幾個概念。TCP三次握手通常我們進行HTTP連接網絡的時候我們會進行TCP的三次握手,然後傳輸數據,然後再釋放連
TextSwticher 與 TextView 實現上下滾動和跑馬燈效果
太久沒寫博客了,主要是想寫一些有質量的,今天碰到這個需求覺得挺有意思的,即像標題寫的那樣,這裡記錄一下,廢話不多說,先上一個效果圖:單行顯示:大於一行顯示:即,單行上下滾
Android源碼編譯
簡要說明 現在的Android應用開發開源項目感覺就像春秋戰國時期,各種思想雨後春筍,百花齊放,如算法,如圖形,如數據庫,如網絡協議,林林總總、煞是好看,Github也成
詳解Android事件的分發、攔截和執行
在平常的開發中,我們經常會遇到點擊,滑動之類的事件。有時候不同的view之間也存在各種滑動沖突。比如布局的內外兩層都能滑動的話,那麼就會出現沖突了。這個時候我們就需要了解