原创 Android——安全碼SHA1獲取

       申請第三方key時,總是需要填寫安全碼SHA1,這裏簡單記錄下測試版和發佈版SHA1的獲取方法: 一、獲取調試版SHA1,如下:   1. 運行打開cmd   2. 輸入命令  cd Users\你的用戶名\.android

原创 自定義RadioButton 文字在下,圖片在上

[html] view plaincopy <LinearLayout android:id="@+id/status_toolbar"       android:layout_width="fill_parent" 

原创 申請google map api-key的方法

首先檢查C:/Documents and Settings/Administrator/.android下面是否有debug.keystore,如沒有則在eclispe下新建一個以Google APIs爲Build Targe的項目,則

原创 Data truncation: Data too long for column 'name' at row 1

出現這個問題不是數據庫中字段設置太小越界的問題,是字符集不統一導致的。 解決方法:將所用數據庫、表及其中字段的字符集全部修改爲一致的,如:全改爲utf8的問題就解決了。

原创 Base64編碼的原理及實現

Base64索引表: Value Char   Value Char   Value Char   Value Char 0 A 16 Q 32 g 48 w 1 B 17 R 33 h

原创 android 判斷EditText中輸入的值是數字、字母還是漢字的方法

String text = edInput.getText().toString(); Pattern p = Pattern.compile("[0-9]*"); Matcher m = p.matcher(text

原创 MyEclipse中UnsupportedClassVersionError: Bad version number in .class file問題

Myeclipse中報出的錯誤: java.lang.UnsupportedClassVersionError: Bad version number in .class fileat java.lang.ClassLoader.defi

原创 Android:定製Activity的標題欄(Titlebar)

 缺省的情況下,通常見到Activity的標題欄(Titlebar)是這樣的(紅色框內): HandleContacts是Activity的標題。   有時候,我們希望能改變一下這樣單調的狀況。比如,要在標題欄中增加一個用於美化界面

原创 修改及查看mysql數據庫的字符集

Liunx下修改MySQL字符集:1.查找MySQL的cnf文件的位置find / -iname '*.cnf' -print/usr/share/mysql/my-innodb-heavy-4G.cnf/usr/share/mysql/

原创 Android 獲取無線藍牙MAC信息代碼

package org.example.itester; import android.app.Activity; import android.bluetooth.BluetoothAdapter; import an

原创 Android CheckBox應用實例

下面爲實例代碼: private CheckBox location; location = (CheckBox)findViewById(R.id.location); location.setTextColor(Color

原创 Android中adb shell下查詢中文記錄亂碼解決方法

1. 在CMD窗口下輸下:chcp 65001 確定 2. 在命令行標題欄上點擊右鍵,選擇【屬性】 -【字體】,將字體修改爲【Lucida Console】 確定 完成後再通過 adb shell 進入sqlite3,亂碼解決

原创 AndroidManifest中Activity信息的設置

一、Activity中阻止自動彈出鍵盤 選擇那個acitivity, 把他的window soft input mode設置成stateHidden和adjustUnspecified ,代碼如下: <activity

原创 Eclipse顏色設置

1、Eclipse顏色設置在菜單Windows -> Preferences,如圖1所示。 圖1、Preferences 2、General -> Appearance -> Colors and Font,如圖2所示。

原创 免安裝版mysql密碼設置及用戶管理

修改密碼: ⑴mysql>use mysql; mysql>update user set password=password('new_password') where user='用戶名'; mysql>