├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── LICENSE.txt ├── README.md ├── docs ├── build.gradle └── src │ └── orchid │ └── resources │ ├── assets │ ├── css │ │ └── jacquard.scss │ ├── js │ │ └── jacquard.js │ └── media │ │ ├── apis │ │ ├── connect.png │ │ └── connected.png │ │ ├── dfu │ │ ├── dfu_complete.png │ │ ├── dfu_progress.png │ │ ├── fw_check.png │ │ └── jq_onboarding_complete.png │ │ ├── logo.svg │ │ ├── search-icon.svg │ │ └── tutorial │ │ ├── activity_main.png │ │ ├── create_conected_activity.png │ │ ├── create_main_activity.png │ │ └── create_new_project.png │ ├── config.yml │ ├── homepage.md │ ├── templates │ ├── includes │ │ └── sidebar.peb │ └── layouts │ │ └── index.peb │ └── wiki │ ├── apis.md │ ├── cloud-api-terms.md │ ├── codelabs.md │ ├── conduct.md │ ├── contributing.md │ ├── firmware_update.md │ ├── generate-docs.md │ ├── integration.md │ ├── license.md │ ├── releases.md │ ├── summary.md │ └── tutorial.md ├── sample ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── lint.xml │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── google │ │ │ └── android │ │ │ └── jacquard │ │ │ └── sample │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── ic_launcher-playstore.png │ │ ├── java │ │ │ └── com │ │ │ │ └── google │ │ │ │ └── android │ │ │ │ └── jacquard │ │ │ │ └── sample │ │ │ │ ├── ActivityResult.kt │ │ │ │ ├── BluetoothStateChangeReceiver.kt │ │ │ │ ├── ConnectivityManager.kt │ │ │ │ ├── KnownTag.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── MainActivityViewModel.kt │ │ │ │ ├── Preferences.kt │ │ │ │ ├── ResourceLocator.kt │ │ │ │ ├── SampleApplication.kt │ │ │ │ ├── ViewModelFactory.kt │ │ │ │ ├── dialog │ │ │ │ ├── BottomSheetDialogFragment.kt │ │ │ │ ├── BottomSheetItem.kt │ │ │ │ ├── DFUUtil.kt │ │ │ │ ├── DefaultDialog.kt │ │ │ │ └── DialogUtils.kt │ │ │ │ ├── firmwareupdate │ │ │ │ ├── ApplyFirmwareListener.kt │ │ │ │ ├── FirmwareManager.kt │ │ │ │ ├── FirmwareUpdateFragment.kt │ │ │ │ └── FirmwareUpdateViewModel.kt │ │ │ │ ├── fragment │ │ │ │ └── extensions │ │ │ │ │ └── FragmentExtension.kt │ │ │ │ ├── gesture │ │ │ │ ├── GestureAdapter.kt │ │ │ │ ├── GestureFragment.kt │ │ │ │ ├── GestureInfo.kt │ │ │ │ ├── GestureInfoAdapter.kt │ │ │ │ ├── GestureInfoFragment.kt │ │ │ │ ├── GestureView.kt │ │ │ │ └── GestureViewModel.kt │ │ │ │ ├── haptics │ │ │ │ ├── HapticPatternType.kt │ │ │ │ ├── HapticsAdapter.kt │ │ │ │ ├── HapticsFragment.kt │ │ │ │ └── HapticsViewModel.kt │ │ │ │ ├── home │ │ │ │ ├── HomeFragment.kt │ │ │ │ ├── HomeTileModel.kt │ │ │ │ ├── HomeTilesListAdapter.kt │ │ │ │ ├── HomeViewModel.kt │ │ │ │ ├── ItemClickListener.kt │ │ │ │ └── ItemOffsetDecoration.kt │ │ │ │ ├── imu │ │ │ │ ├── IMUFragment.kt │ │ │ │ ├── ImuDataListAdapter.kt │ │ │ │ ├── ImuSamplesListFragment.kt │ │ │ │ ├── ImuSamplesListViewModel.kt │ │ │ │ ├── ImuSessionListAdapter.kt │ │ │ │ ├── ImuStreamingFragment.kt │ │ │ │ ├── ImuStreamingViewModel.kt │ │ │ │ ├── ImuViewModel.kt │ │ │ │ └── db │ │ │ │ │ ├── ImuSessionDao.kt │ │ │ │ │ └── JqSessionInfo.kt │ │ │ │ ├── ledpattern │ │ │ │ ├── LedPatternAdapter.kt │ │ │ │ ├── LedPatternFragment.kt │ │ │ │ ├── LedPatternItem.kt │ │ │ │ └── LedPatternViewModel.kt │ │ │ │ ├── musicalthreads │ │ │ │ ├── MusicalThreadsFragment.kt │ │ │ │ ├── MusicalThreadsViewModel.kt │ │ │ │ ├── audio │ │ │ │ │ ├── Fader.kt │ │ │ │ │ ├── SoundPlayer.kt │ │ │ │ │ ├── SoundPoolPlayer.kt │ │ │ │ │ └── Stream.kt │ │ │ │ └── player │ │ │ │ │ ├── Constants.kt │ │ │ │ │ ├── PluckThreadsPlayerImpl.kt │ │ │ │ │ └── ThreadsPlayer.kt │ │ │ │ ├── places │ │ │ │ ├── GestureAdapter.kt │ │ │ │ ├── GestureItem.kt │ │ │ │ ├── PlacesConfigFragment.kt │ │ │ │ ├── PlacesConfigViewModel.kt │ │ │ │ ├── PlacesDetailsFragment.kt │ │ │ │ ├── PlacesDetailsViewModel.kt │ │ │ │ ├── PlacesItem.kt │ │ │ │ ├── PlacesListAdapter.kt │ │ │ │ ├── PlacesListFragment.kt │ │ │ │ ├── PlacesListViewModel.kt │ │ │ │ └── db │ │ │ │ │ ├── PlaceItem.kt │ │ │ │ │ └── PlaceItemDao.kt │ │ │ │ ├── renametag │ │ │ │ ├── RenameTagFragment.kt │ │ │ │ └── RenameTagViewModel.kt │ │ │ │ ├── scan │ │ │ │ ├── AdapterItem.kt │ │ │ │ ├── ScanAdapter.kt │ │ │ │ ├── ScanFragment.kt │ │ │ │ └── ScanViewModel.kt │ │ │ │ ├── splash │ │ │ │ ├── SplashFragment.kt │ │ │ │ └── SplashViewModel.kt │ │ │ │ ├── storage │ │ │ │ ├── ImuSessionsRepository.kt │ │ │ │ ├── JQRoomDatabase.kt │ │ │ │ └── PlacesRepository.kt │ │ │ │ ├── tagmanager │ │ │ │ ├── TagDetailsFragment.kt │ │ │ │ ├── TagDetailsViewModel.kt │ │ │ │ ├── TagManagerAdapter.kt │ │ │ │ ├── TagManagerFragment.kt │ │ │ │ └── TagManagerViewModel.kt │ │ │ │ ├── touchdata │ │ │ │ ├── TouchDataViewModel.kt │ │ │ │ └── TouchYourThreadsFragment.kt │ │ │ │ └── utilities │ │ │ │ ├── AbilityConstants.kt │ │ │ │ ├── CustomBottomProgress.kt │ │ │ │ ├── CustomProgressLoader.kt │ │ │ │ ├── DateUtil.kt │ │ │ │ ├── JacquardRelativeLayout.kt │ │ │ │ ├── Recipe.kt │ │ │ │ ├── RecipeManager.kt │ │ │ │ ├── ShakeDetector.kt │ │ │ │ ├── TwoFingerDoubleTapDetector.kt │ │ │ │ └── Util.kt │ │ └── res │ │ │ ├── anim │ │ │ ├── enter_from_left.xml │ │ │ ├── enter_from_right.xml │ │ │ ├── exit_to_left.xml │ │ │ └── exit_to_right.xml │ │ │ ├── color │ │ │ ├── red_green_activated_color.xml │ │ │ ├── solid_black_bg_color.xml │ │ │ └── solid_black_text_color.xml │ │ │ ├── drawable-hdpi │ │ │ ├── jq_tag.webp │ │ │ └── product_blur_image_hear.webp │ │ │ ├── drawable-mdpi │ │ │ └── jq_tag.webp │ │ │ ├── drawable-xhdpi │ │ │ ├── jq_tag.webp │ │ │ └── product_blur_image_hear.webp │ │ │ ├── drawable-xxhdpi │ │ │ ├── jq_tag.webp │ │ │ └── product_blur_image_hear.webp │ │ │ ├── drawable-xxxhdpi │ │ │ └── jq_tag.webp │ │ │ ├── drawable │ │ │ ├── button_background_gradient.xml │ │ │ ├── button_update_all_selector.xml │ │ │ ├── clear_icon.xml │ │ │ ├── config_button_gradient.xml │ │ │ ├── delete.xml │ │ │ ├── download.xml │ │ │ ├── font_color_with_states.xml │ │ │ ├── gray_outline.xml │ │ │ ├── green_indicator.xml │ │ │ ├── haptics_icon.xml │ │ │ ├── ic_add_24px.xml │ │ │ ├── ic_blink.xml │ │ │ ├── ic_blue.xml │ │ │ ├── ic_brush_in.xml │ │ │ ├── ic_brush_out.xml │ │ │ ├── ic_chevron_left_24px.xml │ │ │ ├── ic_close_24px.xml │ │ │ ├── ic_cover.xml │ │ │ ├── ic_double_tap.xml │ │ │ ├── ic_green.xml │ │ │ ├── ic_group_607.xml │ │ │ ├── ic_info_icon.xml │ │ │ ├── ic_led_duration.xml │ │ │ ├── ic_more.xml │ │ │ ├── ic_pink.xml │ │ │ ├── ic_play.xml │ │ │ ├── ic_settings_suggest_disable.xml │ │ │ ├── ic_settings_suggest_enable.xml │ │ │ ├── ic_shine.xml │ │ │ ├── ic_stop_all.xml │ │ │ ├── ic_strobe.xml │ │ │ ├── ic_toggle_off_24px.xml │ │ │ ├── ic_toggle_on_24px.xml │ │ │ ├── led_duration_selected_background.xml │ │ │ ├── led_duration_selector.xml │ │ │ ├── led_duration_unselected_background.xml │ │ │ ├── list_view_divider.xml │ │ │ ├── overflow.xml │ │ │ ├── paired_icon.xml │ │ │ ├── play_circle_filled_24px.xml │ │ │ ├── product_backpack_outline.xml │ │ │ ├── product_blur_image_hear.webp │ │ │ ├── product_jacket_outline.xml │ │ │ ├── protokit_a0.xml │ │ │ ├── protokit_b0.xml │ │ │ ├── red_indicator.xml │ │ │ ├── round_corner_places.xml │ │ │ ├── scan_item_selected_background.xml │ │ │ ├── scan_item_unselected_background.xml │ │ │ ├── scan_list_item_selector.xml │ │ │ ├── scan_list_item_serial_number_selector.xml │ │ │ ├── scan_list_item_tag_name_selector.xml │ │ │ ├── scan_tag_icon_selector.xml │ │ │ ├── setting_suggest.xml │ │ │ ├── shape_tile_disabled.xml │ │ │ ├── shape_tile_enabled.xml │ │ │ ├── share.xml │ │ │ ├── splash_logo.xml │ │ │ ├── stop_reacording.xml │ │ │ ├── stop_recording_button_drawable.xml │ │ │ ├── switch_selector.xml │ │ │ ├── tag_indicator_icon.xml │ │ │ ├── tag_unselected_icon.xml │ │ │ ├── thread_line.xml │ │ │ ├── thread_line0.xml │ │ │ ├── thread_line_off.xml │ │ │ ├── thread_line_on_1.xml │ │ │ ├── thread_line_on_2.xml │ │ │ ├── thread_line_on_3.xml │ │ │ ├── thread_line_on_4.xml │ │ │ ├── thread_line_on_5.xml │ │ │ ├── thread_line_on_6.xml │ │ │ ├── thread_line_on_7.xml │ │ │ ├── thread_line_on_8.xml │ │ │ ├── thread_line_on_9.xml │ │ │ ├── top_shadow_gradient.xml │ │ │ └── view_session_data.xml │ │ │ ├── font │ │ │ └── sf_pro_display_medium.otf │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── assign_button.xml │ │ │ ├── container_bottom_sheet.xml │ │ │ ├── current_imu_session.xml │ │ │ ├── custom_progress_bar_holder.xml │ │ │ ├── fragment_custom_dialog.xml │ │ │ ├── fragment_firmware_update.xml │ │ │ ├── fragment_gesture.xml │ │ │ ├── fragment_gesture_info.xml │ │ │ ├── fragment_haptics.xml │ │ │ ├── fragment_home.xml │ │ │ ├── fragment_imu.xml │ │ │ ├── fragment_led_pattern.xml │ │ │ ├── fragment_musical_threads.xml │ │ │ ├── fragment_places_config.xml │ │ │ ├── fragment_places_details.xml │ │ │ ├── fragment_places_list.xml │ │ │ ├── fragment_rename_tag.xml │ │ │ ├── fragment_scan.xml │ │ │ ├── fragment_splash.xml │ │ │ ├── fragment_tag_details.xml │ │ │ ├── fragment_tag_manager.xml │ │ │ ├── fragment_touch_data.xml │ │ │ ├── gesture_item.xml │ │ │ ├── gesture_list_item.xml │ │ │ ├── gesture_overlay.xml │ │ │ ├── gesture_overview_item.xml │ │ │ ├── haptic_item.xml │ │ │ ├── imu_bottom_sheet.xml │ │ │ ├── imu_fragment_rtstream.xml │ │ │ ├── imu_sample_list_item.xml │ │ │ ├── imu_samples_list.xml │ │ │ ├── imu_session_list_item.xml │ │ │ ├── item_bottom_sheet.xml │ │ │ ├── item_dfu_progress.xml │ │ │ ├── item_product_section.xml │ │ │ ├── item_product_tile_api.xml │ │ │ ├── item_product_tile_sample_use_case.xml │ │ │ ├── led_pattern_item.xml │ │ │ ├── places_list_item.xml │ │ │ ├── places_section_item.xml │ │ │ ├── scan_list_section_header.xml │ │ │ ├── scan_list_tag.xml │ │ │ └── threads.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ └── tag_image.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ └── tag_image.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── navigation │ │ │ └── navigation_graph.xml │ │ │ ├── raw │ │ │ ├── b2_3.mp3 │ │ │ ├── b3_4.mp3 │ │ │ ├── d3_5.mp3 │ │ │ ├── d4_10.mp3 │ │ │ ├── d4_6.mp3 │ │ │ ├── d4_9.mp3 │ │ │ ├── g2_1.mp3 │ │ │ ├── g3_2.mp3 │ │ │ ├── g3_7.mp3 │ │ │ ├── g4_11.mp3 │ │ │ ├── g4_12.mp3 │ │ │ └── g4_8.mp3 │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ ├── styles.xml │ │ │ └── themes.xml │ │ │ └── xml │ │ │ └── file_paths.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── google │ │ └── android │ │ └── jacquard │ │ └── sample │ │ ├── ExampleUnitTest.java │ │ └── utilities │ │ └── RecipeManagerTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── scripts └── generate_docs.sh ├── sdk ├── .gitignore ├── build.gradle ├── gradle.properties ├── sdk │ ├── .gitignore │ ├── build.gradle │ ├── generateMavenArtifacts.sh │ ├── libs │ │ ├── libjacquard_core_proto-lite.jar │ │ └── libjacquard_proto-lite.jar │ ├── lint.xml │ ├── proguard-rules.pro │ └── src │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── google │ │ │ │ └── android │ │ │ │ └── jacquard │ │ │ │ └── sdk │ │ │ │ ├── BleAdapter.java │ │ │ │ ├── BleGattCallback.java │ │ │ │ ├── BleQueue.java │ │ │ │ ├── BleScanCallback.java │ │ │ │ ├── ConnectState.java │ │ │ │ ├── JacquardManager.java │ │ │ │ ├── JacquardManagerImpl.java │ │ │ │ ├── JqExtensionRegistry.java │ │ │ │ ├── ManagerScanningException.java │ │ │ │ ├── MemoryCache.java │ │ │ │ ├── SdkInitProvider.java │ │ │ │ ├── StateMachine.java │ │ │ │ ├── command │ │ │ │ ├── AttachedNotificationSubscription.java │ │ │ │ ├── BatteryStatus.java │ │ │ │ ├── BatteryStatusCommand.java │ │ │ │ ├── BatteryStatusNotificationSubscription.java │ │ │ │ ├── ContinuousTouchNotificationSubscription.java │ │ │ │ ├── DCErrorNotificationSubscription.java │ │ │ │ ├── DataCollectionStatusCommand.java │ │ │ │ ├── DeviceInfo.java │ │ │ │ ├── DeviceInfoCommand.java │ │ │ │ ├── DfuExecuteUpdateNotificationSubscription.java │ │ │ │ ├── EraseImuSessionCommand.java │ │ │ │ ├── GestureNotificationSubscription.java │ │ │ │ ├── GetConfigCommand.java │ │ │ │ ├── GetImuSessionDataCommand.java │ │ │ │ ├── HapticCommand.java │ │ │ │ ├── ImuSessionListCommand.java │ │ │ │ ├── ImuSessionListNotification.java │ │ │ │ ├── InnerAttachedNotificationSubscription.java │ │ │ │ ├── InnerBatteryStatusNotificationSubscription.java │ │ │ │ ├── InnerContinuousTouchNotificationSubscription.java │ │ │ │ ├── InnerDCErrorNotificationSubscription.java │ │ │ │ ├── InnerDfuExecuteUpdateNotificationSubscription.java │ │ │ │ ├── InnerGestureNotificationSubscription.java │ │ │ │ ├── InnerImuSessionListNotificationSubscription.java │ │ │ │ ├── InnerLoadModuleNotificationSubscription.java │ │ │ │ ├── InnerNotification.java │ │ │ │ ├── ListModulesCommand.java │ │ │ │ ├── LoadModuleCommand.java │ │ │ │ ├── LoadModuleNotificationSubscription.java │ │ │ │ ├── NotificationSubscription.java │ │ │ │ ├── PlayLedPatternCommand.java │ │ │ │ ├── ProtoCommandRequest.java │ │ │ │ ├── RenameTagCommand.java │ │ │ │ ├── SetConfigCommand.java │ │ │ │ ├── SetTouchModeCommand.java │ │ │ │ ├── StartImuSessionCommand.java │ │ │ │ ├── StartImuStreamingCommand.java │ │ │ │ ├── StopImuSessionCommand.java │ │ │ │ ├── UjtReadConfigCommand.java │ │ │ │ ├── UjtWriteConfigCommand.java │ │ │ │ └── UnloadModuleCommand.java │ │ │ │ ├── connection │ │ │ │ ├── ConnectionEvent.java │ │ │ │ ├── ConnectionState.java │ │ │ │ ├── Result.java │ │ │ │ └── TagConnectionStateMachine.java │ │ │ │ ├── datastore │ │ │ │ ├── ComponentMetaData.java │ │ │ │ └── DataProvider.java │ │ │ │ ├── dfu │ │ │ │ ├── CacheRepository.java │ │ │ │ ├── CacheRepositoryImpl.java │ │ │ │ ├── CloudManager.java │ │ │ │ ├── DFUChecker.java │ │ │ │ ├── DFUInfo.java │ │ │ │ ├── DfuExecuteCommand.java │ │ │ │ ├── DfuManager.java │ │ │ │ ├── DfuManagerImpl.java │ │ │ │ ├── DfuPrepareCommand.java │ │ │ │ ├── DfuStatusCommand.java │ │ │ │ ├── DfuUtil.java │ │ │ │ ├── DfuWriteCommand.java │ │ │ │ ├── DownloadManager.java │ │ │ │ ├── DownloadManagerImpl.java │ │ │ │ ├── FirmwareImageWriterEvent.java │ │ │ │ ├── FirmwareImageWriterState.java │ │ │ │ ├── FirmwareImageWriterStateMachine.java │ │ │ │ ├── FirmwareUpdateEvents.java │ │ │ │ ├── FirmwareUpdateState.java │ │ │ │ ├── FirmwareUpdateStateMachine.java │ │ │ │ ├── RemoteDfuInfo.java │ │ │ │ ├── execption │ │ │ │ │ ├── FirmwareUpdateStoppedException.java │ │ │ │ │ ├── InsufficientBatteryException.java │ │ │ │ │ ├── UpdateMismatchException.java │ │ │ │ │ └── UpdatedFirmwareNotFoundException.java │ │ │ │ └── model │ │ │ │ │ ├── FileDescriptor.java │ │ │ │ │ ├── PlatformSettings.java │ │ │ │ │ └── TransferState.java │ │ │ │ ├── imu │ │ │ │ ├── ImuModule.java │ │ │ │ ├── Sensors.java │ │ │ │ ├── exception │ │ │ │ │ ├── DCException.java │ │ │ │ │ ├── InprogressDCException.java │ │ │ │ │ └── InvalidStateDCException.java │ │ │ │ ├── model │ │ │ │ │ ├── ImuSessionInfo.java │ │ │ │ │ └── ImuStream.java │ │ │ │ └── parser │ │ │ │ │ ├── ImuParser.java │ │ │ │ │ ├── ImuParserException.java │ │ │ │ │ ├── ImuParserImpl.java │ │ │ │ │ ├── ImuSessionData.java │ │ │ │ │ └── JQImuParser.java │ │ │ │ ├── initialization │ │ │ │ ├── InitializationEvent.java │ │ │ │ ├── InitializationState.java │ │ │ │ ├── PendingRequest.java │ │ │ │ ├── ProtocolInitializationStateMachine.java │ │ │ │ ├── Transport.java │ │ │ │ ├── TransportImpl.java │ │ │ │ ├── TransportState.java │ │ │ │ └── command │ │ │ │ │ ├── BeginCommand.java │ │ │ │ │ ├── DeviceInfoCommand.java │ │ │ │ │ └── HelloCommand.java │ │ │ │ ├── lm │ │ │ │ ├── InitState.java │ │ │ │ └── LoadableModule.java │ │ │ │ ├── log │ │ │ │ ├── LogLevel.java │ │ │ │ ├── Logger.java │ │ │ │ ├── LoggerImpl.java │ │ │ │ └── PrintLogger.java │ │ │ │ ├── model │ │ │ │ ├── CharacteristicUpdate.java │ │ │ │ ├── Component.java │ │ │ │ ├── ComponentCapability.java │ │ │ │ ├── ComponentKey.java │ │ │ │ ├── DeviceConfigElement.java │ │ │ │ ├── FailedToConnect.java │ │ │ │ ├── GearState.java │ │ │ │ ├── Gesture.java │ │ │ │ ├── InternalComponent.java │ │ │ │ ├── JacquardError.java │ │ │ │ ├── Module.java │ │ │ │ ├── Peripheral.java │ │ │ │ ├── Product.java │ │ │ │ ├── ProtocolSpec.java │ │ │ │ ├── Revision.java │ │ │ │ ├── RssiUpdate.java │ │ │ │ ├── SdkConfig.java │ │ │ │ ├── ServicesDiscovered.java │ │ │ │ ├── TouchData.java │ │ │ │ ├── TouchMode.java │ │ │ │ ├── Vendor.java │ │ │ │ └── VidPidMid.java │ │ │ │ ├── pairing │ │ │ │ ├── RequiredCharacteristics.java │ │ │ │ ├── TagPairingEvent.java │ │ │ │ ├── TagPairingState.java │ │ │ │ └── TagPairingStateMachine.java │ │ │ │ ├── remote │ │ │ │ ├── LocalJsonParserImpl.java │ │ │ │ ├── LocalParser.java │ │ │ │ ├── LocalRemoteFunctionImpl.java │ │ │ │ ├── MetaDataModel.java │ │ │ │ ├── RemoteFactory.java │ │ │ │ └── RemoteFunction.java │ │ │ │ ├── rx │ │ │ │ ├── Consumer.java │ │ │ │ ├── Executors.java │ │ │ │ ├── Fn.java │ │ │ │ ├── Fn2.java │ │ │ │ ├── Pred.java │ │ │ │ ├── Producer.java │ │ │ │ └── Signal.java │ │ │ │ ├── tag │ │ │ │ ├── AdvertisedJacquardTag.java │ │ │ │ ├── AdvertisedJacquardTagImpl.java │ │ │ │ ├── ConnectedJacquardTag.java │ │ │ │ ├── ConnectedJacquardTagImpl.java │ │ │ │ └── JacquardTag.java │ │ │ │ └── util │ │ │ │ ├── BluetoothSig.java │ │ │ │ ├── BluetoothUtils.java │ │ │ │ ├── FileLogger.java │ │ │ │ ├── Fragmenter.java │ │ │ │ ├── Function.java │ │ │ │ ├── JQUtils.java │ │ │ │ ├── Lists.java │ │ │ │ ├── Objects.java │ │ │ │ ├── SdkTypeAdapterFactory.java │ │ │ │ └── StringUtils.java │ │ └── res │ │ │ └── raw │ │ │ ├── badfirmwareversion.json │ │ │ └── metadata.json │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── google │ │ │ └── android │ │ │ └── jacquard │ │ │ └── sdk │ │ │ ├── BleAdapterTest.java │ │ │ ├── BleGattCallbackTest.java │ │ │ ├── BleQueueTest.java │ │ │ ├── BleScanCallbackTest.java │ │ │ ├── CommonContextStub.java │ │ │ ├── ExampleUnitTest.java │ │ │ ├── FakeBleAdapter.java │ │ │ ├── FakeBluetoothGattCharacteristic.java │ │ │ ├── FakeBluetoothGattDescriptor.java │ │ │ ├── FakeCommand.java │ │ │ ├── FakeConnectState.java │ │ │ ├── FakeJacquardManagerImpl.java │ │ │ ├── JacquardManagerImplTest.java │ │ │ ├── JacquardManagerInitialization.java │ │ │ ├── command │ │ │ ├── AttachedNotificationSubscriptionTest.java │ │ │ ├── BatteryStatusCommandTest.java │ │ │ ├── BatteryStatusNotificationSubscriptionTest.java │ │ │ ├── ContinuousTouchNotificationSubscriptionTest.java │ │ │ ├── DeviceInfoCommandTest.java │ │ │ ├── FakeComponent.java │ │ │ ├── GestureNotificationSubscriptionTest.java │ │ │ ├── HapticCommandTest.java │ │ │ ├── InnerAttachedNotificationSubscriptionTest.java │ │ │ ├── InnerBatteryStatusNotificationSubscriptionTest.java │ │ │ ├── InnerContinuousTouchNotificationSubscriptionTest.java │ │ │ ├── InnerGestureNotificationSubscriptionTest.java │ │ │ ├── PlayLedPatternCommandTest.java │ │ │ ├── RenameTagCommandTest.java │ │ │ ├── SetTouchModeCommandTest.java │ │ │ ├── UjtReadConfigCommandTest.java │ │ │ └── UjtWriteConfigCommandTest.java │ │ │ ├── connection │ │ │ ├── ResultTest.java │ │ │ └── TagConnectionStateMachineTest.java │ │ │ ├── datastore │ │ │ └── DataProviderTest.java │ │ │ ├── dfu │ │ │ ├── CacheRepositoryImplTest.java │ │ │ ├── CacheRepositoryTest.java │ │ │ ├── DFUCheckerTest.java │ │ │ ├── DFUInfoTest.java │ │ │ ├── DfuExecuteCommandTest.java │ │ │ ├── DfuManagerImplTest.java │ │ │ ├── DfuPrepareCommandTest.java │ │ │ ├── DfuStatusCommandTest.java │ │ │ ├── DfuUtilTest.java │ │ │ ├── DfuWriteCommandTest.java │ │ │ ├── DownloadCallbackTest.java │ │ │ ├── DownloadManagerImplTest.java │ │ │ ├── DummyDFUChecker.java │ │ │ ├── FakeCall.java │ │ │ ├── FakeCloudManager.java │ │ │ ├── FakeDownloadCallback.java │ │ │ ├── FakeDownloadManager.java │ │ │ ├── FirmwareImageWriterStateMachineTest.java │ │ │ └── model │ │ │ │ └── FileDescriptorTest.java │ │ │ ├── imu │ │ │ ├── FakeDfuManager.java │ │ │ └── ImuModuleTest.java │ │ │ ├── initialization │ │ │ ├── FakeProtocolInitializationStateMachine.java │ │ │ ├── FakeTransportImpl.java │ │ │ ├── FakeTransportState.java │ │ │ ├── ProtocolInitializationStateMachineTest.java │ │ │ └── TransportTest.java │ │ │ ├── log │ │ │ ├── LoggerImplTest.java │ │ │ └── PrintLoggerTest.java │ │ │ ├── model │ │ │ ├── FakeDCTrialListNotification.java │ │ │ ├── FakeImuModule.java │ │ │ └── FakePeripheral.java │ │ │ ├── pairing │ │ │ ├── FakeTagPairingStateMachine.java │ │ │ └── TagPairingStateMachineTest.java │ │ │ ├── remote │ │ │ ├── FakeLocalRemoteFunction.java │ │ │ └── RemoteFunctionInitialization.java │ │ │ ├── rx │ │ │ └── SignalTest.java │ │ │ ├── tag │ │ │ ├── AdvertisedJacquardTagImplTest.java │ │ │ ├── ConnectedJacquardTagImplTest.java │ │ │ ├── ConnectedJacquardTagInitialization.java │ │ │ ├── FakeAdvertisedJacquardTag.java │ │ │ ├── FakeConnectedJacquardTagImpl.java │ │ │ └── JacquardTagFactory.java │ │ │ └── util │ │ │ ├── FakeFragmenter.java │ │ │ ├── FragmenterTest.java │ │ │ └── StringUtilsTests.java │ │ └── resources │ │ ├── 1627344030.bin │ │ ├── badfirmwareversion.json │ │ └── metadata.json └── settings.gradle └── version.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | /sample/.idea/gradle.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | .cxx 16 | local.properties 17 | docs/build 18 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Jacquard SDK 2 | 3 | Contributions to this project are welcomed. We request that you 4 | read through the guidelines before getting started. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement (CLA). You (or your employer) retain the copyright to your 10 | contribution; this simply gives us permission to use and redistribute your 11 | contributions as part of the project. Head over to 12 | to see your current agreements on file or 13 | to sign a new one. 14 | 15 | You generally only need to submit a CLA once, so if you've already submitted one 16 | (even if it was for a different project), you probably don't need to do it 17 | again. 18 | 19 | ## Community guidelines 20 | 21 | This project follows 22 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). 23 | 24 | ## Contribution 25 | 26 | ### Code reviews 27 | 28 | All submissions will be reviewed before merging. Submissions are reviewed using 29 | [GitHub pull requests](https://help.github.com/articles/about-pull-requests/). -------------------------------------------------------------------------------- /docs/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.eden.orchidPlugin" version "0.21.0" 3 | } 4 | 5 | ext { 6 | orchid_version = "0.21.0" 7 | } 8 | 9 | dependencies { 10 | orchidRuntime "io.github.javaeden.orchid:OrchidDocs:$orchid_version" 11 | orchidRuntime "io.github.javaeden.orchid:OrchidJavadoc:$orchid_version" 12 | orchidRuntime "io.github.javaeden.orchid:OrchidPluginDocs:$orchid_version" 13 | } 14 | 15 | repositories { 16 | jcenter() 17 | } 18 | 19 | orchid { 20 | theme = "Editorial" 21 | version = "1.0.0" 22 | srcDir = "src/orchid/resources" 23 | destDir = "build/docs/orchid" 24 | baseUrl = "/JacquardSDKAndroid/" 25 | } -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/js/jacquard.js: -------------------------------------------------------------------------------- 1 | const JacquardDoc = { 2 | toggleSearch: () => { 3 | const searchPanel = document.getElementById("search"); 4 | if (searchPanel.className == "search-active") { 5 | searchPanel.className = ""; 6 | document.getElementById("search-progress").style.display = "none"; 7 | document.getElementById("search-results").style.display = "none"; 8 | } else { 9 | searchPanel.className = "search-active"; 10 | document.getElementById("search_input").focus(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/apis/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/apis/connect.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/apis/connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/apis/connected.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/dfu/dfu_complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/dfu/dfu_complete.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/dfu/dfu_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/dfu/dfu_progress.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/dfu/fw_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/dfu/fw_check.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/dfu/jq_onboarding_complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/dfu/jq_onboarding_complete.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/search-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/tutorial/activity_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/tutorial/activity_main.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/tutorial/create_conected_activity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/tutorial/create_conected_activity.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/tutorial/create_main_activity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/tutorial/create_main_activity.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/assets/media/tutorial/create_new_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/docs/src/orchid/resources/assets/media/tutorial/create_new_project.png -------------------------------------------------------------------------------- /docs/src/orchid/resources/config.yml: -------------------------------------------------------------------------------- 1 | site: 2 | about: 3 | siteName: Jacquard SDK 4 | siteDescription: This is a short description of this project. 5 | Editorial: 6 | primaryColor: '#DE9149' 7 | social: 8 | github: 'username/project' # TODO Link with github 9 | extraCss: 10 | - 'assets/css/jacquard.scss' 11 | extraJs: 12 | - 'assets/js/jacquard.js' 13 | assets: 14 | sourceDirs: 15 | - 'assets/media' 16 | metaComponents: 17 | - type: 'orchidSearch' 18 | menu: 19 | - type: 'separator' 20 | title: 'Getting Started' 21 | - type: 'wiki' 22 | itemId: 'wiki' 23 | - type: 'separator' 24 | title: 'API Docs' 25 | - type: 'sourcedocPages' 26 | moduleType: 'javadoc' 27 | node: 'classes' 28 | asSubmenu: true 29 | submenuTitle: 'Classes' 30 | - type: 'sourcedocPages' 31 | moduleType: 'javadoc' 32 | node: 'packages' 33 | asSubmenu: true 34 | submenuTitle: 'Packages' 35 | javadoc: 36 | sourceDirs: 37 | - './../../../../sdk/sdk/src/main/java' -------------------------------------------------------------------------------- /docs/src/orchid/resources/templates/includes/sidebar.peb: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /docs/src/orchid/resources/wiki/contributing.md: -------------------------------------------------------------------------------- 1 | # Jacquard SDK 2 | 3 | Contributions to this project are welcomed. We request that you 4 | read through the guidelines before getting started. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement (CLA). You (or your employer) retain the copyright to your 10 | contribution; this simply gives us permission to use and redistribute your 11 | contributions as part of the project. Head over to 12 | to see your current agreements on file or 13 | to sign a new one. 14 | 15 | You generally only need to submit a CLA once, so if you've already submitted one 16 | (even if it was for a different project), you probably don't need to do it 17 | again. 18 | 19 | ## Community guidelines 20 | 21 | This project follows 22 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). 23 | 24 | ## Contribution 25 | 26 | ### Code reviews 27 | 28 | All submissions will be reviewed before merging. Submissions are reviewed using 29 | [GitHub pull requests](https://help.github.com/articles/about-pull-requests/). -------------------------------------------------------------------------------- /docs/src/orchid/resources/wiki/generate-docs.md: -------------------------------------------------------------------------------- 1 | We’re using [Orchid](https://orchid.run/) to generate a static website for Jacquard sdk. Orchid also 2 | parses sdk java packages and integrates the JavaDoc into the website. 3 | 4 | ## Running Orchid 5 | 6 | ### Prerequisites : 7 | Orchid does not generate api java docs with java8. Before running Orchid, make sure **java11** is 8 | installed on your machine. If not installed, you can install `java11` either from the terminal by 9 | running this command ```$sudo mule install jdk11``` or other convenient way for you. 10 | 11 | ### Run Development Server : 12 | - Navigate to the ```sdk/sdk``` folder of the repo. 13 | - In the terminal, run ```../gradlew :docs:orchidServe```. 14 | - When successful, you should see below message : 15 | ``` 16 | Build Complete 17 | Generated 122 pages in 12s 324ms 18 | 19 | Webserver Running at http://localhost:8080 20 | Hit [CTRL-C] to stop the server and quit Orchid 21 | ``` 22 | - Now open a browser and navigate to http://localhost:8080 to see your static website. 23 | 24 | ### Generate HTML Build: 25 | - Update ```docs/build.gradle``` file to edit `baseUrl` so as to match to the base URL of the host 26 | ``` 27 | orchid { 28 | ... 29 | baseUrl = "//" 30 | } 31 | ``` 32 | - In Terminal Navigate to the ```sdk/sdk``` folder of the repo. 33 | - Run ``` $../gradlew :docs:orchidBuild```. 34 | - When successful, copy all files from ```$/docs/build/docs/orchid/``` to `Your-website-directory` 35 | inside your web server deployment directory. 36 | -------------------------------------------------------------------------------- /docs/src/orchid/resources/wiki/integration.md: -------------------------------------------------------------------------------- 1 | It's easy to integrate the Jacquard SDK using Maven. 2 | 3 | You need to include GMaven in your repositories section of your gradle file: 4 | 5 | ``` 6 | repositories { 7 | maven { 8 | url "https://maven.google.com/" 9 | } 10 | } 11 | ``` 12 | 13 | Then include Jacquard in the `dependencies` section: 14 | 15 | ``` 16 | implementation "com.google.jacquard:jacquard-sdk:1.0.0" 17 | ``` 18 | -------------------------------------------------------------------------------- /docs/src/orchid/resources/wiki/releases.md: -------------------------------------------------------------------------------- 1 | ## Versioning 2 | 3 | The Jacquard SDK uses [Semantic Versioning](https://semver.org/). The main goal and property of Semantic Versioning is to give users of an SDK the safety of upgrading knowing what versions will and will not break code compatibility. 4 | 5 | In summary: 6 | 7 | > Given a version number MAJOR.MINOR.PATCH, increment the: 8 | > 9 | >   10 | > 11 | > 1. MAJOR version when you make incompatible API changes, 12 | > 13 | > 1. MINOR version when you add functionality in a backwards compatible manner, and 14 | > 15 | > 1. PATCH version when you make backwards compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR PATCH format. 16 | 17 | ## Releases 18 | 19 | ### Initial release - Version 0.1.0 - May 10, 2021 20 | This is the initial release. 21 | 22 | ### Version 0.2.0 - October 25, 2021 23 | 24 | 1. Open sourced SDK. 25 | 2. Record, store and send IMU data. 26 | 3. New Sample App example called 'Places'. 27 | 4. Improved Tag LED settings in sample app. 28 | 5. Device firmware upgrade via Cloud API. 29 | 6. Bug fixes. 30 | 7. Documentation Improvements. 31 | 32 | ### Version 1.0.0 - November 14, 2022 33 | 34 | 1. Real time streaming of IMU data. 35 | 2. Multi tag support - DFU & LEDs. 36 | 3. Custom Proto support for custom UJT modules 37 | 4. Improved UJT reconnections. 38 | 5. Bug fixes. -------------------------------------------------------------------------------- /docs/src/orchid/resources/wiki/summary.md: -------------------------------------------------------------------------------- 1 | - [Tutorial](tutorial.md) 2 | - [CodeLabs](codelabs.md) 3 | - [Integration](integration.md) 4 | - [API overview](apis.md) 5 | - [Generate docs](generate-docs.md) 6 | - [Releases](releases.md) 7 | - [License](license.md) 8 | - [Cloud API Terms](cloud-api-terms.md) 9 | - [Contributing](contributing.md) 10 | - [Code of Conduct](conduct.md) 11 | -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | /.idea 17 | /gradle/wrapper/gradle-wrapper.jar 18 | gradlew 19 | gradlew.bat 20 | -------------------------------------------------------------------------------- /sample/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /gradle/wrapper/gradle-wrapper.jar 3 | /gradle/wrapper/gradle-wrapper.properties 4 | gradlew 5 | gradlew.bat 6 | -------------------------------------------------------------------------------- /sample/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /sample/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/ActivityResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package com.google.android.jacquard.sample 18 | 19 | import android.content.Intent 20 | 21 | /** Class representing activity result data. */ 22 | data class ActivityResult(val requestCode: Int, val resultCode: Int, val data: Intent?) -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/KnownTag.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.google.android.jacquard.sample 19 | 20 | import com.google.android.jacquard.sdk.rx.Signal 21 | import com.google.android.jacquard.sdk.tag.JacquardTag 22 | 23 | /** Class representing a known tag. */ 24 | data class KnownTag( 25 | val identifier: String, 26 | val displayName: String, 27 | val pairingSerialNumber: String, 28 | @Transient val rssiValue: Signal? 29 | ) : JacquardTag { 30 | override fun address(): String { 31 | return identifier 32 | } 33 | 34 | override fun displayName(): String { 35 | return displayName 36 | } 37 | 38 | override fun rssiSignal(): Signal? { 39 | return rssiValue 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/firmwareupdate/ApplyFirmwareListener.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.google.android.jacquard.sample.firmwareupdate 19 | 20 | interface ApplyFirmwareListener { 21 | fun applyFirmwareInitiated() 22 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/home/HomeTileModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.google.android.jacquard.sample.home 19 | 20 | /** Model to hold data for [HomeTilesListAdapter]. */ 21 | data class HomeTileModel(val title: Int, val subTitle: Int, val type: Type, val enabled: Boolean) { 22 | /** Enum type for [HomeTileModel]. */ 23 | enum class Type { 24 | SECTION, TILE_API, TILE_SAMPLE_USE_CASE 25 | } 26 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/home/ItemClickListener.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.home 17 | 18 | /** Defines Click listener for Recyclerview Item. */ 19 | interface ItemClickListener { 20 | fun itemClick(t: T) 21 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/imu/ImuSamplesListViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.imu 17 | 18 | import androidx.lifecycle.ViewModel 19 | import androidx.navigation.NavController 20 | import com.google.android.jacquard.sdk.imu.ImuModule 21 | import com.google.android.jacquard.sdk.imu.parser.ImuSessionData 22 | import com.google.android.jacquard.sdk.rx.Signal 23 | 24 | /** ViewModel class for [ImuSamplesListFragment]. */ 25 | class ImuSamplesListViewModel(private val navController: NavController) : ViewModel() { 26 | 27 | /** Parses raw imu samples file. */ 28 | fun parse(path: String): Signal { 29 | return ImuModule.parseImuData(path) 30 | } 31 | 32 | /** Handles the back arrow click. */ 33 | fun backKeyPressed() { 34 | navController.popBackStack() 35 | } 36 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/imu/db/ImuSessionDao.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.imu.db 17 | 18 | import androidx.lifecycle.LiveData 19 | import androidx.room.* 20 | 21 | @Dao 22 | interface ImuSessionDao { 23 | @Insert(onConflict = OnConflictStrategy.REPLACE) 24 | fun insert(sessionInfo: JqSessionInfo) 25 | 26 | @Query("DELETE FROM imu_sessions where tagSerialNumber = :tagSerialNumber") 27 | fun deleteAll(tagSerialNumber: String) 28 | 29 | @Delete 30 | fun delete(sessionInfo: JqSessionInfo) 31 | 32 | @get:Query("SELECT * FROM imu_sessions ORDER BY imuSessionId DESC") 33 | val allImuSessions: LiveData> 34 | 35 | @Query("SELECT * FROM imu_sessions WHERE imuSessionId = :imuSessionId") 36 | fun getImuSession(imuSessionId: String): JqSessionInfo? 37 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/ledpattern/LedPatternItem.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.google.android.jacquard.sample.ledpattern 19 | 20 | import com.google.android.jacquard.sdk.command.PlayLedPatternCommand 21 | 22 | data class LedPatternItem( 23 | val icon: Int, 24 | val text: String, 25 | val frames: List, 26 | val resumable: Boolean, 27 | val ledPatternType: PlayLedPatternCommand.LedPatternType, 28 | val playType: PlayLedPatternCommand.PlayType, 29 | val haltAll: Boolean 30 | ) -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/musicalthreads/audio/Stream.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.musicalthreads.audio 17 | 18 | import androidx.annotation.FloatRange 19 | 20 | /** Data class for holding active playing streams. */ 21 | class Stream private constructor( 22 | val streamId: Int, @FloatRange(from = 0.0, to = 1.0) val volume: Float 23 | ) { 24 | companion object { 25 | /** 26 | * Returns a new Stream object. 27 | * 28 | * @param streamId the streamId returned by [android.media.SoundPool.play] 29 | * @param volume the volume of the playback. 30 | */ 31 | @JvmStatic 32 | fun of(streamId: Int, @FloatRange(from = 0.0, to = 1.0) volume: Float): Stream { 33 | return Stream(streamId, volume) 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/musicalthreads/player/Constants.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.musicalthreads.player 17 | 18 | /** Holds constant values used by implementations of [ThreadsPlayer]. */ 19 | object Constants { 20 | /** A line's velocity is between 0 and 127. */ 21 | private const val MAX_VELOCITY = 127f 22 | 23 | /** The minimum velocity required for a note to be audible. */ 24 | const val VELOCITY_THRESHOLD = 15 25 | 26 | @JvmStatic 27 | fun getVolume(velocity: Int): Float { 28 | return velocity / MAX_VELOCITY 29 | } 30 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/musicalthreads/player/ThreadsPlayer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.musicalthreads.player 17 | 18 | /** Interface for providing player implementations. */ 19 | interface ThreadsPlayer { 20 | 21 | /** Initialize all allocated resources. */ 22 | fun init() 23 | 24 | /** Releases all allocated resources. */ 25 | fun destroy() 26 | 27 | /** 28 | * Plays based on a thread output. Each entry in the array is a thread. The value is the velocity. 29 | * This function will be called by the interposer multiple times per second. 30 | * 31 | * @param lines touch lines from the interposer. 32 | */ 33 | fun play(lines: List) 34 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/places/GestureItem.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.places 17 | 18 | /** 19 | * Class for holding items to be displayed in the gesture list. 20 | */ 21 | class GestureItem(var isItemSelected: Boolean, var id: Int, var gesture: String) { 22 | companion object { 23 | @JvmStatic 24 | fun create(isItemSelected: Boolean, id: Int, gesture: String): GestureItem { 25 | return GestureItem(isItemSelected, id, gesture) 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/places/PlacesItem.kt: -------------------------------------------------------------------------------- 1 | package com.google.android.jacquard.sample.places 2 | 3 | import com.google.android.gms.maps.model.LatLng 4 | 5 | /* 6 | * Copyright 2021 Google LLC 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | /** 21 | * Model to hold data for places item. 22 | */ 23 | data class PlacesItem( 24 | var id: Int, 25 | var latLng: LatLng, 26 | var title: String, 27 | var subTitle: String, 28 | var time: Long, 29 | var type: Type 30 | ) { 31 | /** 32 | * Enum type for [PlacesItem]. 33 | */ 34 | enum class Type { 35 | SECTION, PLACES_ITEM 36 | } 37 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/places/db/PlaceItem.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.places.db 17 | 18 | import androidx.room.Entity 19 | import androidx.room.PrimaryKey 20 | 21 | /** 22 | * Entity class holding places item details. 23 | */ 24 | @Entity 25 | class PlaceItem( 26 | var latitude: Double, var longitude: Double, var title: String, var subtitle: String, 27 | var timestamp: Long 28 | ) { 29 | @JvmField 30 | @PrimaryKey(autoGenerate = true) 31 | var uid = 0 32 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/splash/SplashViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sample.splash 18 | 19 | import androidx.lifecycle.ViewModel 20 | import androidx.navigation.NavController 21 | import androidx.navigation.NavDirections 22 | import com.google.android.jacquard.sample.Preferences 23 | 24 | /** View model for the [SplashFragment]. */ 25 | class SplashViewModel( 26 | private val preferences: Preferences, 27 | private val navController: NavController 28 | ) : ViewModel() { 29 | 30 | fun navigateToNextScreen() { 31 | val navDirections: NavDirections = if (preferences.knownTags.isEmpty()) { 32 | SplashFragmentDirections.actionToScanFragment() 33 | } else { 34 | SplashFragmentDirections.actionToHomeFragment() 35 | } 36 | navController.navigate(navDirections) 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/utilities/AbilityConstants.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.google.android.jacquard.sample.utilities 19 | 20 | /** 21 | * Constants related to abilities. 22 | */ 23 | object AbilityConstants { 24 | 25 | /** 26 | * Ability id for places ability. 27 | */ 28 | const val PLACES_ABILITY = "placesAbility" 29 | 30 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/utilities/CustomProgressLoader.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.utilities 17 | 18 | import android.content.Context 19 | import android.util.AttributeSet 20 | import android.widget.FrameLayout 21 | import com.google.android.jacquard.sample.R 22 | 23 | class CustomProgressLoader @JvmOverloads constructor( 24 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0 25 | ) : FrameLayout(context, attrs, defStyleAttr, defStyleRes) { 26 | init { 27 | inflate(getContext(), R.layout.custom_progress_bar_holder, this) 28 | } 29 | } -------------------------------------------------------------------------------- /sample/app/src/main/java/com/google/android/jacquard/sample/utilities/Recipe.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sample.utilities 17 | 18 | /** 19 | * Class representing a Recipe(Gesture-Ability pair). 20 | */ 21 | data class Recipe(val abilityId: String, val gestureId: Int) -------------------------------------------------------------------------------- /sample/app/src/main/res/anim/enter_from_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 23 | -------------------------------------------------------------------------------- /sample/app/src/main/res/anim/enter_from_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 23 | -------------------------------------------------------------------------------- /sample/app/src/main/res/anim/exit_to_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 23 | -------------------------------------------------------------------------------- /sample/app/src/main/res/anim/exit_to_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 23 | -------------------------------------------------------------------------------- /sample/app/src/main/res/color/red_green_activated_color.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/app/src/main/res/color/solid_black_bg_color.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/app/src/main/res/color/solid_black_text_color.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable-hdpi/jq_tag.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable-hdpi/jq_tag.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable-hdpi/product_blur_image_hear.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable-hdpi/product_blur_image_hear.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable-mdpi/jq_tag.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable-mdpi/jq_tag.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable-xhdpi/jq_tag.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable-xhdpi/jq_tag.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable-xhdpi/product_blur_image_hear.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable-xhdpi/product_blur_image_hear.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable-xxhdpi/jq_tag.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable-xxhdpi/jq_tag.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable-xxhdpi/product_blur_image_hear.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable-xxhdpi/product_blur_image_hear.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable-xxxhdpi/jq_tag.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable-xxxhdpi/jq_tag.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/button_background_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/button_update_all_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/config_button_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 20 | 24 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/delete.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/download.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/font_color_with_states.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/gray_outline.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/green_indicator.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/haptics_icon.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_add_24px.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_blink.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 28 | 29 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_chevron_left_24px.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_close_24px.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_group_607.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 23 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_info_icon.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 26 | 27 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_led_duration.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_more.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_play.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_shine.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 28 | 29 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_stop_all.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_strobe.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 28 | 29 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_toggle_off_24px.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/ic_toggle_on_24px.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/led_duration_selected_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 24 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/led_duration_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/led_duration_unselected_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 24 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/list_view_divider.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 26 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/overflow.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/paired_icon.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 26 | 27 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/play_circle_filled_24px.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/product_blur_image_hear.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/drawable/product_blur_image_hear.webp -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/red_indicator.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/round_corner_places.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 20 | 21 | 26 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/scan_item_selected_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 24 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/scan_item_unselected_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 24 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/scan_list_item_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/scan_list_item_serial_number_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/scan_list_item_tag_name_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/scan_tag_icon_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/setting_suggest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/shape_tile_disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/shape_tile_enabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/share.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/stop_reacording.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/stop_recording_button_drawable.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/switch_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/tag_indicator_icon.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/tag_unselected_icon.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 28 | 29 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 13 | 16 | 19 | 22 | 25 | 28 | 31 | 34 | 35 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_off.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/thread_line_on_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/top_shadow_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 24 | -------------------------------------------------------------------------------- /sample/app/src/main/res/drawable/view_session_data.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /sample/app/src/main/res/font/sf_pro_display_medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/font/sf_pro_display_medium.otf -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/assign_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 26 | 32 | 33 | 37 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/container_bottom_sheet.xml: -------------------------------------------------------------------------------- 1 | 17 | 30 | 31 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/gesture_item.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 32 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/gesture_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/imu_sample_list_item.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 21 | 29 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/item_bottom_sheet.xml: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/item_product_section.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/item_product_tile_sample_use_case.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/places_section_item.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | -------------------------------------------------------------------------------- /sample/app/src/main/res/layout/scan_list_section_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | 23 | 30 | 31 | -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-xhdpi/tag_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-xhdpi/tag_image.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-xxhdpi/tag_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-xxhdpi/tag_image.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/b2_3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/b2_3.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/b3_4.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/b3_4.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/d3_5.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/d3_5.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/d4_10.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/d4_10.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/d4_6.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/d4_6.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/d4_9.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/d4_9.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/g2_1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/g2_1.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/g3_2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/g3_2.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/g3_7.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/g3_7.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/g4_11.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/g4_11.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/g4_12.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/g4_12.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/raw/g4_8.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sample/app/src/main/res/raw/g4_8.mp3 -------------------------------------------------------------------------------- /sample/app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 | 23 | -------------------------------------------------------------------------------- /sample/app/src/test/java/com/google/android/jacquard/sample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sample; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | 21 | import org.junit.Test; 22 | 23 | /** 24 | * Example local unit test, which will execute on the development machine (host). 25 | * 26 | * @see Testing documentation 27 | */ 28 | public class ExampleUnitTest { 29 | 30 | @Test 31 | public void addition_isCorrect() { 32 | assertEquals(4, 2 + 2); 33 | } 34 | } -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:4.1.3' 9 | classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0" 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | mavenCentral() 17 | } 18 | } 19 | 20 | task clean(type: Delete) { 21 | delete rootProject.buildDir 22 | } -------------------------------------------------------------------------------- /sample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip 6 | -------------------------------------------------------------------------------- /sample/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | include ':sdk' 3 | rootProject.name = "Jacquard SDK" 4 | project(':sdk').projectDir = new File(settingsDir, '../sdk/sdk') 5 | 6 | -------------------------------------------------------------------------------- /sdk/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | /gradle 17 | /gradle/wrapper/gradle-wrapper.jar 18 | /gradle/wrapper/gradle-wrapper.properties 19 | gradlew 20 | gradlew.bat 21 | -------------------------------------------------------------------------------- /sdk/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.android.tools.build:gradle:4.1.2" 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | mavenCentral() 16 | } 17 | } 18 | 19 | task clean(type: Delete) { 20 | delete rootProject.buildDir 21 | } -------------------------------------------------------------------------------- /sdk/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true -------------------------------------------------------------------------------- /sdk/sdk/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /gradle 3 | /gradle/wrapper/gradle-wrapper.jar 4 | /gradle/wrapper/gradle-wrapper.properties 5 | gradlew 6 | gradlew.bat 7 | -------------------------------------------------------------------------------- /sdk/sdk/libs/libjacquard_core_proto-lite.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sdk/sdk/libs/libjacquard_core_proto-lite.jar -------------------------------------------------------------------------------- /sdk/sdk/libs/libjacquard_proto-lite.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sdk/sdk/libs/libjacquard_proto-lite.jar -------------------------------------------------------------------------------- /sdk/sdk/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /sdk/sdk/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/JqExtensionRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk; 17 | 18 | import com.google.atap.jacquard.protocol.JacquardProtocol; 19 | import com.google.protobuf.ExtensionRegistryLite; 20 | 21 | /** Class holding the extension registry for Jacquard. */ 22 | public final class JqExtensionRegistry { 23 | 24 | /** A static instance extension registry for Jacquard. */ 25 | public static final ExtensionRegistryLite instance = ExtensionRegistryLite.newInstance(); 26 | 27 | static { 28 | JacquardProtocol.registerAllExtensions(instance); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/MemoryCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.android.jacquard.sdk.command.DeviceInfo; 21 | import java.util.HashMap; 22 | import java.util.Map; 23 | 24 | public final class MemoryCache { 25 | 26 | private final Map deviceInfoMap = new HashMap<>(); 27 | 28 | MemoryCache() { 29 | } 30 | 31 | /** Returns the device info if present in the memory. */ 32 | @Nullable 33 | public DeviceInfo getDeviceInfo(String identifier) { 34 | return deviceInfoMap.get(identifier); 35 | } 36 | 37 | /** Save the DeviceInfo in the memory. */ 38 | public void putDeviceInfo(String identifier, DeviceInfo deviceInfo) { 39 | deviceInfoMap.put(identifier, deviceInfo); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/StateMachine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk; 17 | 18 | import com.google.android.jacquard.sdk.rx.Signal; 19 | 20 | /** 21 | * Common interface for all state machine implementations. 22 | * @param the type of state emitted from the state machine. 23 | */ 24 | public interface StateMachine { 25 | 26 | /** 27 | * Returns a signal for observing the state of the state mashing. 28 | * @return signal of with the current state. 29 | */ 30 | Signal getState(); 31 | 32 | /** 33 | * Call to react to events emitted. 34 | * @param state the state emitted. 35 | */ 36 | void onStateEvent(Event state); 37 | 38 | /** Releases all allocated resources. */ 39 | void destroy(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/command/DCErrorNotificationSubscription.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.command; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.android.jacquard.sdk.util.JQUtils; 21 | import com.google.atap.jacquard.protocol.JacquardProtocol.DataCollectionStatus; 22 | 23 | /** Error notification subscription. */ 24 | public class DCErrorNotificationSubscription 25 | implements NotificationSubscription { 26 | 27 | private final InnerDCErrorNotificationSubscription notificationSubscription = 28 | new InnerDCErrorNotificationSubscription(); 29 | 30 | @Nullable 31 | @Override 32 | public DataCollectionStatus extract(byte[] packet) { 33 | return notificationSubscription.extract(JQUtils.getNotification(packet)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/command/LoadModuleNotificationSubscription.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.command; 18 | 19 | import androidx.annotation.Nullable; 20 | import com.google.android.jacquard.sdk.model.Module; 21 | import com.google.android.jacquard.sdk.util.JQUtils; 22 | 23 | /** This subscription class gives you a ability to get subscribed to load module notifications. */ 24 | public class LoadModuleNotificationSubscription 25 | implements NotificationSubscription { 26 | 27 | InnerLoadModuleNotificationSubscription subscription = new InnerLoadModuleNotificationSubscription(); 28 | 29 | @Nullable 30 | @Override 31 | public Module extract(byte[] packet) { 32 | return subscription.extract(JQUtils.getNotification(packet)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/command/NotificationSubscription.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.command; 17 | 18 | import androidx.annotation.Nullable; 19 | 20 | /** Interface for subscribing to notifications from the tag. */ 21 | public interface NotificationSubscription { 22 | 23 | /** 24 | * Extracts the payload from the notification. Returns null if the notification is not the 25 | * expected notification. 26 | */ 27 | @Nullable 28 | Type extract(byte[] packet); 29 | } 30 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/connection/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.connection; 17 | 18 | import com.google.auto.value.AutoOneOf; 19 | 20 | /** Data class for holding the result of a tag command. */ 21 | @AutoOneOf(Result.Type.class) 22 | public abstract class Result { 23 | 24 | public enum Type { 25 | SUCCESS, FAILURE 26 | } 27 | 28 | public abstract Type getType(); 29 | 30 | public abstract Res success(); 31 | 32 | public abstract Throwable failure(); 33 | 34 | public static Result ofSuccess(Res response) { 35 | return AutoOneOf_Result.success(response); 36 | } 37 | 38 | public static Result ofFailure(Throwable throwable) { 39 | return AutoOneOf_Result.failure(throwable); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/datastore/ComponentMetaData.java: -------------------------------------------------------------------------------- 1 | package com.google.android.jacquard.sdk.datastore; 2 | /* 3 | * Copyright 2021 Google LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * https://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import com.google.android.jacquard.sdk.model.Vendor; 19 | import com.google.auto.value.AutoValue; 20 | 21 | import java.util.Map; 22 | 23 | /** Requires for parsing the data loaded from cloud json. */ 24 | @AutoValue 25 | public abstract class ComponentMetaData { 26 | 27 | /** Returns Map of Vendors with its id as Map key. */ 28 | public abstract Map vendors(); 29 | 30 | /** Creator method for {@link ComponentMetaData}. */ 31 | public static ComponentMetaData of(Map vendors) { 32 | return new AutoValue_ComponentMetaData(vendors); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/dfu/CloudManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.dfu; 17 | 18 | import retrofit2.Call; 19 | import retrofit2.http.GET; 20 | import retrofit2.http.Query; 21 | 22 | /** Interface provides Service for Retrofit. */ 23 | interface CloudManager { 24 | 25 | /** Defines cloud function getDeviceFirmware. */ 26 | @GET("/v1/device/firmware") 27 | Call getDeviceFirmware(@Query("cid") String clientId, 28 | @Query("vid") String vid, 29 | @Query("pid") String pid, 30 | @Query("mid") String mid, 31 | @Query("version") String currentVersion, 32 | @Query("tag_version") String tagVersion, 33 | @Query("obfuscated_component_id") String obfuscatedComponentId, 34 | @Query("platform") String platform, 35 | @Query("country_code") String countryCode, 36 | @Query("sdk_version") String sdkVersion); 37 | } 38 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/dfu/DownloadManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.dfu; 17 | 18 | import com.google.android.jacquard.sdk.dfu.model.FileDescriptor; 19 | import com.google.android.jacquard.sdk.rx.Signal; 20 | 21 | /** Interface declare utility methods related to downloading. */ 22 | interface DownloadManager { 23 | 24 | /** Skeleton utility method to download file from url. */ 25 | Signal download(String downloadUrl, String apiKey); 26 | } 27 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/dfu/execption/FirmwareUpdateStoppedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.dfu.execption; 17 | 18 | /* Exception will be thrown when Firmware update is stopped. */ 19 | public final class FirmwareUpdateStoppedException extends Exception { 20 | public FirmwareUpdateStoppedException(String msg) { 21 | super(msg); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/dfu/execption/InsufficientBatteryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.dfu.execption; 18 | 19 | /** Exception will be thrown in case of low battery. */ 20 | public class InsufficientBatteryException extends Exception { 21 | 22 | private final int batteryLevel; 23 | private final int thresholdLevel; 24 | 25 | public InsufficientBatteryException(int batteryLevel, int thresholdLevel) { 26 | super( 27 | "UJT has " 28 | + batteryLevel 29 | + "% battery. Minimum " 30 | + thresholdLevel 31 | + "% battery is required to proceed."); 32 | this.batteryLevel = batteryLevel; 33 | this.thresholdLevel = thresholdLevel; 34 | } 35 | 36 | public int getBatteryLevel() { 37 | return batteryLevel; 38 | } 39 | 40 | public int getThresholdLevel() { 41 | return thresholdLevel; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/dfu/execption/UpdateMismatchException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.dfu.execption; 17 | 18 | /* Exception will be thrown when DfuInfo is not applicable to components of the Tag. */ 19 | public final class UpdateMismatchException extends Exception { 20 | public UpdateMismatchException(String msg) { 21 | super(msg); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/dfu/execption/UpdatedFirmwareNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.dfu.execption; 18 | 19 | /** Exception will be thrown in case of no firmware update found. */ 20 | public class UpdatedFirmwareNotFoundException extends Exception { 21 | public UpdatedFirmwareNotFoundException(String msg) { 22 | super(msg); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/dfu/model/PlatformSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.dfu.model; 18 | 19 | /** Representation of response for the SDK Settings rest api. */ 20 | public class PlatformSettings { 21 | 22 | private int minimumBatteryDFU = 10; 23 | 24 | public int getMinimumBatteryDFU() { 25 | return minimumBatteryDFU; 26 | } 27 | 28 | public void setMinimumBatteryDFU(int minimumBatteryDFU) { 29 | this.minimumBatteryDFU = minimumBatteryDFU; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/dfu/model/TransferState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.dfu.model; 18 | 19 | import com.google.auto.value.AutoValue; 20 | 21 | /** Binary upload/download operation status */ 22 | @AutoValue 23 | public abstract class TransferState { 24 | 25 | /** Current transferred offset value in bytes. */ 26 | public abstract int offset(); 27 | 28 | /** Total download size in bytes. */ 29 | public abstract int total(); 30 | 31 | /** Returns if download is complete. */ 32 | public abstract boolean done(); 33 | 34 | public static TransferState create(int progress, int total) { 35 | return new AutoValue_TransferState(progress, total, total != 0 && progress == total); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/imu/Sensors.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.imu; 18 | 19 | /** 20 | * Sensors used for data collection. 21 | */ 22 | public enum Sensors { 23 | IMU(0), 24 | GEAR(1); 25 | private int id; 26 | 27 | Sensors(int id) { 28 | this.id = id; 29 | } 30 | 31 | public int id() { 32 | return id; 33 | } 34 | 35 | public static Sensors forId(int id) { 36 | switch (id) { 37 | case 1: 38 | return GEAR; 39 | case 0: 40 | default: 41 | return IMU; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/imu/exception/InprogressDCException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.imu.exception; 18 | 19 | import androidx.annotation.NonNull; 20 | import androidx.annotation.Nullable; 21 | import com.google.atap.jacquard.protocol.JacquardProtocol.DataCollectionMode; 22 | import com.google.atap.jacquard.protocol.JacquardProtocol.DataCollectionStatus; 23 | 24 | /** 25 | * Exception thrown when tag is already collecting data and you tried to start again. 26 | */ 27 | public class InprogressDCException extends DCException { 28 | 29 | public InprogressDCException( 30 | @NonNull DataCollectionStatus status, 31 | @Nullable DataCollectionMode mode) { 32 | super(status, mode); 33 | } 34 | 35 | @Nullable 36 | @Override 37 | public String getMessage() { 38 | return "Data collection is already in progress. " + super.toString(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/imu/exception/InvalidStateDCException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.imu.exception; 18 | 19 | import androidx.annotation.NonNull; 20 | import com.google.atap.jacquard.protocol.JacquardProtocol.DataCollectionStatus; 21 | 22 | /** 23 | * Exception thrown when tag is in invalid state to start data collection. 24 | */ 25 | public class InvalidStateDCException extends DCException { 26 | 27 | public InvalidStateDCException( 28 | @NonNull DataCollectionStatus status) { 29 | super(status, null); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/imu/parser/ImuParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.imu.parser; 18 | 19 | import com.google.atap.jacquard.protocol.JacquardProtocol.DataCollectionActionHeader; 20 | import com.google.protos.atap.jacquard.core.Jacquard.ImuSample; 21 | import java.util.List; 22 | 23 | /** 24 | * Interface to parse Imu Samples raw file. 25 | */ 26 | public interface ImuParser { 27 | 28 | /** 29 | * Parse to get {@link ImuSample}. 30 | */ 31 | ImuSample parseImuSample(byte[] bytes); 32 | 33 | List parseImuSamples(byte[] bytes); 34 | 35 | /** 36 | * Parse to get {@link DataCollectionActionHeader}. 37 | */ 38 | DataCollectionActionHeader parseActionHeader(byte[] bytes); 39 | } 40 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/imu/parser/ImuParserException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk.imu.parser; 18 | 19 | /** 20 | * Exception if raw IMU sample file is not properly formatted and {@link ImuParser} is not able to 21 | * parse it. 22 | */ 23 | public class ImuParserException extends RuntimeException { 24 | 25 | public ImuParserException(String msg) { 26 | super(msg); 27 | } 28 | 29 | public ImuParserException(String msg, Exception e) { 30 | super(msg, e); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/log/LogLevel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.google.android.jacquard.sdk.log; 19 | 20 | /** 21 | * A set of log levels to print a log message to the console. 22 | */ 23 | public enum LogLevel { 24 | VERBOSE(/* logLevel= */ 2), 25 | DEBUG(/* logLevel= */ 3), 26 | INFO(/* logLevel= */ 4), 27 | WARNING(/* logLevel= */ 5), 28 | ERROR(/* logLevel= */ 6), 29 | ASSERT(/* logLevel= */ 7); 30 | 31 | private final int logLevel; 32 | 33 | LogLevel(int logLevel) { 34 | this.logLevel = logLevel; 35 | } 36 | 37 | /** 38 | * Returns priority log level. 39 | */ 40 | public int getLogLevel() { 41 | return logLevel; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/ComponentCapability.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.model; 17 | 18 | import com.google.auto.value.AutoValue; 19 | import com.ryanharter.auto.value.gson.GenerateTypeAdapter; 20 | import java.util.List; 21 | 22 | /** Defines Capabilities assign to specific component from cloud. */ 23 | @GenerateTypeAdapter 24 | @AutoValue 25 | public abstract class ComponentCapability { 26 | 27 | /** Returns vendor id for the Component. */ 28 | public abstract long vendorId(); 29 | 30 | /** Returns product id for the Component. */ 31 | public abstract long productId(); 32 | 33 | /** Returns list of capability ids for the Component. */ 34 | public abstract List capabilityIds(); 35 | } 36 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/ComponentKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.model; 17 | 18 | import com.google.auto.value.AutoValue; 19 | 20 | /** 21 | * Acts as a Key to hold list of capabilities, which are assigned to combination of Vendor and 22 | * Product. 23 | */ 24 | @AutoValue 25 | public abstract class ComponentKey { 26 | 27 | /** Return first key for ComponentKey. */ 28 | public abstract K key1(); 29 | 30 | /** Return second key for ComponentKey. */ 31 | public abstract V key2(); 32 | 33 | /** 34 | * Return the ComponentKey for the combination of {@link ComponentKey#key1()} and {@link 35 | * ComponentKey#key2()}. 36 | */ 37 | public static ComponentKey of(K key1, V key2) { 38 | return new AutoValue_ComponentKey(key1, key2); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/FailedToConnect.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.model; 17 | 18 | import com.google.auto.value.AutoValue; 19 | 20 | /** Error reported by {@link com.google.android.jacquard.sdk.BleAdapter} when connection failed. */ 21 | @AutoValue 22 | public abstract class FailedToConnect { 23 | 24 | /** Creates a new instance of FailedToConnect. */ 25 | public static FailedToConnect of(Peripheral peripheral, JacquardError error) { 26 | return new AutoValue_FailedToConnect(peripheral, error); 27 | } 28 | 29 | /** The peripheral the connected failed to. */ 30 | public abstract Peripheral peripheral(); 31 | 32 | /** The error reported by {@link com.google.android.jacquard.sdk.BleAdapter}. */ 33 | public abstract JacquardError error(); 34 | } 35 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/GearState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.model; 17 | 18 | import com.google.auto.value.AutoOneOf; 19 | 20 | /** The attached state of a gear. */ 21 | @AutoOneOf(GearState.Type.class) 22 | public abstract class GearState { 23 | 24 | /** Returns the component in attached state. */ 25 | public abstract Component attached(); 26 | 27 | public abstract Type getType(); 28 | 29 | public enum Type { 30 | ATTACHED, DETACHED 31 | } 32 | 33 | public abstract void detached(); 34 | 35 | public static GearState ofAttached(Component component) { 36 | return AutoOneOf_GearState.attached(component); 37 | } 38 | 39 | public static GearState ofDetached() { 40 | return AutoOneOf_GearState.detached(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/ProtocolSpec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.model; 17 | 18 | /** Holds supported MTU size Jacquard protocol versions. */ 19 | public enum ProtocolSpec { 20 | UNKNOWN(0, 23), VERSION_1(1, 23), VERSION_2(2, 64); 21 | 22 | private final int protocolId; 23 | private final int mtuSize; 24 | 25 | ProtocolSpec(int protocolId, int mtuSize) { 26 | this.protocolId = protocolId; 27 | this.mtuSize = mtuSize; 28 | } 29 | 30 | /** Returns the protocol Id */ 31 | public int getProtocolId() { 32 | return protocolId; 33 | } 34 | 35 | /** Returns the supports MTU size. */ 36 | public int getMtuSize() { 37 | return mtuSize; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/RssiUpdate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.model; 17 | 18 | import com.google.auto.value.AutoValue; 19 | 20 | /** 21 | * Data class emitted by {@link com.google.android.jacquard.sdk.BleAdapter} when a read remote rssi 22 | * notification callback is received. 23 | **/ 24 | @AutoValue 25 | public abstract class RssiUpdate { 26 | 27 | /** Creates a new instance of RssiUpdate. */ 28 | public static RssiUpdate of(Peripheral peripheral, int value) { 29 | return new AutoValue_RssiUpdate(peripheral, value); 30 | } 31 | 32 | /** The peripheral that reported the event. */ 33 | public abstract Peripheral peripheral(); 34 | 35 | /** The rssi value of the bluetooth device. */ 36 | public abstract int value(); 37 | } 38 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/SdkConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.model; 17 | 18 | import androidx.annotation.NonNull; 19 | import androidx.annotation.Nullable; 20 | import com.google.auto.value.AutoValue; 21 | 22 | /** 23 | * Data class for sdk initialization. 24 | */ 25 | @AutoValue 26 | public abstract class SdkConfig { 27 | 28 | public static SdkConfig of(@NonNull String clientId, @NonNull String apiKey, 29 | @Nullable String cloudEndpointUrl) { 30 | return new AutoValue_SdkConfig(clientId, apiKey, cloudEndpointUrl); 31 | } 32 | 33 | /** 34 | * The client id. 35 | */ 36 | public abstract String clientId(); 37 | 38 | /** 39 | * The api key. 40 | */ 41 | public abstract String apiKey(); 42 | 43 | /** 44 | * Cloud endpoint url. Defaults to production cloud endpoint. 45 | */ 46 | @Nullable 47 | public abstract String cloudEndpointUrl(); 48 | } 49 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/TouchMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.model; 17 | 18 | /** The different type of touch mode the a gear can be in. 19 | * {@link TouchMode#GESTURE} The tag will emit gestures. 20 | * {@link TouchMode#CONTINUOUS} The tag will emit raw touch data. 21 | */ 22 | public enum TouchMode { 23 | GESTURE, CONTINUOUS 24 | } 25 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/model/Vendor.java: -------------------------------------------------------------------------------- 1 | package com.google.android.jacquard.sdk.model; 2 | /* 3 | * Copyright 2021 Google LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * https://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import com.google.auto.value.AutoValue; 19 | import com.ryanharter.auto.value.gson.GenerateTypeAdapter; 20 | import java.util.List; 21 | 22 | /** Defines Vendor type of the Gear. */ 23 | @GenerateTypeAdapter 24 | @AutoValue 25 | public abstract class Vendor { 26 | 27 | /** Unique identifier of the Vendor. */ 28 | public abstract String id(); 29 | 30 | /** Name of the Vendor. */ 31 | public abstract String name(); 32 | 33 | /** 34 | * List of products for this vendor. 35 | */ 36 | public abstract List products(); 37 | 38 | public static Vendor of(String id, String name, List products) { 39 | return new AutoValue_Vendor(id, name, products); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/pairing/RequiredCharacteristics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.pairing; 17 | 18 | import android.bluetooth.BluetoothGattCharacteristic; 19 | 20 | /** Data class for holding the required characteristic for a jacquard tag. */ 21 | public class RequiredCharacteristics { 22 | 23 | public BluetoothGattCharacteristic commandCharacteristic; 24 | public BluetoothGattCharacteristic rawCharacteristic; 25 | BluetoothGattCharacteristic deviceNameCharacteristic; 26 | BluetoothGattCharacteristic responseCharacteristic; 27 | BluetoothGattCharacteristic notifyCharacteristic; 28 | BluetoothGattCharacteristic batteryCharacteristic; 29 | } 30 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/remote/LocalParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.remote; 17 | 18 | /** Interface to Parse local file to load data. */ 19 | interface LocalParser { 20 | Return parse(Param value); 21 | } 22 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/remote/MetaDataModel.java: -------------------------------------------------------------------------------- 1 | package com.google.android.jacquard.sdk.remote; 2 | /* 3 | * Copyright 2021 Google LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * https://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import com.google.android.jacquard.sdk.model.Vendor; 19 | import com.google.auto.value.AutoValue; 20 | import com.ryanharter.auto.value.gson.GenerateTypeAdapter; 21 | import java.util.List; 22 | 23 | /** Class to parse meta data of the component from json. */ 24 | @GenerateTypeAdapter 25 | @AutoValue 26 | public abstract class MetaDataModel { 27 | 28 | /** List of all the Vendors. */ 29 | public abstract List vendors(); 30 | } 31 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/remote/RemoteFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.remote; 17 | 18 | import com.google.android.jacquard.sdk.datastore.ComponentMetaData; 19 | import com.google.android.jacquard.sdk.model.Revision; 20 | import com.google.android.jacquard.sdk.rx.Signal; 21 | import java.util.List; 22 | 23 | /** Marker Interface for Remote related classes. */ 24 | public interface RemoteFunction { 25 | 26 | /** Gets component meta data. */ 27 | Signal getComponents(); 28 | 29 | /** Bad firmware versions meta data */ 30 | Signal> getBadFirmwareVersions(); 31 | } 32 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/rx/Consumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.rx; 17 | 18 | /** A representation of T -> () */ 19 | public interface Consumer { 20 | void apply(T value); 21 | } 22 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/rx/Fn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.rx; 17 | 18 | public interface Fn { 19 | U apply(T t); 20 | } -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/rx/Fn2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.rx; 17 | 18 | public interface Fn2 { 19 | T apply(A a, B b); 20 | } -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/rx/Pred.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.rx; 17 | 18 | public interface Pred { 19 | boolean apply(T t); 20 | } -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/rx/Producer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.rx; 17 | 18 | /** A producer function, generating a T. */ 19 | public interface Producer { 20 | T apply(); 21 | } -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/tag/AdvertisedJacquardTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.tag; 17 | 18 | import android.bluetooth.BluetoothDevice; 19 | import com.google.android.jacquard.sdk.JacquardManager; 20 | 21 | /** 22 | * A Jacquard tag that has been discovered during a Bluetooth LE scan. 23 | *

24 | * A connection to the tag can be established by calling 25 | * {@link JacquardManager#connect(AdvertisedJacquardTag)}. 26 | */ 27 | public interface AdvertisedJacquardTag extends JacquardTag { 28 | 29 | /** The tag as a {@link BluetoothDevice}. */ 30 | BluetoothDevice bluetoothDevice(); 31 | 32 | /** Serial number used during pairing. The last 4 digit of the UJT serial number */ 33 | String pairingSerialNumber(); 34 | } 35 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/tag/JacquardTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.tag; 17 | 18 | import androidx.annotation.Nullable; 19 | import com.google.android.jacquard.sdk.rx.Signal; 20 | import java.io.Serializable; 21 | 22 | /** Based interface for Jacquard tags. */ 23 | public interface JacquardTag extends Serializable { 24 | 25 | /** The bluetooth address of the tag. */ 26 | String address(); 27 | 28 | /** The name of the tag to display in the UI. */ 29 | String displayName(); 30 | 31 | /** 32 | * Returns the rssi signal strength for the tag.
During ble scanning as and when available 33 | * will be notified. When tag get connected, rssi value will be notified every second. 34 | */ 35 | @Nullable 36 | Signal rssiSignal(); 37 | } 38 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/util/BluetoothUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.util; 17 | 18 | import android.Manifest; 19 | import android.bluetooth.BluetoothAdapter; 20 | import androidx.annotation.RequiresPermission; 21 | 22 | /** Holds utility methods for checking the state of the {@link BluetoothAdapter}. */ 23 | public class BluetoothUtils { 24 | 25 | /** 26 | * Returns true if the {@link BluetoothAdapter} is available and turned on. 27 | * @return true if the local adapter is turned on 28 | */ 29 | @RequiresPermission(Manifest.permission.BLUETOOTH) 30 | public static boolean isBluetoothEnabled() { 31 | BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); 32 | return adapter != null && adapter.isEnabled(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/java/com/google/android/jacquard/sdk/util/Function.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.util; 17 | 18 | /** 19 | * Represents a function that accepts one argument and does not produces a result. 20 | * 21 | *

This is a functional interface whose functional method is {@link #run(T)}. 22 | * 23 | * @param the type of the input to the function 24 | * 25 | */ 26 | public interface Function { 27 | 28 | /** 29 | * Execute the function. 30 | * @param param an arguments to the function. 31 | */ 32 | void run(T param); 33 | } 34 | -------------------------------------------------------------------------------- /sdk/sdk/src/main/res/raw/badfirmwareversion.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "major" : 1, 4 | "minor" : 0, 5 | "micro" : 6 6 | }, 7 | { 8 | "major" : 1, 9 | "minor" : 1, 10 | "micro" : 0 11 | } 12 | ] -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/CommonContextStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk; 17 | 18 | import android.app.Service; 19 | import android.content.Intent; 20 | import android.os.IBinder; 21 | 22 | /** Create Context for Roboelectric tests. */ 23 | public class CommonContextStub extends Service { 24 | @Override 25 | public IBinder onBind(Intent intent) { 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | 21 | import org.junit.Test; 22 | 23 | /** 24 | * Example local unit test, which will execute on the development machine (host). 25 | * 26 | * @see Testing documentation 27 | */ 28 | public class ExampleUnitTest { 29 | 30 | @Test 31 | public void addition_isCorrect() { 32 | assertEquals(4, 2 + 2); 33 | } 34 | } -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/FakeCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.google.android.jacquard.sdk; 19 | 20 | import com.google.android.jacquard.sdk.BleQueue.Command; 21 | 22 | /** 23 | * Fake implementation of {@link Command}. 24 | */ 25 | public class FakeCommand extends Command { 26 | 27 | private boolean isInterrupted; 28 | 29 | /** 30 | * Creates new instance of Command with a type 31 | * 32 | * @param type the type of command. 33 | */ 34 | public FakeCommand(Type type) { 35 | super(type); 36 | } 37 | 38 | @Override 39 | public void run() { 40 | if (isInterrupted) { 41 | interruptAbnormally(); 42 | } 43 | } 44 | 45 | public void setInterruption(boolean isInterrupted) { 46 | this.isInterrupted = isInterrupted; 47 | } 48 | 49 | private void interruptAbnormally() { 50 | throw new RuntimeException(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/JacquardManagerInitialization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.jacquard.sdk; 18 | 19 | import androidx.test.core.app.ApplicationProvider; 20 | import com.google.android.jacquard.sdk.model.SdkConfig; 21 | 22 | public class JacquardManagerInitialization { 23 | 24 | public static void initJacquardManager() { 25 | initJacquardManager(new JacquardManagerImpl( 26 | ApplicationProvider.getApplicationContext())); 27 | } 28 | 29 | public static void initJacquardManager(JacquardManagerImpl manager) { 30 | JacquardManagerImpl.instance = manager; 31 | JacquardManagerImpl.instance 32 | .init(SdkConfig.of("clientId", "apiKey", /* cloudEndpointUrl= */ null)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/initialization/FakeTransportState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.initialization; 17 | 18 | import com.google.android.jacquard.sdk.util.FakeFragmenter; 19 | 20 | /** 21 | * Fake implementation of {@link TransportState}. 22 | */ 23 | public final class FakeTransportState extends TransportState { 24 | 25 | final FakeFragmenter commandFragmenter; 26 | final FakeFragmenter notificationFragmenter; 27 | final FakeFragmenter dataFragmenter; 28 | 29 | public FakeTransportState(FakeFragmenter commandFragmenter, FakeFragmenter notificationFragmenter, 30 | FakeFragmenter dataFragmenter) { 31 | super(commandFragmenter, notificationFragmenter, dataFragmenter); 32 | this.commandFragmenter = commandFragmenter; 33 | this.notificationFragmenter = notificationFragmenter; 34 | this.dataFragmenter = dataFragmenter; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/pairing/FakeTagPairingStateMachine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.google.android.jacquard.sdk.pairing; 19 | 20 | import com.google.android.jacquard.sdk.ConnectState; 21 | 22 | /** 23 | * Fake implementation of {@link TagPairingStateMachine}. 24 | */ 25 | public class FakeTagPairingStateMachine extends TagPairingStateMachine { 26 | 27 | private TagPairingState tagPairingState; 28 | 29 | @Override 30 | public void onStateEvent(ConnectState state) { 31 | getState().next(tagPairingState); 32 | } 33 | 34 | /** 35 | * Sets tag pairing state. 36 | * 37 | * @param state state the pairing state machine can be in 38 | */ 39 | public void setTagPairingState(TagPairingState state) { 40 | tagPairingState = state; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/remote/RemoteFunctionInitialization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.remote; 17 | 18 | public class RemoteFunctionInitialization { 19 | 20 | public static void initRemoteFunction(RemoteFunction remoteFunction) { 21 | RemoteFactory.remoteFunction = remoteFunction; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/tag/ConnectedJacquardTagInitialization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.tag; 17 | 18 | import com.google.android.jacquard.sdk.command.DeviceInfo; 19 | import com.google.android.jacquard.sdk.dfu.DfuManager; 20 | import com.google.android.jacquard.sdk.initialization.Transport; 21 | 22 | public class ConnectedJacquardTagInitialization { 23 | 24 | public static ConnectedJacquardTag createConnectedJacquardTag( 25 | Transport transport, DeviceInfo deviceInfo, DfuManager dfuManager) { 26 | return new ConnectedJacquardTagImpl(transport, deviceInfo, dfuManager); 27 | } 28 | 29 | public static FakeConnectedJacquardTagImpl createFakeConnectedJacquardTag( 30 | Transport transport, DeviceInfo deviceInfo) { 31 | return new FakeConnectedJacquardTagImpl(transport, deviceInfo); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sdk/sdk/src/test/java/com/google/android/jacquard/sdk/tag/FakeConnectedJacquardTagImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Google LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.android.jacquard.sdk.tag; 17 | 18 | import com.google.android.jacquard.sdk.command.DeviceInfo; 19 | import com.google.android.jacquard.sdk.dfu.DfuManager; 20 | import com.google.android.jacquard.sdk.initialization.Transport; 21 | 22 | public class FakeConnectedJacquardTagImpl extends ConnectedJacquardTagImpl{ 23 | 24 | public FakeConnectedJacquardTagImpl(Transport transport, 25 | DeviceInfo deviceInfo) { 26 | super(transport, deviceInfo); 27 | } 28 | 29 | public void setDfuManager(DfuManager dfuManager) { 30 | this.dfuManager = dfuManager; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/sdk/src/test/resources/1627344030.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/JacquardSDKAndroid/f88ec2dea9813203a4ed5d70646915c4d5651d6e/sdk/sdk/src/test/resources/1627344030.bin -------------------------------------------------------------------------------- /sdk/sdk/src/test/resources/badfirmwareversion.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "major" : 1, 4 | "minor" : 68, 5 | "micro" : 0 6 | } 7 | ] -------------------------------------------------------------------------------- /sdk/sdk/src/test/resources/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "vendors": [ 3 | { 4 | "id": "74-a8-ce-54", 5 | "name": "Levi's", 6 | "products": [ 7 | { 8 | "id": "8a-66-50-f4", 9 | "name": "Trucker Jacket", 10 | "image": "product_jacket_outline", 11 | "capabilities": [ 12 | 1, 13 | 2, 14 | 3 15 | ] 16 | } 17 | ] 18 | }, 19 | { 20 | "id": "87-b4-30-b6", 21 | "name": "Samsonite", 22 | "products": [ 23 | { 24 | "id": "b7-07-97-2a", 25 | "name": "Konnect-i", 26 | "image": "product_backpack_outline", 27 | "capabilities": [ 28 | 1, 29 | 2, 30 | 3 31 | ] 32 | } 33 | ] 34 | }, 35 | { 36 | "id": "google", 37 | "name": "Levi's", 38 | "products": [ 39 | { 40 | "id": "ujt", 41 | "name": "Jacket v1.0", 42 | "image": "product_jacket_outline", 43 | "capabilities": [ 44 | 0, 45 | 3 46 | ] 47 | } 48 | ] 49 | }, 50 | { 51 | "id": "fb-57-a1-12", 52 | "name": "Saint Laurent", 53 | "products": [ 54 | { 55 | "id": "5c-d8-78-b0", 56 | "name": "Cit-e Backpack", 57 | "image": "product_backpack_outline", 58 | "capabilities": [ 59 | 0, 60 | 1, 61 | 2, 62 | 3 63 | ] 64 | } 65 | ] 66 | } 67 | ] 68 | } -------------------------------------------------------------------------------- /sdk/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':sdk' 2 | include ':docs' 3 | rootProject.name = "Jacquard Sdk" 4 | project(':docs').projectDir = new File(settingsDir, '../docs') 5 | -------------------------------------------------------------------------------- /version.gradle: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2021 Google LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | project.ext.versionName="1.0.1" 17 | project.ext.versionCode= getVersionCode() 18 | 19 | def getVersionCode() { 20 | //TODO: Version code should be hash of latest commit id. 21 | return new Date().format('yyyyMMddHH').toInteger() 22 | } 23 | 24 | project.ext.gitHead = 'git rev-parse --short HEAD'.execute().text.trim() --------------------------------------------------------------------------------