本文整理匯總了Java中com.integreight.onesheeld.sdk.ShieldFrame.getFunctionId方法的典型用法代碼示例。如果您正苦於以下問題:Java ShieldFrame.getFunctionId方法的具體用法?Java ShieldFrame.getFunctionId怎麽用?Java ShieldFrame.getFunctionId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.integreight.onesheeld.sdk.ShieldFrame
的用法示例。
在下文中一共展示了ShieldFrame.getFunctionId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
// TODO Auto-generated method stub
if (frame.getShieldId() == UIShield.FOURSQUARE_SHIELD.getId()) {
if (isFoursquareLoggedInAlready())
if (frame.getFunctionId() == CHECKIN_METHOD_ID) {
placeID = frame.getArgumentAsString(0);
message = frame.getArgumentAsString(1);
if (ConnectionDetector
.isConnectingToInternet(getApplication()
.getApplicationContext())) {
ConnectFour connectFour = new ConnectFour();
connectFour.execute("");
} else
Toast.makeText(
getApplication().getApplicationContext(),
R.string.general_toasts_please_check_your_internet_connection_and_try_again_toast,
Toast.LENGTH_SHORT).show();
}
}
}
示例2: onShieldFrameReceive
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onShieldFrameReceive(OneSheeldDevice device, final ShieldFrame frame) {
super.onShieldFrameReceive(device, frame);
if (isALive && frame != null && matchedShieldPins.size() == 0 && isInit)
if (frame.getShieldId() == getShieldId())
if (frame.getFunctionId() == IS_SHIELD_SELECTED)
notifyHardwareOfShieldSelection();
else if (frame.getFunctionId() == SELECT_SHIELD) {
} else if (frame.getFunctionId() == DESELECT_SHIELD) {
} else {
cachedArduinoCallbackStatus = device.isArduinoInACallback();
actionHandler.post(new Runnable() {
@Override
public void run() {
try {
if (isInteractive)
((T) ControllerParent.this)
.onNewShieldFrameReceived(frame);
cachedArduinoCallbackStatus = false;
} catch (RuntimeException e) {
cachedArduinoCallbackStatus = false;
Toast.makeText(getActivity(), R.string.general_toasts_received_an_unexpected_frame_toast, Toast.LENGTH_SHORT).show();
CrashlyticsUtils.logException(e);
}
}
});
}
}
示例3: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.PHONE_SHIELD.getId()) {
String phone_number = frame.getArgumentAsString(0);
switch (frame.getFunctionId()) {
case CALL_METHOD_ID:
call(phone_number);
break;
default:
break;
}
}
}
示例4: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
// TODO Auto-generated method stub
if (frame.getShieldId() == UIShield.SMS_SHIELD.getId()) {
String smsNumber = frame.getArgumentAsString(0);
String smsText = frame.getArgumentAsString(1);
lastSmsText = smsText;
if (frame.getFunctionId() == SEND_SMS_METHOD_ID) {
sendSms(smsNumber, smsText);
}
}
}
示例5: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == SHIELD_ID) {
switch (frame.getFunctionId()) {
case ENABLE_FULL_COLORS:
if (colorEventHandler != null) {
colorEventHandler.enableFullColor();
}
recevedFramesOperation = RECEIVED_FRAMES.NINE_FRAMES;
notifyColorDetectionOperation();
break;
case ENABLE_NORMAL_COLOR:
if (colorEventHandler != null) {
colorEventHandler.enableNormalColor();
}
recevedFramesOperation = RECEIVED_FRAMES.CENTER;
notifyColorDetectionOperation();
break;
case SET_PALLETE:
currentPallete = ColorPalette.get(frame.getArgument(0)[0]);
if (colorEventHandler != null) {
colorEventHandler.setPallete(currentPallete);
}
break;
case SET_CALC_MODE:
colorType = frame.getArgument(0)[0] == AVERAGE_COLOR ? COLOR_TYPE.AVERAGE : COLOR_TYPE.COMMON;
if (colorEventHandler != null) {
colorEventHandler.changeCalculationMode(colorType);
}
break;
case SET_PATCH_SIZE:
patchSize = frame.getArgument(0)[0] == SMALL_PATCH ? PATCH_SIZE.SMALL : frame.getArgument(0)[0] == MED_PATCH ? PATCH_SIZE.MEDIUM : PATCH_SIZE.LARGE;
if (colorEventHandler != null) {
colorEventHandler.changePatchSize(patchSize);
}
notifyPatchSize();
break;
}
}
}
示例6: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.SLIDER_SHIELD.getId()) {
if (frame.getFunctionId() == SLIDER_VALUE) {
sliderValue = frame.getArgumentAsInteger(0);
if (sliderHandler != null && isHasForgroundView())
sliderHandler.setSliderValue(sliderValue);
}
}
}
示例7: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.SPEECH_RECOGNIZER_SHIELD.getId()) {
if (frame.getFunctionId() == 0x01) {
startRecognizer();
}
}
}
示例8: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
// TODO Auto-generated method stub
if (frame.getShieldId() == UIShield.SKYPE_SHIELD.getId()) {
String userId = frame.getArgumentAsString(0);
Log.d("Skype_User_ID ", userId);
if (ConnectionDetector.isConnectingToInternet(getApplication()
.getApplicationContext())) {
switch (frame.getFunctionId()) {
case CALL_METHOD_ID:
callSkypeID(userId);
break;
case VIDEO_METHOD_ID:
videoCallSkypeID(userId);
break;
case CHAT_METHOD_ID:
chatSkypeID(userId);
break;
default:
break;
}
} else
Toast.makeText(getApplication().getApplicationContext(),
R.string.general_toasts_please_check_your_internet_connection_and_try_again_toast,
Toast.LENGTH_SHORT).show();
}
}
示例9: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.TEXT_TO_SPEECH_SHIELD.getId()) {
if (frame.getFunctionId() == 0x01) {
speech(frame.getArgumentAsString(0));
if (eventHandler != null) {
eventHandler.onSpeek(frame.getArgumentAsString(0));
}
}
}
}
示例10: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
// TODO Auto-generated method stub
if (frame.getShieldId() == UIShield.FACEBOOK_SHIELD.getId()) {
lastPost = frame.getArgumentAsString(0);
if (isFacebookLoggedInAlready()) {
if (ConnectionDetector.isConnectingToInternet(getApplication()
.getApplicationContext())) {
if (eventHandler != null)
eventHandler.startProgress();
if (frame.getFunctionId() == UPDATE_STATUS_METHOD_ID)
publishStory(lastPost);
else if (frame.getFunctionId() == UPLOAD_PHOTO_METHOD_ID) {
String imgPath = null;
byte sourceFolderId = frame.getArgument(1)[0];
if (sourceFolderId == CameraUtils.FROM_ONESHEELD_FOLDER)
imgPath = CameraUtils
.getLastCapturedImagePathFromOneSheeldFolder(activity,true);
else if (sourceFolderId == CameraUtils.FROM_CAMERA_FOLDER)
imgPath = CameraUtils
.getLastCapturedImagePathFromCameraFolder(activity);
if (imgPath != null) {
uploadImage(imgPath, lastPost);
}
}
} else
Toast.makeText(
getApplication().getApplicationContext(),
R.string.general_toasts_please_check_your_internet_connection_and_try_again_toast,
Toast.LENGTH_SHORT).show();
}
}
}
示例11: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
// TODO Auto-generated method stub
if (frame.getShieldId() == UIShield.MIC_SHIELD.getId()) {
switch (frame.getFunctionId()) {
case MIC_START_RECORD:
if (!isRecording) {
handler.removeCallbacks(processMic);
MicSoundMeter.getInstance().stop();
if (frame.getArguments().isEmpty()) {
fileName = "Mic_" + String.valueOf(new Date().getTime());
} else {
fileName = frame.getArgumentAsString(0) +"_" + String.valueOf(new Date().getTime());
}
MicSoundMeter.getInstance().start(true, fileName);
if (eventHandler != null)
eventHandler.getState(activity.getString(R.string.mic_recording)+"...");
handler.post(processMic);
isRecording = true;
}
break;
case MIC_STOP_RECORD:
if (isRecording) {
handler.removeCallbacks(processMic);
MicSoundMeter.getInstance().stop();
MicSoundMeter.getInstance().start(false);
if (eventHandler != null)
eventHandler.getState("");
if (!fileName.equals(""))
showNotification(activity.getString(R.string.mic_sound_recorded_successfully_to)+" " + fileName + ".mp3");
fileName = "";
handler.post(processMic);
isRecording = false;
}
break;
}
}
}
示例12: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.SEVENSEGMENT_SHIELD.getId()
&& frame.getFunctionId() == 0x01)
for (int i = 0; i < shieldPins.length; i++) {
pinsStatus.put(shieldPins[i],
BitsUtils.isBitSet(frame.getArgument(0)[0], i));
if (eventHandler != null) {
eventHandler.onSegmentsChange(pinsStatus);
}
}
}
示例13: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
// TODO Auto-generated method stub
if (frame.getShieldId() == UIShield.NOTIFICATION_SHIELD.getId()) {
String notificationText = frame.getArgumentAsString(0);
lastNotificationText = notificationText;
if (frame.getFunctionId() == NOTIFY_PHONE_METHOD_ID) {
showNotification(notificationText);
if (eventHandler != null)
eventHandler.onNotificationReceive(notificationText);
}
}
}
示例14: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.SPEECH_RECOGNIZER_SHIELD.getId()) {
if (frame.getFunctionId() == 0x01 && !isWorking)
startRecognizer();
}
}
示例15: onNewShieldFrameReceived
import com.integreight.onesheeld.sdk.ShieldFrame; //導入方法依賴的package包/類
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
if (frame.getShieldId() == UIShield.DATA_LOGGER.getId()) {
switch (frame.getFunctionId()) {
case START_LOGGING:
if (frame.getArguments().size() > 0)
fileName = frame.getArgumentAsString(0);
else
fileName = null;
headerList = new CopyOnWriteArrayList<>();
dataSet = new ArrayList<>();
rowData = new HashMap<>();
currentStatus = LOGGING;
isStarted = true;
Log.d("HeaderSize", "Start");
if (eventHandler != null) {
eventHandler.onStartLogging();
}
break;
case STOP_LOGGING:
saveData();
break;
case ADD_STRING:
if (isStarted) {
currentStatus = LOGGING;
String key = frame.getArgumentAsString(0);
String value = frame.getArgumentAsString(1);
if (!headerList.contains(key))
headerList.add(key);
rowData.put(key, value);
if (eventHandler != null) {
eventHandler.onAdd(key, value);
}
}
break;
case ADD_FLOAT:
if (isStarted) {
currentStatus = LOGGING;
String keyFloat = frame.getArgumentAsString(0);
String valueFloat = frame.getArgumentAsFloat(1) + "";
Log.d("HeaderSize", "Add : " + keyFloat + " " + valueFloat);
if (!headerList.contains(keyFloat))
headerList.add(keyFloat);
rowData.put(keyFloat, valueFloat);
if (eventHandler != null) {
eventHandler.onAdd(keyFloat, valueFloat);
}
}
break;
case LOG:
if (isStarted) {
currentStatus = LOGGING;
if (eventHandler != null) {
eventHandler.onLog(new HashMap<>(rowData));
}
if (!headerList.contains("Time")) headerList.add("Time");
rowData.put("Time",
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.US).format(new Date())
.toString());
//rowData.remove("Time");
dataSet.add(new HashMap<>(rowData));
rowData = new HashMap<>();
Log.d("HeaderSize", "Log: " + headerList.size() + " **");
}
break;
default:
break;
}
}
}