Search in sources :

Example 1 with SharedPreferencesManager

use of org.openbot.env.SharedPreferencesManager in project OpenBot by isl-org.

the class ControlsFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    requireActivity().getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    phoneController = PhoneController.getInstance(requireContext());
    preferencesManager = new SharedPreferencesManager(requireContext());
    audioPlayer = new AudioPlayer(requireContext());
    masterList = FileUtils.loadConfigJSONFromAsset(requireActivity());
    serverCommunication = new ServerCommunication(requireContext(), this);
    requireActivity().getSupportFragmentManager().setFragmentResultListener(Constants.GENERIC_MOTION_EVENT, this, (requestKey, result) -> {
        MotionEvent motionEvent = result.getParcelable(Constants.DATA);
        vehicle.setControl(vehicle.getGameController().processJoystickInput(motionEvent, -1));
        processControllerKeyData(Constants.CMD_DRIVE);
    });
    requireActivity().getSupportFragmentManager().setFragmentResultListener(Constants.KEY_EVENT, this, (requestKey, result) -> processKeyEvent(result.getParcelable(Constants.DATA)));
    mViewModel = new ViewModelProvider(requireActivity()).get(MainViewModel.class);
    vehicle = mViewModel.getVehicle().getValue();
    startAnimation = AnimationUtils.loadAnimation(requireContext(), R.anim.blink);
    mViewModel.getUsbData().observe(getViewLifecycleOwner(), data -> {
        char header = data.charAt(0);
        String body = data.substring(1);
        switch(header) {
            case 'f':
                vehicle.processVehicleConfig(body);
                break;
            case 'v':
                if (FormatUtils.isNumeric(body)) {
                    vehicle.setBatteryVoltage(Float.parseFloat(body));
                } else {
                    String[] msgParts = body.split(":");
                    switch(msgParts[0]) {
                        case "min":
                            vehicle.setMinMotorVoltage(Float.parseFloat(msgParts[1]));
                        case "low":
                            vehicle.setLowBatteryVoltage(Float.parseFloat(msgParts[1]));
                            break;
                        case "max":
                            vehicle.setMaxBatteryVoltage(Float.parseFloat(msgParts[1]));
                            break;
                        default:
                            Toast.makeText(requireContext().getApplicationContext(), "Invalid voltage message received!", Toast.LENGTH_SHORT).show();
                            break;
                    }
                }
                break;
            case 's':
                if (FormatUtils.isNumeric(body)) {
                    vehicle.setSonarReading(Float.parseFloat(body));
                }
                break;
            case 'w':
                String[] itemList = body.split(",");
                if (itemList.length == 2 && FormatUtils.isNumeric(itemList[0]) && FormatUtils.isNumeric(itemList[1])) {
                    vehicle.setLeftWheelRpm(Float.parseFloat(itemList[0]));
                    vehicle.setRightWheelRpm(Float.parseFloat(itemList[1]));
                }
                break;
            case 'b':
                // do nothing
                break;
        }
        processUSBData(data);
    });
    handlePhoneControllerEvents();
    vehicle.requestVehicleConfig();
}
Also used : AudioPlayer(org.openbot.env.AudioPlayer) ServerCommunication(org.openbot.server.ServerCommunication) SharedPreferencesManager(org.openbot.env.SharedPreferencesManager) MotionEvent(android.view.MotionEvent) ViewModelProvider(androidx.lifecycle.ViewModelProvider) MainViewModel(org.openbot.main.MainViewModel)

Example 2 with SharedPreferencesManager

use of org.openbot.env.SharedPreferencesManager in project OpenBot by isl-org.

the class SensorsDialog method onCreateView.

@SuppressLint("NotifyDataSetChanged")
@Override
public View onCreateView(@NotNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    SharedPreferencesManager preferencesManager = new SharedPreferencesManager(requireContext());
    DialogSensorsBinding binding = DialogSensorsBinding.inflate(LayoutInflater.from(getContext()));
    SensorManager sensorManager = (SensorManager) requireActivity().getSystemService(Context.SENSOR_SERVICE);
    List<Sensor> sensorList = sensorManager.getSensorList(Sensor.TYPE_ALL);
    HashMap<String, Boolean> list = new LinkedHashMap<>();
    list.put(Enums.SensorType.VEHICLE.getSensor(), preferencesManager.getSensorStatus(Enums.SensorType.VEHICLE.getSensor()));
    // Every modern phone has GPS
    list.put(Enums.SensorType.GPS.getSensor(), preferencesManager.getSensorStatus(Enums.SensorType.GPS.getSensor()));
    for (Sensor sensor : sensorList) {
        for (Enums.SensorType name : Enums.SensorType.values()) if (sensor.getStringType().toLowerCase().contains(name.getSensor().toLowerCase())) {
            list.put(name.getSensor(), preferencesManager.getSensorStatus(name.getSensor()));
            break;
        }
    }
    SensorListAdapter adapter = new SensorListAdapter(list, binding.selectAllCheck, preferencesManager);
    binding.listView.setLayoutManager(new LinearLayoutManager(requireContext()));
    binding.listView.setAdapter(adapter);
    binding.dismiss.setOnClickListener(v -> dismiss());
    int sensorStatusCount = 0;
    for (boolean b : new ArrayList<>(list.values())) if (b)
        sensorStatusCount++;
    else
        break;
    if (list.values().size() == sensorStatusCount) {
        binding.selectAllCheck.setChecked(true);
        binding.selectAllCheck.setText(getResources().getText(R.string.clearAll));
    } else {
        binding.selectAllCheck.setChecked(false);
        binding.selectAllCheck.setText(getResources().getText(R.string.selectAll));
    }
    binding.selectAllCheck.setOnClickListener(v -> {
        for (Map.Entry<String, Boolean> entry : list.entrySet()) preferencesManager.setSensorStatus(binding.selectAllCheck.isChecked(), entry.getKey());
        binding.selectAllCheck.setChecked(binding.selectAllCheck.isChecked());
        binding.selectAllCheck.setText(binding.selectAllCheck.isChecked() ? getResources().getText(R.string.clearAll) : getResources().getText(R.string.selectAll));
        adapter.updateStatusValue(binding.selectAllCheck.isChecked());
        adapter.notifyDataSetChanged();
    });
    binding.delay.setText(String.valueOf(preferencesManager.getDelay()));
    binding.delay.addTextChangedListener(new TextWatcher() {

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
        }

        @Override
        public void afterTextChanged(Editable s) {
            if (!s.toString().isEmpty())
                preferencesManager.setDelay(Integer.parseInt(s.toString()));
        }
    });
    return binding.getRoot();
}
Also used : ArrayList(java.util.ArrayList) SharedPreferencesManager(org.openbot.env.SharedPreferencesManager) DialogSensorsBinding(org.openbot.databinding.DialogSensorsBinding) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) SuppressLint(android.annotation.SuppressLint) LinkedHashMap(java.util.LinkedHashMap) Enums(org.openbot.utils.Enums) SensorManager(android.hardware.SensorManager) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) Sensor(android.hardware.Sensor) SuppressLint(android.annotation.SuppressLint)

Example 3 with SharedPreferencesManager

use of org.openbot.env.SharedPreferencesManager in project OpenBot by isl-org.

the class CameraActivity method onCreate.

@Override
protected void onCreate(final Bundle savedInstanceState) {
    LOGGER.d("onCreate " + this);
    super.onCreate(null);
    context = getApplicationContext();
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    vehicle = OpenBotApplication.vehicle;
    phoneController = PhoneController.getInstance(this);
    setContentView(R.layout.activity_camera);
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    if (PermissionUtils.hasCameraPermission(this)) {
        setFragment();
    } else {
        PermissionUtils.requestCameraPermission(this);
    }
    preferencesManager = new SharedPreferencesManager(this);
    connectionSwitchCompat = findViewById(R.id.connection_switch);
    threadsTextView = findViewById(R.id.threads);
    plusImageView = findViewById(R.id.plus);
    minusImageView = findViewById(R.id.minus);
    networkSwitchCompat = findViewById(R.id.network_switch);
    bottomSheetLayout = findViewById(R.id.bottom_sheet_layout);
    gestureLayout = findViewById(R.id.gesture_layout);
    sheetBehavior = BottomSheetBehavior.from(bottomSheetLayout);
    bottomSheetArrowImageView = findViewById(R.id.bottom_sheet_arrow);
    logSwitchCompat = findViewById(R.id.logger_switch);
    cameraSwitchCompat = findViewById(R.id.camera_toggle_switch);
    baudRateSpinner = findViewById(R.id.baud_rate_spinner);
    ArrayAdapter<CharSequence> baudRateAdapter = ArrayAdapter.createFromResource(this, R.array.baud_rates, R.layout.spinner_item);
    baudRateAdapter.setDropDownViewResource(android.R.layout.simple_list_item_checked);
    baudRateSpinner.setAdapter(baudRateAdapter);
    modelSpinner = findViewById(R.id.model_spinner);
    masterList = FileUtils.loadConfigJSONFromAsset(this);
    List<String> models = masterList.stream().filter(f -> f.pathType != Model.PATH_TYPE.URL).map(f -> FileUtils.nameWithoutExtension(f.name)).collect(Collectors.toList());
    masterList.stream().filter(f -> f.name.contains(preferencesManager.getDefaultModel())).findFirst().ifPresent(f -> model = f);
    modelAdapter = new ArrayAdapter<>(this, R.layout.spinner_item, new ArrayList<>(models));
    modelAdapter.setDropDownViewResource(android.R.layout.simple_list_item_checked);
    modelSpinner.setAdapter(modelAdapter);
    deviceSpinner = findViewById(R.id.device_spinner);
    ArrayAdapter<CharSequence> deviceAdapter = ArrayAdapter.createFromResource(this, R.array.devices, R.layout.spinner_item);
    deviceAdapter.setDropDownViewResource(android.R.layout.simple_list_item_checked);
    deviceSpinner.setAdapter(deviceAdapter);
    logSpinner = findViewById(R.id.log_spinner);
    ArrayAdapter<CharSequence> logAdapter = ArrayAdapter.createFromResource(this, R.array.log_settings, R.layout.spinner_item);
    logAdapter.setDropDownViewResource(android.R.layout.simple_list_item_checked);
    logSpinner.setAdapter(logAdapter);
    controlModeSpinner = findViewById(R.id.control_mode_spinner);
    ArrayAdapter<CharSequence> controlModeAdapter = ArrayAdapter.createFromResource(this, R.array.control_modes, R.layout.spinner_item);
    controlModeAdapter.setDropDownViewResource(android.R.layout.simple_list_item_checked);
    controlModeSpinner.setAdapter(controlModeAdapter);
    driveModeSpinner = findViewById(R.id.drive_mode_spinner);
    ArrayAdapter<CharSequence> driveModeAdapter = ArrayAdapter.createFromResource(this, R.array.drive_modes, R.layout.spinner_item);
    driveModeAdapter.setDropDownViewResource(android.R.layout.simple_list_item_checked);
    driveModeSpinner.setAdapter(driveModeAdapter);
    speedModeSpinner = findViewById(R.id.speed_mode_spinner);
    ArrayAdapter<CharSequence> controlAdapter = ArrayAdapter.createFromResource(this, R.array.speed_modes, R.layout.spinner_item);
    controlAdapter.setDropDownViewResource(android.R.layout.simple_list_item_checked);
    speedModeSpinner.setAdapter(controlAdapter);
    ViewTreeObserver vto = gestureLayout.getViewTreeObserver();
    vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {

        @Override
        public void onGlobalLayout() {
            gestureLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            // int width = bottomSheetLayout.getMeasuredWidth();
            int height = gestureLayout.getMeasuredHeight();
            sheetBehavior.setPeekHeight(height);
        }
    });
    sheetBehavior.setHideable(false);
    sheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {

        @Override
        public void onStateChanged(@NonNull View bottomSheet, int newState) {
            switch(newState) {
                case BottomSheetBehavior.STATE_HIDDEN:
                    break;
                case BottomSheetBehavior.STATE_EXPANDED:
                    bottomSheetArrowImageView.setImageResource(R.drawable.icn_chevron_down);
                    preferencesManager.setSheetExpanded(true);
                    break;
                case BottomSheetBehavior.STATE_COLLAPSED:
                    bottomSheetArrowImageView.setImageResource(R.drawable.icn_chevron_up);
                    preferencesManager.setSheetExpanded(false);
                    break;
                case BottomSheetBehavior.STATE_DRAGGING:
                    break;
                case BottomSheetBehavior.STATE_SETTLING:
                    bottomSheetArrowImageView.setImageResource(R.drawable.icn_chevron_up);
                    break;
            }
        }

        @Override
        public void onSlide(@NonNull View bottomSheet, float slideOffset) {
        }
    });
    voltageTextView = findViewById(R.id.voltage_info);
    speedTextView = findViewById(R.id.speed_info);
    sonarTextView = findViewById(R.id.sonar_info);
    frameValueTextView = findViewById(R.id.frame_info);
    cropValueTextView = findViewById(R.id.crop_info);
    inferenceTimeTextView = findViewById(R.id.inference_info);
    controlValueTextView = findViewById(R.id.control_info);
    connectionSwitchCompat.setOnCheckedChangeListener(this);
    networkSwitchCompat.setOnCheckedChangeListener(this);
    logSwitchCompat.setOnCheckedChangeListener(this);
    cameraSwitchCompat.setOnCheckedChangeListener(this);
    plusImageView.setOnClickListener(this);
    minusImageView.setOnClickListener(this);
    baudRateSpinner.setOnItemSelectedListener(this);
    modelSpinner.setOnItemSelectedListener(this);
    deviceSpinner.setOnItemSelectedListener(this);
    logSpinner.setOnItemSelectedListener(this);
    controlModeSpinner.setOnItemSelectedListener(this);
    driveModeSpinner.setOnItemSelectedListener(this);
    speedModeSpinner.setOnItemSelectedListener(this);
    // Intent for sensor service
    intentSensorService = new Intent(this, SensorService.class);
    setInitialValues();
    // Try to connect to serial device
    toggleConnection(true);
    localBroadcastReceiver = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (action != null) {
                switch(action) {
                    case Constants.USB_ACTION_DATA_RECEIVED:
                        long timestamp = SystemClock.elapsedRealtimeNanos();
                        String data = intent.getStringExtra("data");
                        char header = data.charAt(0);
                        String body = data.substring(1);
                        int type = -1;
                        switch(header) {
                            case 'f':
                                vehicle.processVehicleConfig(body);
                                break;
                            case 'v':
                                if (FormatUtils.isNumeric(body)) {
                                    type = SensorService.MSG_VOLTAGE;
                                    vehicle.setBatteryVoltage(Float.parseFloat(body));
                                    runOnUiThread(() -> {
                                        voltageTextView.setText(String.format(Locale.US, "%2.1f V", vehicle.getBatteryVoltage()));
                                    });
                                } else {
                                    String[] msgParts = body.split(":");
                                    switch(msgParts[0]) {
                                        case "min":
                                            vehicle.setMinMotorVoltage(Float.parseFloat(msgParts[1]));
                                            break;
                                        case "low":
                                            vehicle.setLowBatteryVoltage(Float.parseFloat(msgParts[1]));
                                            break;
                                        case "max":
                                            vehicle.setMaxBatteryVoltage(Float.parseFloat(msgParts[1]));
                                            break;
                                        default:
                                            Toast.makeText(getApplicationContext(), "Invalid voltage message received!", Toast.LENGTH_SHORT).show();
                                            break;
                                    }
                                }
                                break;
                            case 's':
                                if (FormatUtils.isNumeric(body)) {
                                    type = SensorService.MSG_SONAR;
                                    vehicle.setSonarReading(Float.parseFloat(body));
                                    runOnUiThread(() -> {
                                        sonarTextView.setText(String.format(Locale.US, "%3.0f cm", vehicle.getSonarReading()));
                                    });
                                }
                                break;
                            case 'w':
                                String[] itemList = body.split(",");
                                if (itemList.length == 2 && FormatUtils.isNumeric(itemList[0]) && FormatUtils.isNumeric(itemList[1])) {
                                    type = SensorService.MSG_WHEELS;
                                    vehicle.setLeftWheelRpm(Float.parseFloat(itemList[0]));
                                    vehicle.setRightWheelRpm(Float.parseFloat(itemList[1]));
                                    runOnUiThread(() -> {
                                        speedTextView.setText(String.format(Locale.US, "%3.0f,%3.0f rpm", vehicle.getLeftWheelRpm(), vehicle.getRightWheelRpm()));
                                    });
                                }
                                break;
                            case 'b':
                                type = SensorService.MSG_BUMPER;
                                break;
                        }
                        if (type > 0)
                            sendVehicleDataToSensorService(timestamp, data, type);
                        break;
                }
            }
        }
    };
    IntentFilter localIntentFilter = new IntentFilter();
    localIntentFilter.addAction(Constants.USB_ACTION_DATA_RECEIVED);
    localBroadcastManager = LocalBroadcastManager.getInstance(this);
    localBroadcastManager.registerReceiver(localBroadcastReceiver, localIntentFilter);
    vehicle.requestVehicleConfig();
}
Also used : Control(org.openbot.vehicle.Control) Trace(android.os.Trace) LinearLayout(android.widget.LinearLayout) Arrays(java.util.Arrays) Bundle(android.os.Bundle) PackageManager(android.content.pm.PackageManager) NonNull(androidx.annotation.NonNull) Date(java.util.Date) WindowManager(android.view.WindowManager) ImageView(android.widget.ImageView) SharedPreferencesManager(org.openbot.env.SharedPreferencesManager) OnImageAvailableListener(android.media.ImageReader.OnImageAvailableListener) AppCompatActivity(androidx.appcompat.app.AppCompatActivity) IBinder(android.os.IBinder) ByteBuffer(java.nio.ByteBuffer) Device(org.openbot.tflite.Network.Device) JSONObject(org.json.JSONObject) Image(android.media.Image) Locale(java.util.Locale) CameraCharacteristics(android.hardware.camera2.CameraCharacteristics) Handler(android.os.Handler) ServiceConnection(android.content.ServiceConnection) View(android.view.View) LogMode(org.openbot.utils.Enums.LogMode) AdapterView(android.widget.AdapterView) Log(android.util.Log) LogDataUtils(org.openbot.logging.LogDataUtils) R(org.openbot.R) DriveMode(org.openbot.utils.Enums.DriveMode) ImageUtils(org.openbot.env.ImageUtils) Surface(android.view.Surface) StreamConfigurationMap(android.hardware.camera2.params.StreamConfigurationMap) IntentFilter(android.content.IntentFilter) Set(java.util.Set) Constants(org.openbot.utils.Constants) BroadcastReceiver(android.content.BroadcastReceiver) Collectors(java.util.stream.Collectors) FormatUtils(org.openbot.utils.FormatUtils) Timber(timber.log.Timber) PermissionUtils(org.openbot.utils.PermissionUtils) Objects(java.util.Objects) ControlMode(org.openbot.utils.Enums.ControlMode) ConnectionUtils(org.openbot.utils.ConnectionUtils) List(java.util.List) ControllerToBotEventBus(org.openbot.env.ControllerToBotEventBus) TextView(android.widget.TextView) Message(android.os.Message) FileUtils(org.openbot.utils.FileUtils) SensorService(org.openbot.logging.SensorService) Toolbar(androidx.appcompat.widget.Toolbar) OpenBotApplication(org.openbot.OpenBotApplication) Size(android.util.Size) Context(android.content.Context) SpeedMode(org.openbot.utils.Enums.SpeedMode) BottomSheetBehavior(com.google.android.material.bottomsheet.BottomSheetBehavior) Environment(android.os.Environment) SimpleDateFormat(java.text.SimpleDateFormat) Intent(android.content.Intent) RemoteException(android.os.RemoteException) SystemClock(android.os.SystemClock) LocalBroadcastManager(androidx.localbroadcastmanager.content.LocalBroadcastManager) CameraManager(android.hardware.camera2.CameraManager) ArrayList(java.util.ArrayList) SuppressLint(android.annotation.SuppressLint) PhoneController(org.openbot.env.PhoneController) ServerListener(org.openbot.server.ServerListener) Toast(android.widget.Toast) Model(org.openbot.tflite.Model) Fragment(android.app.Fragment) ZipUtil(org.zeroturnaround.zip.ZipUtil) GameController(org.openbot.env.GameController) Vehicle(org.openbot.vehicle.Vehicle) SwitchCompat(androidx.appcompat.widget.SwitchCompat) CompoundButton(android.widget.CompoundButton) ComponentName(android.content.ComponentName) ActivityCompat(androidx.core.app.ActivityCompat) ServerCommunication(org.openbot.server.ServerCommunication) ImageReader(android.media.ImageReader) AudioPlayer(org.openbot.env.AudioPlayer) Messenger(android.os.Messenger) Plane(android.media.Image.Plane) File(java.io.File) Spinner(android.widget.Spinner) Color(android.graphics.Color) TimeUnit(java.util.concurrent.TimeUnit) ArrayAdapter(android.widget.ArrayAdapter) HandlerThread(android.os.HandlerThread) Enums(org.openbot.utils.Enums) CameraAccessException(android.hardware.camera2.CameraAccessException) ViewTreeObserver(android.view.ViewTreeObserver) Logger(org.openbot.env.Logger) Camera(android.hardware.Camera) BotToControllerEventBus(org.openbot.env.BotToControllerEventBus) Context(android.content.Context) IntentFilter(android.content.IntentFilter) ArrayList(java.util.ArrayList) SharedPreferencesManager(org.openbot.env.SharedPreferencesManager) Intent(android.content.Intent) BroadcastReceiver(android.content.BroadcastReceiver) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint) BottomSheetBehavior(com.google.android.material.bottomsheet.BottomSheetBehavior) SensorService(org.openbot.logging.SensorService) ViewTreeObserver(android.view.ViewTreeObserver) Toolbar(androidx.appcompat.widget.Toolbar)

Example 4 with SharedPreferencesManager

use of org.openbot.env.SharedPreferencesManager in project OpenBot by isl-org.

the class SensorService method onCreate.

@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public final void onCreate() {
    super.onCreate();
    sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    accelerometerSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    gyroscopeSensor = sensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
    gravitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY);
    magneticSensor = sensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
    lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
    proximitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
    pressureSensor = sensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE);
    temperatureSensor = sensorManager.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE);
    poseSensor = sensorManager.getDefaultSensor(Sensor.TYPE_POSE_6DOF);
    motionSensor = sensorManager.getDefaultSensor(Sensor.TYPE_MOTION_DETECT);
    // Initialize the FusedLocationClient.
    fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
    preferencesManager = new SharedPreferencesManager(this);
}
Also used : SharedPreferencesManager(org.openbot.env.SharedPreferencesManager) RequiresApi(androidx.annotation.RequiresApi)

Aggregations

SharedPreferencesManager (org.openbot.env.SharedPreferencesManager)4 SuppressLint (android.annotation.SuppressLint)2 ArrayList (java.util.ArrayList)2 AudioPlayer (org.openbot.env.AudioPlayer)2 ServerCommunication (org.openbot.server.ServerCommunication)2 Enums (org.openbot.utils.Enums)2 Fragment (android.app.Fragment)1 BroadcastReceiver (android.content.BroadcastReceiver)1 ComponentName (android.content.ComponentName)1 Context (android.content.Context)1 Intent (android.content.Intent)1 IntentFilter (android.content.IntentFilter)1 ServiceConnection (android.content.ServiceConnection)1 PackageManager (android.content.pm.PackageManager)1 Color (android.graphics.Color)1 Camera (android.hardware.Camera)1 Sensor (android.hardware.Sensor)1 SensorManager (android.hardware.SensorManager)1 CameraAccessException (android.hardware.camera2.CameraAccessException)1 CameraCharacteristics (android.hardware.camera2.CameraCharacteristics)1