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 讀取低功耗藍牙(BLE)程式初探 - Bluetooth - GATT

實用的文章


https://juejin.im/entry/5919630444d904006c6e14ca

http://cheng-min-i-taiwan.blogspot.com/2015/06/android-ble.html

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)