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


Java ShieldFrame.getShieldId方法代码示例

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


在下文中一共展示了ShieldFrame.getShieldId方法的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();
            }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:22,代码来源:FoursquareShield.java

示例2: onNewShieldFrameReceived

import com.integreight.onesheeld.sdk.ShieldFrame; //导入方法依赖的package包/类
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {

    if (frame.getShieldId() == UIShield.BUZZER_SHIELD.getId()) {
        byte argumentValue = frame.getArgument(0)[0];
        switch (argumentValue) {
            case BUZZER_ON:
                // turn on bin
                playSound();
                if (isResumed)
                    if (eventHandler != null)
                        eventHandler.onSpeakerChange(true);
                break;
            case BUZZER_OFF:
                // turn off bin
                stopBuzzer();
                if (eventHandler != null && isResumed)
                    eventHandler.onSpeakerChange(false);
                break;
            default:
                break;
        }

    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:26,代码来源:SpeakerShield.java

示例3: 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);
                        }
                    }
                });
            }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:30,代码来源:ControllerParent.java

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

}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:16,代码来源:PhoneShield.java

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

    }

}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:15,代码来源:SmsShield.java

示例6: onNewShieldFrameReceived

import com.integreight.onesheeld.sdk.ShieldFrame; //导入方法依赖的package包/类
@Override
public void onNewShieldFrameReceived(ShieldFrame frame) {
    if (frame.getShieldId() == UIShield.LED_SHIELD.getId()) {
        if (eventHandler != null) {
            eventHandler.onLedChange(frame.getFunctionId() == 0x01
                    && frame.getArgument(0)[0] == 0x1);
        }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:10,代码来源:LedShield.java

示例7: 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;
        }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:41,代码来源:ColorDetectionShield.java

示例8: 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);
        }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:11,代码来源:SliderShield.java

示例9: 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();
        }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:9,代码来源:SpeechRecognitionShield.java

示例10: 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();
    }

}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:30,代码来源:SkypeShield.java

示例11: 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));
            }
        }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:12,代码来源:TextToSpeechShield.java

示例12: 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();
        }
    }

}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:35,代码来源:FacebookShield.java

示例13: 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;
        }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:39,代码来源:MicShield.java

示例14: 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);
            }
        }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:13,代码来源:SevenSegmentShield.java

示例15: 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);
        }
    }
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:14,代码来源:NotificationShield.java


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