Java Code Examples for com.eveningoutpost.dexdrip.utils.AndroidBarcode

The following examples show how to use com.eveningoutpost.dexdrip.utils.AndroidBarcode. These examples are extracted from open source projects. 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 Project: xDrip   Source File: ThinJamActivity.java    License: 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 Project: xDrip-plus   Source File: ThinJamActivity.java    License: 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;
                }
            }
        }
    }