本文整理匯總了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;
}
示例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