本文整理匯總了Java中org.apache.cordova.CordovaArgs.getString方法的典型用法代碼示例。如果您正苦於以下問題:Java CordovaArgs.getString方法的具體用法?Java CordovaArgs.getString怎麽用?Java CordovaArgs.getString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.cordova.CordovaArgs
的用法示例。
在下文中一共展示了CordovaArgs.getString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: connect
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void connect(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
int socketId = args.getInt(0);
String address = args.getString(1);
String uuid = args.getString(2);
ChromeBluetoothSocketSocket socket = sockets.get(socketId);
if (socket == null) {
callbackContext.error("Invalid Argument");
return;
}
socket.connect(address, uuid, callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothSocket,代碼行數:17,代碼來源:ChromeBluetoothSocket.java
示例2: connect
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void connect(CordovaArgs args, boolean secure, CallbackContext callbackContext) throws JSONException {
String macAddress = args.getString(0);
BluetoothDevice device = bluetoothAdapter.getRemoteDevice(macAddress);
if (device != null) {
connectCallback = callbackContext;
bluetoothSerialService.connect(device, secure);
PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
result.setKeepCallback(true);
callbackContext.sendPluginResult(result);
} else {
callbackContext.error("Could not connect to " + macAddress);
}
}
示例3: readCharacteristicValue
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void readCharacteristicValue(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
final String characteristicId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(characteristicId);
final ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
cordova.getThreadPool().execute(new Runnable() {
public void run() {
peripheral.readCharacteristicValue(characteristicId, callbackContext);
}
});
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:20,代碼來源:ChromeBluetoothLowEnergy.java
示例4: writeCharacteristicValue
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void writeCharacteristicValue(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
final String characteristicId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(characteristicId);
final byte[] value = args.getArrayBuffer(1);
final ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
cordova.getThreadPool().execute(new Runnable() {
public void run() {
peripheral.writeCharacteristicValue(characteristicId, value, callbackContext);
}
});
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:21,代碼來源:ChromeBluetoothLowEnergy.java
示例5: startCharacteristicNotifications
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void startCharacteristicNotifications(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
final String characteristicId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(characteristicId);
final ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
cordova.getThreadPool().execute(new Runnable() {
public void run() {
peripheral.setCharacteristicNotification(characteristicId, true, callbackContext);
}
});
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:20,代碼來源:ChromeBluetoothLowEnergy.java
示例6: stopCharacteristicNotifications
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void stopCharacteristicNotifications(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
final String characteristicId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(characteristicId);
final ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
cordova.getThreadPool().execute(new Runnable() {
public void run() {
peripheral.setCharacteristicNotification(characteristicId, false, callbackContext);
}
});
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:20,代碼來源:ChromeBluetoothLowEnergy.java
示例7: listenUsingRfcomm
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void listenUsingRfcomm(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
int socketId = args.getInt(0);
String uuid = args.getString(1);
JSONObject options = args.getJSONObject(2);
ChromeBluetoothSocketSocket socket = sockets.get(socketId);
if (socket == null) {
callbackContext.error("Invalid Argument");
return;
}
socket.listenUsingRfcomm(uuid, options, callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothSocket,代碼行數:17,代碼來源:ChromeBluetoothSocket.java
示例8: writeDescriptorValue
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void writeDescriptorValue(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
final String descriptorId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(descriptorId);
final byte[] value = args.getArrayBuffer(1);
final ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
cordova.getThreadPool().execute(new Runnable() {
public void run() {
peripheral.writeDescriptorValue(descriptorId, value, callbackContext);
}
});
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:21,代碼來源:ChromeBluetoothLowEnergy.java
示例9: disconnect
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void disconnect(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
String deviceAddress = args.getString(0);
ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
peripheral.disconnect(callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:14,代碼來源:ChromeBluetoothLowEnergy.java
示例10: getService
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void getService(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
String serviceId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(serviceId);
ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
peripheral.getService(serviceId, callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:15,代碼來源:ChromeBluetoothLowEnergy.java
示例11: getServices
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void getServices(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
String deviceAddress = args.getString(0);
ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
peripheral.getServices(callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:14,代碼來源:ChromeBluetoothLowEnergy.java
示例12: getCharacteristic
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void getCharacteristic(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
String characteristicId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(characteristicId);
ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
peripheral.getCharacteristic(characteristicId, callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:16,代碼來源:ChromeBluetoothLowEnergy.java
示例13: getCharacteristics
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void getCharacteristics(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
String serviceId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(serviceId);
ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
peripheral.getCharacteristics(serviceId, callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:16,代碼來源:ChromeBluetoothLowEnergy.java
示例14: getIncludedServices
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void getIncludedServices(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
String serviceId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(serviceId);
ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
peripheral.getIncludedServices(serviceId, callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:15,代碼來源:ChromeBluetoothLowEnergy.java
示例15: getDescriptor
import org.apache.cordova.CordovaArgs; //導入方法依賴的package包/類
private void getDescriptor(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
String descriptorId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(descriptorId);
ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
peripheral.getDescriptor(descriptorId, callbackContext);
}
開發者ID:MobileChromeApps,項目名稱:cordova-plugin-chrome-apps-bluetoothLowEnergy,代碼行數:16,代碼來源:ChromeBluetoothLowEnergy.java