Back to project page BluetoothSppPro.
The source code is released under:
Apache License
If you think the Android project BluetoothSppPro listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package mobi.dzs.android.BLE_SPP_PRO; /*from w w w. j a v a 2s. c o m*/ import mobi.dzs.android.bluetooth.BluetoothSppClient; import mobi.dzs.android.storage.CJsonStorage; import mobi.dzs.android.storage.CKVStorage; import android.app.Application; public class globalPool extends Application { /**???SPP??????*/ public BluetoothSppClient mBSC = null; /**?????????*/ public CKVStorage mDS = null; /** * ???? * */ @Override public void onCreate(){ super.onCreate(); this.mDS = new CJsonStorage(this, getString(R.string.app_name)); } /** * ??????? * @param String sMac ????????? * @return boolean * */ public boolean createConn(String sMac){ if (null == this.mBSC) { this.mBSC = new BluetoothSppClient(sMac); if (this.mBSC.createConn()) return true; else{ this.mBSC = null; return false; } } else return true; } /** * ??????? * @return void * */ public void closeConn(){ if (null != this.mBSC){ this.mBSC.closeConn(); this.mBSC = null; } } }