2018年12月28日星期五
android 藍芽入門
1. 三篇文章
https://blog.csdn.net/huangliniqng/article/details/82185983
https://blog.csdn.net/huangliniqng/article/details/82187966
https://blog.csdn.net/huangliniqng/article/details/82189735
2. Discovery bluetooth device example
https://blog.csdn.net/zhangphil/article/details/77896924
3. 配對 :
private void pairDevice(BluetoothDevice device) {
try {
Method method = device.getClass().getMethod("createBond", (Class[]) null);
method.invoke(device, (Object[]) null);
} catch (Exception e) {
e.printStackTrace();
}
}
參考 : http://www.londatiga.net/it/programming/android/how-to-programmatically-pair-or-unpair-android-bluetooth-device/
2018年12月26日星期三
android get wifi ssid
WifiManager wifi; String mssid; @Overrideprotected void onCreate(Bundle savedInstanceState) {
..................
//get your WiFi's SSID //下面三行是取得你當前連線到的wifi的SSID
wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wifi.getConnectionInfo(); mssid = wifiInfo.getSSID(); Log.i(TAG, "mssid : "+mssid)
訂閱:
留言 (Atom)