You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm starting to study the plugin for use of Bluetooth.
Unfortunately I discovered that the tablet I have does not have bluetooth, so when I initialize the plugin I get an exception, since the getAdapter function returns null.
Given this I would suggest that this plugin's start point would be a 'Promise' something like:
Bluetooth.init=function(){returnnewPromise(function(resolve,reject){varbluetoothManager=utils.ad.getApplicationContext().getSystemService(android.content.Context.BLUETOOTH_SERVICE);adapter=bluetoothManager.getAdapter();if(adapter===null){reject("this device not have bluetooth!");return;}//......});};
And this initialization was controlled by the application, so we would have access to the 'then' and 'cath' functions to take some action so the application did not break.
The text was updated successfully, but these errors were encountered:
Well, technically you should/could call 'init' inside or after checking isBluetoothEnabled method, which in this case should return false if no bluetooth turned on/existing.
I'm starting to study the plugin for use of Bluetooth.
Unfortunately I discovered that the tablet I have does not have bluetooth, so when I initialize the plugin I get an exception, since the getAdapter function returns null.
Given this I would suggest that this plugin's start point would be a 'Promise' something like:
And this initialization was controlled by the application, so we would have access to the 'then' and 'cath' functions to take some action so the application did not break.
The text was updated successfully, but these errors were encountered: