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


Java CordovaArgs.getInt方法代码示例

本文整理汇总了Java中org.apache.cordova.CordovaArgs.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java CordovaArgs.getInt方法的具体用法?Java CordovaArgs.getInt怎么用?Java CordovaArgs.getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cordova.CordovaArgs的用法示例。


在下文中一共展示了CordovaArgs.getInt方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setPaused

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void setPaused(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {
  int socketId = args.getInt(0);
  boolean paused = args.getBoolean(1);

  TcpServerSocket socket = sockets.get(Integer.valueOf(socketId));

  if (socket == null) {
    Log.e(LOG_TAG, "No socket with socketId " + socketId);
    return;
  }

  socket.setPaused(paused);

  if (paused) {
    // Accept interest will be removed when socket is acceptable on selector thread.
    callbackContext.success();
  } else {
    // All interests need to be modified in selector thread.
    addSelectorMessage(socket, SelectorMessageType.SO_ADD_ACCEPT_INTEREST, callbackContext);
  }
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-sockets-tcpServer,代码行数:23,代码来源:ChromeSocketsTcpServer.java

示例2: update

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void update(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {

  int socketId = args.getInt(0);
  JSONObject properties = args.getJSONObject(1);

  ChromeBluetoothSocketSocket socket = sockets.get(socketId);

  if (socket == null) {
    callbackContext.error("Invalid Argument");
    return;
  }

  socket.update(properties);
  callbackContext.success();
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-bluetoothSocket,代码行数:17,代码来源:ChromeBluetoothSocket.java

示例3: setPaused

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void setPaused(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {

  int socketId = args.getInt(0);
  boolean paused = args.getBoolean(1);

  ChromeBluetoothSocketSocket socket = sockets.get(socketId);

  if (socket == null) {
    callbackContext.error("Invalid Argument");
    return;
  }

  socket.setPaused(paused);
  callbackContext.success();
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-bluetoothSocket,代码行数:17,代码来源:ChromeBluetoothSocket.java

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

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

示例6: disconnect

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void disconnect(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {

  int socketId = args.getInt(0);

  ChromeBluetoothSocketSocket socket = sockets.get(socketId);

  if (socket == null) {
    callbackContext.error("Invalid Argument");
    return;
  }

  try {
    socket.disconnect();
    callbackContext.success();
  } catch (IOException e) {
    callbackContext.error(e.getMessage());
  }
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-bluetoothSocket,代码行数:20,代码来源:ChromeBluetoothSocket.java

示例7: close

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void close(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {

  int socketId = args.getInt(0);

  ChromeBluetoothSocketSocket socket = sockets.get(socketId);

  if (socket == null) {
    callbackContext.error("Invalid Argument");
    return;
  }

  try {
    socket.disconnect();
    sockets.remove(socket.getSocketId());
    callbackContext.success();
  } catch (IOException e) {
    callbackContext.error(e.getMessage());
  }
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-bluetoothSocket,代码行数:21,代码来源:ChromeBluetoothSocket.java

示例8: parseArgs

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
public static NavigationOption parseArgs(CordovaArgs args) {
    try {
        double[] startPosition = parsePosition(args.getJSONObject(0));
        double[] endPosition = parsePosition(args.getJSONObject(1));
        int type = args.getInt(2);
        return new NavigationOption(startPosition, endPosition, type);
    } catch (JSONException ignored) {
    }
    return null;
}
 
开发者ID:luocongqiu,项目名称:cordova-plugin-navigation,代码行数:11,代码来源:NavigationOption.java

示例9: disconnect

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void disconnect(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {
  int socketId = args.getInt(0);

  TcpServerSocket socket = sockets.get(Integer.valueOf(socketId));

  if (socket == null) {
    Log.e(LOG_TAG, "No socket with socketId " + socketId);
    return;
  }

  addSelectorMessage(socket, SelectorMessageType.SO_DISCONNECTED, callbackContext);
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-sockets-tcpServer,代码行数:14,代码来源:ChromeSocketsTcpServer.java

示例10: close

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void close(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {
  int socketId = args.getInt(0);

  TcpServerSocket socket = sockets.get(Integer.valueOf(socketId));

  if (socket == null) {
    Log.e(LOG_TAG, "No socket with socketId " + socketId);
    return;
  }

  addSelectorMessage(socket, SelectorMessageType.SO_CLOSE, callbackContext);
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-sockets-tcpServer,代码行数:14,代码来源:ChromeSocketsTcpServer.java

示例11: getInfo

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void getInfo(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {
  int socketId = args.getInt(0);

  TcpServerSocket socket = sockets.get(Integer.valueOf(socketId));

  if (socket == null) {
    Log.e(LOG_TAG, "No socket with socketId " + socketId);
    return;
  }
  callbackContext.success(socket.getInfo());
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-sockets-tcpServer,代码行数:13,代码来源:ChromeSocketsTcpServer.java

示例12: send

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void send(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {

  int socketId = args.getInt(0);
  byte[] data = args.getArrayBuffer(1);

  ChromeBluetoothSocketSocket socket = sockets.get(socketId);

  if (socket == null) {
    callbackContext.error("Invalid Argument");
    return;
  }
  socket.send(data, callbackContext);
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-bluetoothSocket,代码行数:15,代码来源:ChromeBluetoothSocket.java

示例13: getInfo

import org.apache.cordova.CordovaArgs; //导入方法依赖的package包/类
private void getInfo(CordovaArgs args, final CallbackContext callbackContext)
    throws JSONException {

  int socketId = args.getInt(0);

  ChromeBluetoothSocketSocket socket = sockets.get(socketId);

  if (socket == null) {
    callbackContext.error("Invalid Argument");
    return;
  }

  callbackContext.success(socket.getInfo());
}
 
开发者ID:MobileChromeApps,项目名称:cordova-plugin-chrome-apps-bluetoothSocket,代码行数:15,代码来源:ChromeBluetoothSocket.java


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