com.eveningoutpost.dexdrip.utils.AndroidBarcode Java Examples

The following examples show how to use com.eveningoutpost.dexdrip.utils.AndroidBarcode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ThinJamActivity.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
private void processIncomingBundle(final Bundle bundle) {

        if (bundle != null) {
            Log.d(TAG, "Processing incoming bundle");

            if (!mBound) {
                // save to process when service connects
                savedExtras = bundle;
                return;
            } else {
                savedExtras = null; // clear if might have been set
            }

            final String command = bundle.getString(THINJAM_ACTIVITY_COMMAND);
            if (command != null) {
                switch (command) {
                    case REFRESH_FROM_STORED_MAC:
                        binding.getVm().connectedDevice.set(BlueJay.getMac());
                        binding.getVm().setMac(BlueJay.getMac()); // TODO this doesn't handle name
                        binding.getVm().identify(); // re(do) identification.
                        break;
                    case INSTALL_CORE:
                        promptForCoreUpdate(false);
                        break;
                    case UPDATE_CORE:
                        promptForCoreUpdate(true);
                        break;
                    case UPDATE_MAIN:
                        promptForMainUpdate();
                        break;
                    case REQUEST_QR:
                        binding.getVm().doAction("showqrcode");
                        break;
                    case SCAN_QR:
                        new AndroidBarcode(this).scan();
                        break;
                }
            }
        }
    }
 
Example #2
Source File: ThinJamActivity.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
private void processIncomingBundle(final Bundle bundle) {

        if (bundle != null) {
            Log.d(TAG, "Processing incoming bundle");

            if (!mBound) {
                // save to process when service connects
                savedExtras = bundle;
                return;
            } else {
                savedExtras = null; // clear if might have been set
            }

            final String command = bundle.getString(THINJAM_ACTIVITY_COMMAND);
            if (command != null) {
                switch (command) {
                    case REFRESH_FROM_STORED_MAC:
                        binding.getVm().connectedDevice.set(BlueJay.getMac());
                        binding.getVm().setMac(BlueJay.getMac()); // TODO this doesn't handle name
                        binding.getVm().identify(); // re(do) identification.
                        break;
                    case INSTALL_CORE:
                        promptForCoreUpdate(false);
                        break;
                    case UPDATE_CORE:
                        promptForCoreUpdate(true);
                        break;
                    case UPDATE_MAIN:
                        promptForMainUpdate();
                        break;
                    case REQUEST_QR:
                        binding.getVm().doAction("showqrcode");
                        break;
                    case SCAN_QR:
                        new AndroidBarcode(this).scan();
                        break;
                }
            }
        }
    }