当前位置: 首页>>代码示例>>Java>>正文


Java CordovaArgs.getString方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:drpain,项目名称:blink,代码行数:17,代码来源:BluetoothSerial.java

示例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


注:本文中的org.apache.cordova.CordovaArgs.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。