├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── question.md ├── Changelog.md ├── Changelog_Jp.md ├── Documents ├── CommandEmulator_on_SMCS.pdf ├── CommandEmulator_on_SMCS_Jp.pdf └── UsersManual.url ├── LICENSE ├── Readme.md ├── Readme_Jp.md ├── SDK ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── starmicronics │ │ │ └── starprntsdk │ │ │ └── ApplicationTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── starmicronics │ │ │ │ └── starprntsdk │ │ │ │ ├── ApiFragment.java │ │ │ │ ├── AutoSwitchInterfaceExtFragment.java │ │ │ │ ├── AutoSwitchInterfaceFragment.java │ │ │ │ ├── AutomaticPageLengthTypeSelectDialogFragment.java │ │ │ │ ├── BarcodeReaderExtFragment.java │ │ │ │ ├── BlackMarkFragment.java │ │ │ │ ├── BlackMarkPasteFragment.java │ │ │ │ ├── BlackMarkTypeSelectDialogFragment.java │ │ │ │ ├── BluetoothSettingFragment.java │ │ │ │ ├── BluetoothSettingSecuritySelectDialogFragment.java │ │ │ │ ├── CashDrawerExtFragment.java │ │ │ │ ├── CashDrawerFragment.java │ │ │ │ ├── CombinationExtFragment.java │ │ │ │ ├── CombinationFragment.java │ │ │ │ ├── CombinationLanguageSelectDialogFragment.java │ │ │ │ ├── CommonActivity.java │ │ │ │ ├── CommonAlertDialogFragment.java │ │ │ │ ├── CommonFragment.java │ │ │ │ ├── Communication.java │ │ │ │ ├── DeviceStatusFragment.java │ │ │ │ ├── DisplayCharacterSetCodePageDialogFragment.java │ │ │ │ ├── DisplayCharacterSetInternationalDialogFragment.java │ │ │ │ ├── DisplayContrastDialogFragment.java │ │ │ │ ├── DisplayCursorDialogFragment.java │ │ │ │ ├── DisplayExtFragment.java │ │ │ │ ├── DisplayFragment.java │ │ │ │ ├── DisplayGraphicDialogFragment.java │ │ │ │ ├── DisplayTextDialogFragment.java │ │ │ │ ├── DisplayTurnOnOffDialogFragment.java │ │ │ │ ├── DisplayUserDefinedCharacterDialogFragment.java │ │ │ │ ├── DrawerOpenActiveSelectDialogFragment.java │ │ │ │ ├── EnJpLanguageSelectDialogFragment.java │ │ │ │ ├── HoldPrintFragment.java │ │ │ │ ├── InterfaceSelectDialogFragment.java │ │ │ │ ├── ItemList.java │ │ │ │ ├── ItemListFragment.java │ │ │ │ ├── ItemListInfo.java │ │ │ │ ├── JsonUtils.java │ │ │ │ ├── LabelTypeSelectDialogFragment.java │ │ │ │ ├── LanguageSelectDialogFragment.java │ │ │ │ ├── LedFragment.java │ │ │ │ ├── LicenseDialogFragment.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainFragment.java │ │ │ │ ├── MelodySpeakerFragment.java │ │ │ │ ├── ModelCapability.java │ │ │ │ ├── ModelConfirmDialogFragment.java │ │ │ │ ├── ModelSelectDialogFragment.java │ │ │ │ ├── PageModeFragment.java │ │ │ │ ├── PaperSizeSelectDialogFragment.java │ │ │ │ ├── PortNameDialogFragment.java │ │ │ │ ├── PortSettingsDialogFragment.java │ │ │ │ ├── PresenterFragment.java │ │ │ │ ├── PrintRedirectionFragment.java │ │ │ │ ├── PrintableAreaTypeSelectDialogFragment.java │ │ │ │ ├── PrinterExtFragment.java │ │ │ │ ├── PrinterFragment.java │ │ │ │ ├── PrinterSettingConstant.java │ │ │ │ ├── PrinterSettingManager.java │ │ │ │ ├── PrinterSettings.java │ │ │ │ ├── SearchPortFragment.java │ │ │ │ ├── SerialNumberDialogFragment.java │ │ │ │ ├── TitleActivity.java │ │ │ │ ├── TitleFragment.java │ │ │ │ ├── UsbAttachedActivity.java │ │ │ │ ├── UsbSerialNumberSettingFragment.java │ │ │ │ ├── functions │ │ │ │ ├── ApiFunctions.java │ │ │ │ ├── CashDrawerFunctions.java │ │ │ │ ├── CombinationFunctions.java │ │ │ │ ├── DisplayFunctions.java │ │ │ │ ├── MelodySpeakerFunctions.java │ │ │ │ ├── PresenterFunctions.java │ │ │ │ └── PrinterFunctions.java │ │ │ │ └── localizereceipts │ │ │ │ ├── EnglishReceiptsImpl.java │ │ │ │ ├── FrenchReceiptsImpl.java │ │ │ │ ├── GermanReceiptsImpl.java │ │ │ │ ├── ILocalizeReceipts.java │ │ │ │ ├── JapaneseReceiptsImpl.java │ │ │ │ ├── PortugueseReceiptsImpl.java │ │ │ │ ├── RussianReceiptsImpl.java │ │ │ │ ├── SimplifiedChineseReceiptsImpl.java │ │ │ │ ├── SpanishReceiptsImpl.java │ │ │ │ ├── TraditionalChineseReceiptsImpl.java │ │ │ │ └── Utf8MultiLanguageReceiptsImpl.java │ │ └── res │ │ │ ├── anim │ │ │ └── blink.xml │ │ │ ├── drawable-nodpi │ │ │ ├── coupon_image.png │ │ │ ├── coupon_image_french.png │ │ │ ├── coupon_image_german.png │ │ │ ├── coupon_image_japanese.png │ │ │ ├── coupon_image_portuguese.png │ │ │ ├── coupon_image_russian.png │ │ │ ├── coupon_image_simplified_chinese.png │ │ │ ├── coupon_image_spanish.png │ │ │ ├── coupon_image_traditional_chinese.png │ │ │ ├── display_image_1.png │ │ │ ├── display_image_2.png │ │ │ ├── printable_area_image.png │ │ │ ├── sphere_image.png │ │ │ └── star_logo_image.png │ │ │ ├── drawable │ │ │ ├── checked_icon.png │ │ │ ├── ic_info_outline_white_24px.xml │ │ │ ├── ic_refresh_white_24px.xml │ │ │ ├── launch_image.jpg │ │ │ ├── segmented_ctrl_radio_button_left_selected.xml │ │ │ ├── segmented_ctrl_radio_button_left_unselected.xml │ │ │ ├── segmented_ctrl_radio_button_right_selected.xml │ │ │ ├── segmented_ctrl_radio_button_right_unselected.xml │ │ │ ├── segmented_ctrl_radio_left.xml │ │ │ ├── segmented_ctrl_radio_right.xml │ │ │ ├── segmented_ctrl_radio_text_color.xml │ │ │ └── unchecked_icon.png │ │ │ ├── layout │ │ │ ├── activity_api.xml │ │ │ ├── activity_auto_switch_interface.xml │ │ │ ├── activity_auto_switch_interface_ext.xml │ │ │ ├── activity_barcode_reader_ext.xml │ │ │ ├── activity_blackmark.xml │ │ │ ├── activity_blackmark_paste.xml │ │ │ ├── activity_bluetooth_setting.xml │ │ │ ├── activity_cash_drawer.xml │ │ │ ├── activity_cash_drawer_ext.xml │ │ │ ├── activity_combination.xml │ │ │ ├── activity_combination_ext.xml │ │ │ ├── activity_device_status.xml │ │ │ ├── activity_display.xml │ │ │ ├── activity_display_ext.xml │ │ │ ├── activity_hold_print.xml │ │ │ ├── activity_led.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_melody_speaker.xml │ │ │ ├── activity_page_mode.xml │ │ │ ├── activity_presenter.xml │ │ │ ├── activity_print_redirection.xml │ │ │ ├── activity_printer.xml │ │ │ ├── activity_printer_ext.xml │ │ │ ├── activity_printer_search.xml │ │ │ ├── activity_title.xml │ │ │ ├── activity_usb_serial_number_setting.xml │ │ │ ├── dialog_serial_number.xml │ │ │ ├── fragment_auto_switch_interface.xml │ │ │ ├── fragment_auto_switch_interface_ext.xml │ │ │ ├── fragment_barcode_ext.xml │ │ │ ├── fragment_black_mark.xml │ │ │ ├── fragment_black_mark_paste.xml │ │ │ ├── fragment_bluetooth_setting.xml │ │ │ ├── fragment_cash_drawer_ext.xml │ │ │ ├── fragment_combination_ext.xml │ │ │ ├── fragment_display_ext.xml │ │ │ ├── fragment_dummy.xml │ │ │ ├── fragment_hold_print.xml │ │ │ ├── fragment_item_list.xml │ │ │ ├── fragment_led.xml │ │ │ ├── fragment_melody_speaker.xml │ │ │ ├── fragment_presenter.xml │ │ │ ├── fragment_printer_ext.xml │ │ │ ├── fragment_title.xml │ │ │ ├── fragment_usb_serial_number_setting.xml │ │ │ ├── list_bcr_row.xml │ │ │ ├── list_destination_device_row.xml │ │ │ ├── list_device_status_row.xml │ │ │ ├── list_main_row.xml │ │ │ ├── list_main_title_row.xml │ │ │ └── list_printer_info_row.xml │ │ │ ├── menu │ │ │ ├── menu_info.xml │ │ │ └── menu_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── app_icon.xml │ │ │ └── app_icon_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── app_icon_bk.png │ │ │ └── app_icon_front.png │ │ │ ├── mipmap-mdpi │ │ │ ├── app_icon_bk.png │ │ │ └── app_icon_front.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── app_icon_bk.png │ │ │ └── app_icon_front.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── app_icon_bk.png │ │ │ └── app_icon_front.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── app_icon_bk.png │ │ │ └── app_icon_front.png │ │ │ ├── mipmap │ │ │ └── app_icon.png │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ │ └── xml │ │ │ ├── accessory_filter.xml │ │ │ └── device_filter.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── starmicronics │ │ └── starprntsdk │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle └── SoftwareLicenseAgreementAppendix.pdf /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Please create a report to help us improve. 4 | title: '' 5 | labels: triage 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Description 11 | A clear and concise description of what a bug is. 12 | 13 | ## Your device where the bug occurs 14 | - Device: 15 | *e.g. iPhone 13* 16 | - OS: 17 | *e.g. iOS 15.0* 18 | - Browser: 19 | *e.g. Safari* 20 | - Version 21 | *e.g. 22* 22 | 23 | ## Your printer 24 | - Model Names: 25 | *e.g. mC-Print3* 26 | - Firmware Version: 27 | *e.g. 3.5* 28 | - Interface: 29 | *e.g. Ethernet* 30 | 31 | ## Your development environment 32 | The result of executing the command `ver` on Windows, `sw_vers` on macOS, `uname –a` on Linux, or these equivalent commands. 33 | 34 | ## To Reproduce 35 | Steps to reproduce the behavior: 36 | 1. Go to '...' 37 | 2. Click on '....' 38 | 3. Scroll down to '....' 39 | 4. See error 40 | 41 | ## Expected behavior 42 | A clear and concise description of what you expected to happen. 43 | 44 | ## Screenshots 45 | If applicable, add screenshots to help explain your problem. 46 | 47 | ## Additional context 48 | Add any other context about the bug here. 49 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Please submit your questions to us. 4 | title: '' 5 | labels: triage 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Description 11 | A clear and concise description. 12 | 13 | ## Your device where the bug occurs 14 | - Device: 15 | *e.g. iPhone 13* 16 | - OS: 17 | *e.g. iOS 15.0* 18 | - Browser: 19 | *e.g. Safari* 20 | - Version 21 | *e.g. 22* 22 | 23 | ## Your printer 24 | - Model Names: 25 | *e.g. mC-Print3* 26 | - Firmware Version: 27 | *e.g. 3.5* 28 | - Interface: 29 | *e.g. Ethernet* 30 | 31 | ## Your development environment 32 | The result of executing the command `ver` on Windows, `sw_vers` on macOS, `uname –a` on Linux, or these equivalent commands. 33 | 34 | ## Additional context 35 | Any other context about your topic. 36 | -------------------------------------------------------------------------------- /Changelog.md: -------------------------------------------------------------------------------- 1 | # Ver.5.20.0 (2025/05/19) 2 | 3 | ## StarIO 4 | - Support Android 16 (tested on platform stability version). 5 | - Added Features 6 | * Supported mC-Label2. 7 | 8 | ## StarIOExtension 9 | - Support Android 16 (tested on platform stability version). 10 | - Changed Features 11 | * ICommandBuilder Class : Added appendBaseTextMagnification function. 12 | * ICommandBuilder Class : Extended BarcodeWidth enum. 13 | * ICommandBuilder Class : Changed to allow selection of adding line feed code to the output of AppendCutPaper function. 14 | 15 | ## StarIODeviceSetting 16 | - Support Android 16 (tested on platform stability version). 17 | 18 | ## SDK 19 | - Support Android 16 (tested on platform stability version). 20 | - Added Sample Codes 21 | * Supported mC-Label2. 22 | 23 | stario (Ver. 2.14.0)
24 | starioextension (Ver. 1.17.0)
25 | StarIODeviceSetting (Ver. 1.0.4) 26 | 27 | 28 | # Ver.5.19.0 (2024/11/01) 29 | 30 | ## StarIO 31 | - Support Android 15 32 | - Added Features 33 | * Supported TSP100IV-UEWB, TSP100IV-UEWB SK. 34 | 35 | ## StarIOExtension 36 | - Support Android15 37 | 38 | ## StarIODeviceSetting 39 | - Support Android15 40 | 41 | ## SDK 42 | - Support Android 15 43 | - Added Sample Codes 44 | * Supported TSP100IV-UEWB, TSP100IV-UEWB SK. 45 | 46 | stario (Ver. 2.13.0)
47 | starioextension (Ver. 1.16.1)
48 | StarIODeviceSetting (Ver. 1.0.3) 49 | 50 | 51 | # V5.18.0 (2024/06/24) 52 | 53 | ## StarIO 54 | - Added features 55 | * Supported BSC10II (Limited region model). 56 | 57 | ## StarIOExtension 58 | - Added Features 59 | * ICommandBuilder Class : CutPaperAction.TearOff 60 | * ICommandBuilder Class : InternationalType.India 61 | 62 | ## SDK 63 | - Added Sample Codes 64 | * Supported BSC10II (Limited region model). 65 | 66 | stario (Ver. 2.12.0)
67 | starioextension (Ver. 1.16.0)
68 | StarIODeviceSetting (Ver. 1.0.2) 69 | 70 | 71 | # V5.17.1 (2024/02/09) 72 | 73 | ## stario 74 | - Support Android14 75 | - Changed the library format from JAR to AAR. The library file name has be changed as follows. 76 | * stario.aar (old name : StarIOPort3.1.jar) 77 | - Fixed an issue. 78 | * Fixed an issue where the obtained printer status may not be the latest. 79 | (When using Android 9 or lower devices and a printer with AOA connection) 80 | 81 | ## starioextension 82 | - Support Android14 83 | - Changed the library format from JAR to AAR. The library file name has be changed as follows. 84 | * starioextension.aar (old name : starioextension.jar) 85 | 86 | ## stariodevicesetting 87 | - Support Android14 88 | 89 | * Note on changing the library format to AAR
90 | When linking libraries manually, the description of app/build.gradle is as follows. 91 | 92 | dependencies { 93 | implementation(name: 'stario', ext: 'aar') 94 | .... 95 | } 96 | 97 | ## SDK 98 | - Support Android14 99 | 100 | stario (Ver. 2.11.2)
101 | starioextension (Ver. 1.15.2)
102 | StarIODeviceSetting (Ver. 1.0.2) 103 | 104 | 105 | # V5.17.0 (2023/09/08) 106 | 107 | ## stario 108 | - Minor fixes that do not affect operation. 109 | 110 | ## stariodevicesetting 111 | - Support Android 12, 13. 112 | 113 | ## SDK 114 | - Added Sample Codes 115 | * Supported TSP100IV SK. 116 | 117 | 118 | stario (Ver. 2.11.1)
119 | starioextension (Ver. 1.15.1)
120 | StarIODeviceSetting (Ver. 1.0.1) 121 | 122 | 123 | # V5.16.0 (2023/03/31) 124 | 125 | ## StarIO 126 | - Added features 127 | * Added mC-Label3. 128 | * `StarBluetoothManager` : Added `SSP_NUMERIC_COMPARISON` to `StarBluetoothSecurity`. 129 | - Added new Bluetooth module information for SM-S230i, SM-T300i, SM-T300 and SM-T400i. 130 | 131 | stario (Ver. 2.11.0)
132 | starioextension (Ver. 1.15.1)
133 | StarIODeviceSetting (Ver. 1.0.0) 134 | 135 | 136 | # V5.15.1 (2022/05/10) 137 | 138 | ## StarIO 139 | - Added new Bluetooth module information for SM-L200. 140 | 141 | ## starioextension 142 | - Fixed an issue where apps configured to use AndroidX could not be built if Jetifier was not used. 143 | 144 | stario (Ver. 2.10.1)
145 | starioextension (Ver. 1.15.1)
146 | StarIODeviceSetting (Ver. 1.0.0) 147 | 148 | 149 | # V5.15.0 (2021/11/09) 150 | 151 | ## StarIO 152 | - Added features 153 | * Added TSP100IV. 154 | - Support Android 12 155 | * Support for Android OS specification change when using USB communication. 156 | 157 | ## smcloudservices 158 | - End of support 159 | 160 | ## SDK 161 | - Added Sample Codes 162 | * Added TSP100IV. 163 | * Support for new Bluetooth permission request when targeting Android 12. 164 | 165 | stario (Ver. 2.10.0)
166 | starioextension (Ver. 1.15.0)
167 | StarIODeviceSetting (Ver. 1.0.0) 168 | 169 | 170 | # V5.14.0 (2020/12/09) 171 | 172 | ## StarIODeviceSetting example 173 | - New 174 | 175 | ## StarIODeviceSetting 176 | - New 177 | 178 | stario (Ver. 2.9.0)
179 | starioextension (Ver. 1.15.0)
180 | smcloudservices (Ver. 1.4.1)
181 | StarIODeviceSetting (Ver. 1.0.0) 182 | 183 | 184 | # V5.14.0 (2020/06/17) 185 | 186 | ## StarIO 187 | - Added features 188 | * Added MCP31C and TSP650IISK. 189 | * Added Auto Interface Select function. 190 | 191 | ## starioextension 192 | - Added features 193 | * Added MCP31C and TSP650IISK. 194 | * Added Auto Interface Select function. 195 | * USB HID class (Keyboard mode) support for StarIoExtManager and IPeripheralCommandParser. 196 | 197 | ## SDK 198 | - Added Sample Codes 199 | * Added sample codes for Auto Interface Select function. 200 | 201 | stario (Ver. 2.9.0)
202 | starioextension (Ver. 1.15.0)
203 | smcloudservices (Ver. 1.4.1)
204 | 205 | 206 | # V5.13.0 (2019/12/25) 207 | 208 | ## StarIO 209 | - Improved internal processing 210 | 211 | ## SDK 212 | - Changed project structure 213 | * Maven support for each library. 214 | 215 | ## Manual 216 | - Changed StarPRNT SDK User's Manual from PDF to online manual link 217 | 218 | stario (Ver. 2.8.0)
219 | starioextension (Ver. 1.14.0)
220 | smcloudservices (Ver. 1.4.1) 221 | -------------------------------------------------------------------------------- /Changelog_Jp.md: -------------------------------------------------------------------------------- 1 | # Ver 5.20.0 (2025/05/19) 2 | 3 | ## StarIO 4 | - Android16に対応(プラットフォーム安定版で動作確認) 5 | - 機能追加 6 | * mC-Label2に対応 7 | 8 | ## StarIOExtension 9 | - Android16に対応(プラットフォーム安定版で動作確認) 10 | - 機能追加 11 | * ICommandBuilderクラス : appendTextBaseMagnificationメソッドを追加 12 | * ICommandBuilderクラス : BarcodeWidthの列挙型を拡張 13 | * ICommandBuilderクラス : appendCutPaperメソッドの出力に改行コードの付与を選択可能に変更 14 | 15 | ## StarIODeviceSetting 16 | - Android16に対応(プラットフォーム安定版で動作確認) 17 | 18 | ## SDK 19 | - Android16に対応(プラットフォーム安定版で動作確認) 20 | - サンプルコードの追加 21 | * mC-Label2に対応 22 | 23 | stario (Ver. 2.14.0)
24 | starioextension (Ver. 1.17.0)
25 | StarIODeviceSetting (Ver. 1.0.4) 26 | 27 | 28 | # Ver.5.19.0 (2024/11/01) 29 | 30 | ## StarIO 31 | - Android15をサポート 32 | - 機能追加 33 | * TSP100IV-UEWB, TSP100IV-UEWB SKに対応 34 | 35 | ## StarIOExtension 36 | - Android15をサポート 37 | 38 | ## StarIODeviceSetting 39 | - Android15をサポート 40 | 41 | ## SDK 42 | - Android15をサポート 43 | - サンプルコードの追加 44 | * TSP100IV-UEWB, TSP100IV-UEWB SKに対応 45 | 46 | stario (Ver. 2.13.0)
47 | starioextension (Ver. 1.16.1)
48 | StarIODeviceSetting (Ver. 1.0.3) 49 | 50 | 51 | # Ver.5.18.0 (2024/06/24) 52 | 53 | ## StarIO 54 | - 機能追加 55 | * BSC10IIに対応(日本国内では販売しておりません) 56 | 57 | ## StarIOExtension 58 | - 機能追加 59 | * ICommandBuilderクラス : CutPaperAction.TearOff 60 | * ICommandBuilderクラス : InternationalType.India 61 | 62 | ## SDK 63 | - サンプルコードの追加 64 | * BSC10IIに対応(日本国内では販売しておりません) 65 | 66 | stario (Ver. 2.12.0)
67 | starioextension (Ver. 1.16.0)
68 | StarIODeviceSetting (Ver. 1.0.2) 69 | 70 | 71 | # Ver.5.17.1 (2024/02/09) 72 | 73 | ## stario 74 | - Android14をサポート 75 | - ライブラリの形式をJARからAARに変更。ライブラリのファイル名は以下のように変更されます。 76 | * stario.aar (旧版 : StarIOPort3.1.jar) 77 | - バグ修正 78 | * Android9以下の端末とプリンターとをAOA接続で利用するとき、読み取ったプリンターステータスが最新の状態でないことがある問題を修正。 79 | 80 | ## starioextension 81 | - Android14をサポート 82 | - ライブラリの形式をJARからAARに変更。ライブラリのファイル名は以下のように変更されます。 83 | * starioextension.aar (旧版 : starioextension.jar) 84 | 85 | ## stariodevicesetting 86 | - Android14をサポート 87 | * ライブラリのAAR化に伴う注釈 88 | ライブラリを手動リンクしている場合、app/build.gradleの記述は以下のようになります。 89 | 90 | dependencies { 91 | implementation(name: 'stario', ext: 'aar') 92 | .... 93 | } 94 | 95 | ## SDK 96 | - Android14をサポート 97 | 98 | stario (Ver. 2.11.2)
99 | starioextension (Ver. 1.15.2)
100 | StarIODeviceSetting (Ver. 1.0.2) 101 | 102 | 103 | # Ver.5.17.0 (2023/09/08) 104 | 105 | ## StarIO 106 | - 動作に影響しない軽微な修正 107 | 108 | ## StarIODeviceSetting 109 | - Android 12, 13をサポート 110 | 111 | ## SDK 112 | - サンプルコードの追加 113 | * TSP100IV SKに対応 114 | - StarIODeviceSetting サンプル 115 | * Android 12, 13をサポート 116 | 117 | stario (Ver. 2.11.1)
118 | starioextension (Ver. 1.15.1)
119 | StarIODeviceSetting (Ver. 1.0.1) 120 | 121 | 122 | # Ver.5.16.0 (2023/03/31) 123 | 124 | ## StarIO 125 | - 機能追加 126 | * mC-Label3に対応 127 | * StarBluetoothManager : StarBluetoothSecurityにSSP_NUMERIC_COMPARISONを追加 128 | - SM-S210i, SM-T300i, SM-T300, SM-T400iのBluetoothモジュール情報を新規追加 129 | 130 | stario (Ver. 2.11.0)
131 | starioextension (Ver. 1.15.1)
132 | StarIODeviceSetting (Ver. 1.0.0) 133 | 134 | 135 | # Ver.5.15.1  (2022/05/10) 136 | ## StarIO 137 | - SM-L200のBluetoothモジュール情報を新規追加 138 | 139 | ## starioextension 140 | - AndroidXを使用する設定のアプリで、Jetifierを利用しない場合にビルド出来ない問題を修正 141 | 142 | stario (Ver. 2.10.1)
143 | starioextension (Ver. 1.15.1)
144 | StarIODeviceSetting (Ver. 1.0.0) 145 | 146 | 147 | # Ver.5.15.0 (2021/11/09) 148 | 149 | ## StarIO 150 | - 機能追加 151 | * TSP100IVに対応 152 | - Android 12対応 153 | * Android 12にてUSB通信をする際のAndroid OS仕様変更に対応 154 | 155 | ## smcloudservices 156 | - サポート終了 157 | 158 | ## SDK 159 | - サンプルコードの追加 160 | * TSP100IVに対応 161 | * Android 12をターゲットとする場合の新しいBluetooth権限に対応 162 | 163 | stario (Ver. 2.10.0)
164 | starioextension (Ver. 1.15.0)
165 | StarIODeviceSetting (Ver. 1.0.0) 166 | 167 | 168 | # Ver.5.14.0 (2020/12/09) 169 | 170 | ## StarIODeviceSetting example 171 | - 新規作成 172 | 173 | ## StarIODeviceSetting 174 | - 新規作成 175 | 176 | stario (Ver. 2.9.0)
177 | starioextension (Ver. 1.15.0)
178 | smcloudservices (Ver. 1.4.1)
179 | StarIODeviceSetting (Ver. 1.0.0) 180 | 181 | 182 | ## Ver.5.14.0 (2020/06/17) 183 | 184 | ## StarIO 185 | - 機能追加 186 | * MCP31C, TSP650IISKに対応 187 | * インターフェイス自動切り替え機能の追加 188 | 189 | ## starioextension 190 | - 機能追加 191 | * MCP31C, TSP650IISKに対応 192 | * インターフェイス自動切り替え機能の追加 193 | * StarIoExtManager, IPeripheralCommandParserのUSB HIDクラス(キーボードモード)対応 194 | 195 | ## SDK 196 | - サンプルコードの追加 197 | * インターフェイス自動切り替え機能の実装例 198 | 199 | stario (Ver. 2.9.0)
200 | starioextension (Ver. 1.15.0)
201 | smcloudservices (Ver. 1.4.1) 202 | 203 | 204 | # Ver 5.13.0 (2019/12/25) 205 | 206 | ## StarIO 207 | - 内部処理改善 208 | 209 | ## SDK 210 | - プロジェクト構成の変更 211 | * 各ライブラリのMaven対応 212 | 213 | ## マニュアル 214 | - StarPRNT SDKユーザーズマニュアルをPDFからオンラインマニュアルへのリンクに変更 215 | 216 | stario (Ver. 2.8.0)
217 | starioextension (Ver. 1.14.0)
218 | smcloudservices (Ver. 1.4.1) -------------------------------------------------------------------------------- /Documents/CommandEmulator_on_SMCS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/Documents/CommandEmulator_on_SMCS.pdf -------------------------------------------------------------------------------- /Documents/CommandEmulator_on_SMCS_Jp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/Documents/CommandEmulator_on_SMCS_Jp.pdf -------------------------------------------------------------------------------- /Documents/UsersManual.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://www.star-m.jp/starprntsdk-oml-android.html 3 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # StarPRNT SDK Android Java 2 | 3 | This package contains StarPRNT SDK for supporting to develop applications for Star printers. 4 | 5 | ## Scope 6 | 7 | Please refer to the [StarPRNT SDK document](https://www.star-m.jp/starprntsdk-oml-android.html) for supported OS, development environment, and supported printers. 8 | 9 | ## important 10 | 11 | ### Considerations when using mC-Label2 12 | 13 | | Printer | Paper Size | DPI | 14 | | ----------------------------------- | --------------------- | --------------------- | 15 | | mC-Label2 | 2 inch (576 dots) | 300dpi | 16 | | mC-Print2, mPOP, etc | 2 inch (384 dots) | 203dpi | 17 | | mC-Label3, mC-Print3, TSP100IV, etc | 3 inch (576 dots) | 203dpi | 18 | 19 | Due to the differences in DPI above, the sample code based on a "3-inch (576 dots)" paper size will print on a 2-inch paper size in mC-Label2. 20 | 21 | ## Limitation 22 | 23 | 1. Only the last connected USB printer can communicate with Android V5.0. 24 | 25 | 2. Please use "PIN code enable" in Bluetooth security with SM-L200. 26 | 27 | 3. When using printer with Bluetooth Interface, please do not change the memory switch setting of "ASB Status" from default value(invalid). (Bank 7/Bit C) 28 | 29 | 4. During our test, we have confirmed using Nexus9 with Android 7.0 may rarely cause a hang-up. To recover from this phenomenon, restart the OS. 30 | 31 | 5. With some Android devices, the transmission of large amounts of data(*) via Bluetooth may cause slow printing or intermittent printing. The printing can be improved by splitting data and extending the transmission interval. 32 | e.g., data created by appendBitmap method 33 | 34 | 6. If mC-Sound was connected after the printer power was turned ON, melody speaker API does not work properly. Please turn on the printer after connecting mC-Sound to it. 35 | 36 | 7. Change the behavior of releasePort method 37 | Beginning from StarIOPort3.1.jar V2.6.0 (StarPRNT SDK V5.11.0), the releasePort method behavior has been changed as shown below. 38 | - V2.5.0 and before: 39 | In the case of calling getPort method multiple times before calling releasePort method, the port is released by calling releasePort method the same number of times as the getPort method was called. 40 | - V2.6.0 and later: 41 | The port is always released when releasePort method is called. 42 | 43 | ## Copyright 44 | 45 | Copyright 2016-2025 Star Micronics Co., Ltd. All rights reserved. 46 | -------------------------------------------------------------------------------- /Readme_Jp.md: -------------------------------------------------------------------------------- 1 | 2 | # StarPRNT SDK Android Java 3 | 4 | 本パッケージはStarプリンタを使用するアプリケーションの開発を容易にするためのSDKです。 5 | 6 | ## 適用 7 | 8 | 対応OS・開発環境・対応プリンターについては、[StarPRNT SDKの開発者向けドキュメント](https://www.star-m.jp/starprntsdk-oml-android.html)を参照ください。 9 | 10 | ## 重要事項 11 | 12 | ### mC-Label2を使用する際の留意点 13 | 14 | | プリンタ | 用紙サイズ | DPI | 15 | | ------------------------------------- | --------------------- | --------------------- | 16 | | mC-Label2 | 2インチ (576ドット) | 300dpi | 17 | | mC-Print2、mPOP、その他 | 2インチ (384ドット) | 203dpi | 18 | | mC-Label3、mC-Print3、TSP100IV、その他 | 3インチ (576ドット) | 203dpi | 19 | 20 | 上記の解像度の違いにより、mC-Label2では「3インチ (576ドット)」の用紙サイズに基づいたサンプルコードを使用すると、2インチの用紙サイズで印刷されます。 21 | 22 | ## 制限事項 23 | 24 | 1. SM-L200では、BluetoothセキュリティをPinCode有効でお使いください。 25 | 26 | 2. Bluetooth I/Fでご利用の場合、メモリスイッチの"ASB機能"は、デフォルト設定(無効)のままご利用ください。(バンク7/ビットC) 27 | 28 | 3. 弊社での動作確認の中で、Android Nを搭載したNexus9にUSBデバイス(弊社USBプリンタを含む)を接続した時、まれにAndroid OSがハングアップする現象が確認されています。この場合、OS再起動により復帰することが出来ます。 29 | 30 | 4. Android端末によってはBluetoothインターフェイスで大量のデータ(※)を送信する場合、印刷が遅くなったり、間欠印字が発生したりすることがあります。その際にはデータを分割し、送信間隔をあけることで改善される場合があります。※例えば、appendBitmapメソッドで生成されたデータ 31 | 32 | 5. プリンターの電源をONした後にプリンターにmC-Soundを接続した場合、メロディスピーカーのAPIは正常に動作しません。プリンターにmC-Soundを接続した後にプリンターの電源をONしてください。 33 | 34 | 6. releasePortメソッドの挙動の変更 35 | StarIOPort3.1.jar V2.6.0 (StarPRNT SDK V5.11.0)より、releasePortメソッドの挙動を変更しました。 36 | 37 | - V2.5.0以前: 38 | releasePortメソッドを呼ぶ前にgetPortメソッドを複数回呼んだ場合は、 39 | getPortメソッドを呼んだ回数分releasePortメソッドを呼ぶことでポートがクローズされる。 40 | - V2.6.0以降: 41 | releasePortメソッドを呼んだ場合は、getPortメソッドを呼んだ回数に関わらず必ずポートがクローズされる。 42 | 43 | ## 著作権 44 | 45 | スター精密(株)Copyright 2016-2025 46 | -------------------------------------------------------------------------------- /SDK/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | android { 5 | compileSdk 36 6 | namespace "com.starmicronics.starprntsdk" 7 | defaultConfig { 8 | applicationId "com.StarMicronics.StarIOSDK" 9 | 10 | minSdkVersion 24 11 | targetSdk 36 12 | 13 | versionCode 78 14 | versionName "5.20.0" 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | implementation 'com.starmicronics:stario:2.14.0' 26 | implementation 'com.starmicronics:starioextension:1.17.0' 27 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.20" 28 | implementation 'androidx.appcompat:appcompat:1.7.0' 29 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 30 | } 31 | -------------------------------------------------------------------------------- /SDK/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Teppei\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /SDK/app/src/androidTest/java/com/starmicronics/starprntsdk/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /SDK/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 8 | 10 | 11 | 14 | 15 | 16 | 18 | 19 | 20 | 27 | 28 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 50 | 51 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/AutoSwitchInterfaceFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | 4 | import android.app.ProgressDialog; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.Button; 12 | 13 | import androidx.annotation.NonNull; 14 | import androidx.annotation.Nullable; 15 | import androidx.fragment.app.Fragment; 16 | 17 | import com.starmicronics.starioextension.StarIoExt; 18 | import com.starmicronics.starprntsdk.functions.PrinterFunctions; 19 | import com.starmicronics.starprntsdk.localizereceipts.ILocalizeReceipts; 20 | 21 | public class AutoSwitchInterfaceFragment extends CommonFragment implements CommonAlertDialogFragment.Callback { 22 | 23 | private ProgressDialog mProgressDialog; 24 | 25 | private boolean mIsForeground; 26 | 27 | @Nullable 28 | @Override 29 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 30 | View rootView = inflater.inflate(R.layout.fragment_auto_switch_interface, container, false); 31 | 32 | Button testPrintButton = rootView.findViewById(R.id.testPrintButton); 33 | testPrintButton.setOnClickListener(new View.OnClickListener() { 34 | @Override 35 | public void onClick(View view) { 36 | print(); 37 | } 38 | }); 39 | 40 | mProgressDialog = new ProgressDialog(getActivity()); 41 | 42 | mProgressDialog.setMessage("Communicating..."); 43 | mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 44 | mProgressDialog.setCancelable(false); 45 | 46 | return rootView; 47 | } 48 | 49 | @Override 50 | public void onResume() { 51 | super.onResume(); 52 | 53 | mIsForeground = true; 54 | } 55 | 56 | @Override 57 | public void onPause() { 58 | super.onPause(); 59 | 60 | mIsForeground = false; 61 | 62 | if (mProgressDialog != null) { 63 | mProgressDialog.dismiss(); 64 | } 65 | } 66 | 67 | private void print() { 68 | mProgressDialog.show(); 69 | 70 | PrinterSettingManager settingManager = new PrinterSettingManager(getActivity()); 71 | PrinterSettings settings = settingManager.getPrinterSettings(); 72 | 73 | StarIoExt.Emulation emulation = ModelCapability.getEmulation(settings.getModelIndex()); 74 | int paperSize = settings.getPaperSize(); 75 | 76 | ILocalizeReceipts localizeReceipts = ILocalizeReceipts.createLocalizeReceipts(PrinterSettingConstant.LANGUAGE_ENGLISH, paperSize); 77 | 78 | byte[] commands = PrinterFunctions.createRasterReceiptData(emulation, localizeReceipts, getResources()); 79 | 80 | Communication.sendCommandsWithAutoInterfaceSelect(this, commands, settings.getPortSettings(), 10000, 30000, getActivity(), mCallback); // 10000mS!!! 81 | } 82 | 83 | private final Communication.AutoInterfaceSelectCallback mCallback = new Communication.AutoInterfaceSelectCallback() { 84 | @Override 85 | public void onStatus(String portName, Communication.CommunicationResult communicationResult) { 86 | if (!mIsForeground) { 87 | return; 88 | } 89 | 90 | if (mProgressDialog != null) { 91 | mProgressDialog.dismiss(); 92 | } 93 | 94 | CommonAlertDialogFragment dialog = CommonAlertDialogFragment.newInstance("CommResultDialog"); 95 | dialog.setTitle("Communication Result"); 96 | dialog.setMessage(Communication.getCommunicationResultMessage(communicationResult) + "\nPort Name: " + portName); 97 | dialog.setPositiveButton("OK"); 98 | dialog.show(getChildFragmentManager()); 99 | } 100 | }; 101 | 102 | @Override 103 | public void onDialogResult(String tag, Intent data) { 104 | // do nothing 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/AutomaticPageLengthTypeSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.appcompat.app.AlertDialog; 10 | 11 | public class AutomaticPageLengthTypeSelectDialogFragment extends CommonAlertDialogFragment { 12 | private Callback mCallbackTarget; 13 | 14 | public static AutomaticPageLengthTypeSelectDialogFragment newInstance(String tag) { 15 | AutomaticPageLengthTypeSelectDialogFragment dialogFragment = new AutomaticPageLengthTypeSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select automatic page length type."); 35 | 36 | builder.setItems(new String[]{ 37 | "Invalid", 38 | "Valid", 39 | "Default"}, 40 | mOnTypeClickListener); 41 | 42 | setupNegativeButton(builder); 43 | 44 | mCallbackTarget = (Callback) getParentFragment(); 45 | 46 | return builder.create(); 47 | } 48 | 49 | private DialogInterface.OnClickListener mOnTypeClickListener = new DialogInterface.OnClickListener() { 50 | @Override 51 | public void onClick(DialogInterface dialog, int which) { 52 | Intent intentForPassingData = new Intent(); 53 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_AUTOMATIC_PAGE_LENGTH_TYPE_INDEX, which); 54 | 55 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 56 | 57 | dismiss(); 58 | } 59 | }; 60 | } 61 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/BlackMarkTypeSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class BlackMarkTypeSelectDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static BlackMarkTypeSelectDialogFragment newInstance(String tag) { 15 | BlackMarkTypeSelectDialogFragment dialogFragment = new BlackMarkTypeSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select black mark type."); 35 | 36 | builder.setItems(new String[]{ 37 | "Invalid", 38 | "Valid", 39 | "Valid with Detection"}, 40 | mOnTypeClickListener); 41 | 42 | setupNegativeButton(builder); 43 | 44 | mCallbackTarget = (Callback) getParentFragment(); 45 | 46 | return builder.create(); 47 | } 48 | 49 | private DialogInterface.OnClickListener mOnTypeClickListener = new DialogInterface.OnClickListener() { 50 | @Override 51 | public void onClick(DialogInterface dialog, int which) { 52 | Intent intentForPassingData = new Intent(); 53 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_BLACK_MARK_TYPE_INDEX, which); 54 | 55 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 56 | 57 | dismiss(); 58 | } 59 | }; 60 | } 61 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/BluetoothSettingSecuritySelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | public class BluetoothSettingSecuritySelectDialogFragment extends CommonAlertDialogFragment { 14 | private static final String SECURITY_TAG = "bundle_string_"; 15 | 16 | private Callback mCallbackTarget; 17 | 18 | public static BluetoothSettingSecuritySelectDialogFragment newInstance(String tag, List securityList) { 19 | BluetoothSettingSecuritySelectDialogFragment dialogFragment = new BluetoothSettingSecuritySelectDialogFragment(); 20 | 21 | Bundle args = new Bundle(); 22 | args.putString(DIALOG_TAG, tag); 23 | 24 | for (int i = 0; i < securityList.size(); i++){ 25 | args.putString(SECURITY_TAG + i, securityList.get(i)); 26 | } 27 | 28 | args.putBoolean(CANCEL, false); 29 | args.putBoolean(CALLBACK, true); 30 | args.putString(LABEL_NEGATIVE, "Cancel"); 31 | 32 | dialogFragment.setArguments(args); 33 | dialogFragment.setCancelable(false); 34 | 35 | return dialogFragment; 36 | } 37 | 38 | @Override 39 | public @NonNull 40 | Dialog onCreateDialog(Bundle savedInstanceState) { 41 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 42 | 43 | builder.setTitle("Select security type."); 44 | 45 | Bundle args = getArguments(); 46 | 47 | List securityList = new ArrayList<>(); 48 | int i = 0; 49 | while (true) { 50 | String arg = args.getString(SECURITY_TAG + i); 51 | 52 | if (arg == null){ 53 | break; 54 | } 55 | 56 | securityList.add(arg); 57 | i++; 58 | } 59 | 60 | String[] array = securityList.toArray(new String[securityList.size()]); 61 | 62 | builder.setItems(array, 63 | mOnSecurityClickListener); 64 | 65 | setupNegativeButton(builder); 66 | 67 | mCallbackTarget = (Callback) getParentFragment(); 68 | 69 | return builder.create(); 70 | } 71 | 72 | private DialogInterface.OnClickListener mOnSecurityClickListener = new DialogInterface.OnClickListener() { 73 | @Override 74 | public void onClick(DialogInterface dialog, int which) { 75 | String selectedSecurity = ""; 76 | 77 | Bundle args = getArguments(); 78 | 79 | selectedSecurity = args.getString(SECURITY_TAG + which); 80 | 81 | Intent intentForPassingData = new Intent(); 82 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_BLUETOOTH_SETTING_SECURITY, selectedSecurity); 83 | 84 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 85 | 86 | dismiss(); 87 | } 88 | }; 89 | } 90 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/CashDrawerFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.AdapterView; 8 | 9 | import com.starmicronics.starprntsdk.Communication.CommunicationResult; 10 | 11 | import com.starmicronics.starioextension.StarIoExt.Emulation; 12 | import com.starmicronics.starprntsdk.functions.CashDrawerFunctions; 13 | 14 | import static com.starmicronics.starioextension.ICommandBuilder.PeripheralChannel; 15 | 16 | public class CashDrawerFragment extends ItemListFragment implements CommonAlertDialogFragment.Callback { 17 | private ProgressDialog mProgressDialog; 18 | 19 | private boolean mIsForeground; 20 | 21 | @Override 22 | public void onCreate(Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | 25 | mProgressDialog = new ProgressDialog(getActivity()); 26 | mProgressDialog.setMessage("Communicating..."); 27 | mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 28 | mProgressDialog.setCancelable(false); 29 | 30 | addTitle("Like a StarIO-SDK Sample"); 31 | addMenu("Channel1 (Check condition.)"); 32 | addMenu("Channel1 (Do not check condition.)"); 33 | addMenu("Channel2 (Check condition.)"); 34 | addMenu("Channel2 (Do not check condition.)"); 35 | 36 | addTitle("StarIoExtManager Sample"); 37 | addMenu("Channel1 (Check condition.)"); 38 | addMenu("Channel1 (Do not check condition.)"); 39 | addMenu("Channel2 (Check condition.)"); 40 | addMenu("Channel2 (Do not check condition.)"); 41 | } 42 | 43 | @Override 44 | public void onResume() { 45 | super.onResume(); 46 | 47 | mIsForeground = true; 48 | } 49 | 50 | @Override 51 | public void onPause() { 52 | super.onPause(); 53 | 54 | mIsForeground = false; 55 | 56 | if (mProgressDialog != null) { 57 | mProgressDialog.dismiss(); 58 | } 59 | } 60 | 61 | @Override 62 | public void onItemClick(AdapterView parent, View view, int position, long id) { 63 | super.onItemClick(parent, view, position, id); 64 | 65 | if (1 <= position && position <= 4) { 66 | PeripheralChannel channel = position == 1 || position == 2 ? PeripheralChannel.No1 : PeripheralChannel.No2; 67 | boolean doCheckCondition = position == 1 || position == 3; 68 | 69 | openDrawer(channel, doCheckCondition); 70 | } 71 | else if (6 <= position && position <= 9) { 72 | startTestDrawerActivity(position - 5); 73 | } 74 | } 75 | 76 | @Override 77 | public void onDialogResult(String tag, Intent data) { 78 | // do nothing 79 | } 80 | 81 | private void openDrawer(PeripheralChannel channel, boolean doCheckCondition) { 82 | mProgressDialog.show(); 83 | 84 | PrinterSettingManager settingManager = new PrinterSettingManager(getActivity()); 85 | PrinterSettings settings = settingManager.getPrinterSettings(); 86 | 87 | Emulation emulation = ModelCapability.getEmulation(settings.getModelIndex()); 88 | 89 | byte[] data = CashDrawerFunctions.createData(emulation, channel); 90 | 91 | if (doCheckCondition) { 92 | Communication.sendCommands(this, data, settings.getPortName(), settings.getPortSettings(), 10000, 30000, getActivity(), mCallback); // 10000mS!!! 93 | } 94 | else { 95 | Communication.sendCommandsDoNotCheckCondition(this, data, settings.getPortName(), settings.getPortSettings(), 10000, getActivity(), mCallback); // 10000mS!!! 96 | } 97 | } 98 | 99 | private final Communication.SendCallback mCallback = new Communication.SendCallback() { 100 | @Override 101 | public void onStatus(CommunicationResult communicationResult) { 102 | if (!mIsForeground) { 103 | return; 104 | } 105 | 106 | if (mProgressDialog != null) { 107 | mProgressDialog.dismiss(); 108 | } 109 | 110 | CommonAlertDialogFragment dialog = CommonAlertDialogFragment.newInstance("CommResultDialog"); 111 | dialog.setTitle("Communication Result"); 112 | dialog.setMessage(Communication.getCommunicationResultMessage(communicationResult)); 113 | dialog.setPositiveButton("OK"); 114 | dialog.show(getChildFragmentManager()); 115 | } 116 | }; 117 | 118 | private void startTestDrawerActivity(int index) { 119 | Intent intent = new Intent(getActivity(), CommonActivity.class); 120 | 121 | intent.putExtra(CommonActivity.BUNDLE_KEY_ACTIVITY_LAYOUT, R.layout.activity_cash_drawer_ext); 122 | intent.putExtra(CommonActivity.BUNDLE_KEY_TOOLBAR_TITLE, "CashDrawer Ext"); 123 | intent.putExtra(CommonActivity.BUNDLE_KEY_SHOW_HOME_BUTTON, true); 124 | intent.putExtra(CommonActivity.BUNDLE_KEY_SHOW_RELOAD_BUTTON, true); 125 | intent.putExtra(CommonActivity.BUNDLE_KEY_TEST_BUTTON_TEXT, "Open"); 126 | intent.putExtra(CommonActivity.BUNDLE_KEY_SELECTED_INDEX, index); 127 | 128 | startActivity(intent); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/CombinationFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.AdapterView; 7 | 8 | import com.starmicronics.starprntsdk.localizereceipts.ILocalizeReceipts; 9 | 10 | public class CombinationFragment extends ItemListFragment { 11 | 12 | private int mLanguage; 13 | 14 | @Override 15 | public void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | 18 | Intent intent = getActivity().getIntent(); 19 | mLanguage = intent.getIntExtra(CommonActivity.BUNDLE_KEY_LANGUAGE, PrinterSettingConstant.LANGUAGE_ENGLISH); 20 | 21 | PrinterSettingManager settingManager = new PrinterSettingManager(getActivity()); 22 | PrinterSettings settings = settingManager.getPrinterSettings(); 23 | 24 | int paperSize = settings.getPaperSize(); 25 | 26 | ILocalizeReceipts localizeReceipts = ILocalizeReceipts.createLocalizeReceipts(mLanguage, paperSize); 27 | String languageCode = localizeReceipts.getLanguageCode(); 28 | String paperSizeStr = localizeReceipts.getPaperSizeStr(); 29 | String scalePaperSizeStr = localizeReceipts.getScalePaperSizeStr(); 30 | 31 | addTitle("StarIoExtManager Sample"); 32 | addMenu(languageCode + " " + paperSizeStr + " Text Receipt"); 33 | addMenu(languageCode + " " + paperSizeStr + " Text Receipt (UTF8)"); 34 | addMenu(languageCode + " " + paperSizeStr + " Raster Receipt"); 35 | addMenu(languageCode + " " + scalePaperSizeStr + " Raster Receipt (Both Scale)"); 36 | addMenu(languageCode + " " + scalePaperSizeStr + " Raster Receipt (Scale)"); 37 | addMenu(languageCode + " Raster Coupon"); 38 | addMenu(languageCode + " Raster Coupon (Rotation90)"); 39 | } 40 | 41 | @Override 42 | public void onItemClick(AdapterView parent, View view, int position, long id) { 43 | super.onItemClick(parent, view, position, id); 44 | 45 | Intent intent = new Intent(getActivity(), CommonActivity.class); 46 | intent.putExtra(CommonActivity.BUNDLE_KEY_ACTIVITY_LAYOUT, R.layout.activity_combination_ext); 47 | intent.putExtra(CommonActivity.BUNDLE_KEY_TOOLBAR_TITLE, "Combination Ext"); 48 | intent.putExtra(CommonActivity.BUNDLE_KEY_SHOW_HOME_BUTTON, true); 49 | intent.putExtra(CommonActivity.BUNDLE_KEY_SHOW_RELOAD_BUTTON, true); 50 | intent.putExtra(CommonActivity.BUNDLE_KEY_TEST_BUTTON_TEXT, "Print"); 51 | intent.putExtra(CommonActivity.BUNDLE_KEY_SELECTED_INDEX, position); 52 | intent.putExtra(CommonActivity.BUNDLE_KEY_LANGUAGE, mLanguage); 53 | 54 | startActivity(intent); 55 | } 56 | } -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/CombinationLanguageSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class CombinationLanguageSelectDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static CombinationLanguageSelectDialogFragment newInstance(String tag) { 15 | CombinationLanguageSelectDialogFragment dialogFragment = new CombinationLanguageSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select language."); 35 | 36 | builder.setItems(new String[]{ 37 | "English", 38 | "Japanese", 39 | "French", 40 | "Portuguese", 41 | "Spanish", 42 | "German", 43 | "Russian", 44 | "Simplified Chinese", 45 | "Traditional Chinese"}, 46 | mOnLanguageClickListener); 47 | 48 | setupNegativeButton(builder); 49 | 50 | mCallbackTarget = (CommonAlertDialogFragment.Callback) getParentFragment(); 51 | 52 | return builder.create(); 53 | } 54 | 55 | private DialogInterface.OnClickListener mOnLanguageClickListener = new DialogInterface.OnClickListener() { 56 | @Override 57 | public void onClick(DialogInterface dialog, int which) { 58 | int selectedLanguage = PrinterSettingConstant.LANGUAGE_ENGLISH; 59 | 60 | switch (which) { 61 | case 0: selectedLanguage = PrinterSettingConstant.LANGUAGE_ENGLISH; break; 62 | case 1: selectedLanguage = PrinterSettingConstant.LANGUAGE_JAPANESE; break; 63 | case 2: selectedLanguage = PrinterSettingConstant.LANGUAGE_FRENCH; break; 64 | case 3: selectedLanguage = PrinterSettingConstant.LANGUAGE_PORTUGUESE; break; 65 | case 4: selectedLanguage = PrinterSettingConstant.LANGUAGE_SPANISH; break; 66 | case 5: selectedLanguage = PrinterSettingConstant.LANGUAGE_GERMAN; break; 67 | case 6: selectedLanguage = PrinterSettingConstant.LANGUAGE_RUSSIAN; break; 68 | case 7: selectedLanguage = PrinterSettingConstant.LANGUAGE_SIMPLIFIED_CHINESE; break; 69 | case 8: selectedLanguage = PrinterSettingConstant.LANGUAGE_TRADITIONAL_CHINESE; break; 70 | } 71 | 72 | Intent intentForPassingData = new Intent(); 73 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_LANGUAGE, selectedLanguage); 74 | 75 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 76 | 77 | dismiss(); 78 | } 79 | }; 80 | } 81 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/CommonActivity.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import androidx.appcompat.app.ActionBar; 6 | import androidx.appcompat.app.AppCompatActivity; 7 | import android.view.Menu; 8 | import android.view.MenuItem; 9 | 10 | public class CommonActivity extends AppCompatActivity { 11 | 12 | public static final String BUNDLE_KEY_ACTIVITY_LAYOUT = "bundle_key_activity_layout"; 13 | public static final String BUNDLE_KEY_TOOLBAR_TITLE = "bundle_key_toolbar_title"; 14 | 15 | public static final String BUNDLE_KEY_TEST_BUTTON_TEXT = "bundle_key_test_button_text"; 16 | public static final String BUNDLE_KEY_SHOW_HOME_BUTTON = "bundle_key_show_home_button"; 17 | public static final String BUNDLE_KEY_SHOW_RELOAD_BUTTON = "bundle_key_show_reload_button"; 18 | public static final String BUNDLE_KEY_SHOW_INFO_BUTTON = "bundle_key_show_info_button"; 19 | public static final String BUNDLE_KEY_SELECTED_INDEX = "bundle_key_selected_index"; 20 | 21 | public static final String BUNDLE_KEY_MODEL_INDEX = "bundle_key_model_index"; 22 | 23 | public static final String BUNDLE_KEY_PAPER_SIZE = "bundle_key_paper_size"; 24 | public static final String BUNDLE_KEY_LANGUAGE = "bundle_key_language"; 25 | 26 | public static final String BUNDLE_KEY_INTERFACE = "bundle_key_interface"; 27 | 28 | public static final String BUNDLE_KEY_DRAWER_OPEN_STATUS = "bundle_key_drawer_open_status"; 29 | 30 | public static final String BUNDLE_KEY_BLACK_MARK_TYPE_INDEX = "bundle_key_black_mark_type_index"; 31 | 32 | public static final String BUNDLE_KEY_PRINTABLE_AREA_TYPE_INDEX = "bundle_key_printable_area_type_index"; 33 | 34 | public static final String BUNDLE_KEY_AUTOMATIC_PAGE_LENGTH_TYPE_INDEX = "bundle_key_automatic_page_length_type_index"; 35 | 36 | public static final String BUNDLE_KEY_LABEL_TYPE_INDEX = "bundle_key_label_type_index"; 37 | 38 | public static final String BUNDLE_KEY_PRINTER_SETTING_INDEX = "bundle_key_is_main_printer"; 39 | 40 | public static final String BUNDLE_KEY_PORT_NAME = "intent_key_port_name"; 41 | public static final String BUNDLE_KEY_PORT_SETTINGS = "intent_key_port_settings"; 42 | 43 | public static final String BUNDLE_KEY_INDEX = "bundle_key_index"; 44 | 45 | public static final String BUNDLE_KEY_BLUETOOTH_SETTING_SECURITY = "bundle_key_bluetooth_setting_security"; 46 | 47 | @Override 48 | protected void onCreate(Bundle savedInstanceState) { 49 | super.onCreate(savedInstanceState); 50 | 51 | Intent intent = getIntent(); 52 | 53 | setContentView(intent.getIntExtra(CommonActivity.BUNDLE_KEY_ACTIVITY_LAYOUT, R.layout.fragment_dummy)); // Display a user selected menu list. 54 | 55 | ActionBar actionBar = getSupportActionBar(); 56 | 57 | if (actionBar != null && intent.getBooleanExtra(CommonActivity.BUNDLE_KEY_SHOW_HOME_BUTTON, false)) { 58 | actionBar.setDisplayHomeAsUpEnabled(true); 59 | actionBar.setHomeButtonEnabled(true); 60 | } 61 | 62 | String toolbarTitle = intent.getStringExtra(CommonActivity.BUNDLE_KEY_TOOLBAR_TITLE); 63 | 64 | if (actionBar != null && toolbarTitle != null) { 65 | actionBar.setTitle(intent.getStringExtra(CommonActivity.BUNDLE_KEY_TOOLBAR_TITLE)); 66 | } 67 | } 68 | 69 | @Override 70 | public boolean onCreateOptionsMenu(Menu menu) { 71 | Intent intent = getIntent(); 72 | 73 | if (intent.getBooleanExtra(CommonActivity.BUNDLE_KEY_SHOW_RELOAD_BUTTON, false)) { 74 | getMenuInflater().inflate(R.menu.menu_main, menu); 75 | } 76 | if (intent.getBooleanExtra(CommonActivity.BUNDLE_KEY_SHOW_INFO_BUTTON, false)) { 77 | getMenuInflater().inflate(R.menu.menu_info, menu); 78 | } 79 | 80 | return true; 81 | } 82 | 83 | @Override 84 | public boolean onOptionsItemSelected(MenuItem item) { 85 | int id = item.getItemId(); 86 | 87 | if (id == android.R.id.home) { 88 | finish(); 89 | } 90 | 91 | return super.onOptionsItemSelected(item); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/CommonFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.view.View; 4 | 5 | import androidx.core.graphics.Insets; 6 | import androidx.core.view.ViewCompat; 7 | import androidx.core.view.WindowInsetsCompat; 8 | import androidx.fragment.app.Fragment; 9 | 10 | public class CommonFragment extends Fragment { 11 | 12 | public void setPadding(View view) { 13 | ViewCompat.setOnApplyWindowInsetsListener(view, (v, insets) -> { 14 | int insetTypes = WindowInsetsCompat.Type.displayCutout() | WindowInsetsCompat.Type.systemBars(); 15 | Insets bars = insets.getInsets(insetTypes); 16 | v.setPadding(bars.left, bars.top, bars.right, bars.bottom); 17 | return WindowInsetsCompat.CONSUMED; 18 | }); 19 | } 20 | @Override 21 | public void onResume() { 22 | super.onResume(); 23 | 24 | setPadding(getView()); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DisplayCharacterSetCodePageDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DisplayCharacterSetCodePageDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static DisplayCharacterSetCodePageDialogFragment newInstance(String tag) { 15 | DisplayCharacterSetCodePageDialogFragment dialogFragment = new DisplayCharacterSetCodePageDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select Character Set (Code Page)."); 35 | 36 | builder.setItems(new String[]{ 37 | "Code Page 437", 38 | "Katakana", 39 | "Code Page 850", 40 | "Code Page 860", 41 | "Code Page 863", 42 | "Code Page 865", 43 | "Code Page 1252", 44 | "Code Page 866", 45 | "Code Page 852", 46 | "Code Page 858", 47 | "Japanese", 48 | "Simplified Chinese", 49 | "Traditional Chinese", 50 | "Hangul"}, 51 | mOnCodePageClickListener); 52 | 53 | setupNegativeButton(builder); 54 | 55 | mCallbackTarget = (Callback) getParentFragment(); 56 | 57 | return builder.create(); 58 | } 59 | 60 | private DialogInterface.OnClickListener mOnCodePageClickListener = new DialogInterface.OnClickListener() { 61 | @Override 62 | public void onClick(DialogInterface dialog, int which) { 63 | Intent intentForPassingData = new Intent(); 64 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INDEX, which); 65 | 66 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 67 | 68 | dismiss(); 69 | } 70 | }; 71 | } 72 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DisplayCharacterSetInternationalDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DisplayCharacterSetInternationalDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static DisplayCharacterSetInternationalDialogFragment newInstance(String tag) { 15 | DisplayCharacterSetInternationalDialogFragment dialogFragment = new DisplayCharacterSetInternationalDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select Character Set (International)."); 35 | 36 | builder.setItems(new String[]{ 37 | "USA", 38 | "France", 39 | "Germany", 40 | "UK", 41 | "Denmark", 42 | "Sweden", 43 | "Italy", 44 | "Spain", 45 | "Japan", 46 | "Norway", 47 | "Denmark 2", 48 | "Spain 2", 49 | "Latin America", 50 | "Korea"}, 51 | mOnInternationalClickListener); 52 | 53 | setupNegativeButton(builder); 54 | 55 | mCallbackTarget = (Callback) getParentFragment(); 56 | 57 | return builder.create(); 58 | } 59 | 60 | private DialogInterface.OnClickListener mOnInternationalClickListener = new DialogInterface.OnClickListener() { 61 | @Override 62 | public void onClick(DialogInterface dialog, int which) { 63 | Intent intentForPassingData = new Intent(); 64 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INDEX, which); 65 | 66 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 67 | 68 | dismiss(); 69 | } 70 | }; 71 | } 72 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DisplayContrastDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DisplayContrastDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static DisplayContrastDialogFragment newInstance(String tag) { 15 | DisplayContrastDialogFragment dialogFragment = new DisplayContrastDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select Contrast."); 35 | 36 | builder.setItems(new String[]{ 37 | "Contrast -3", 38 | "Contrast -2", 39 | "Contrast -1", 40 | "Default", 41 | "Contrast +1", 42 | "Contrast +2", 43 | "Contrast +3"}, 44 | mOnContrastClickListener); 45 | 46 | setupNegativeButton(builder); 47 | 48 | mCallbackTarget = (Callback) getParentFragment(); 49 | 50 | return builder.create(); 51 | } 52 | 53 | private DialogInterface.OnClickListener mOnContrastClickListener = new DialogInterface.OnClickListener() { 54 | @Override 55 | public void onClick(DialogInterface dialog, int which) { 56 | Intent intentForPassingData = new Intent(); 57 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INDEX, which); 58 | 59 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 60 | 61 | dismiss(); 62 | } 63 | }; 64 | } 65 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DisplayCursorDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DisplayCursorDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static DisplayCursorDialogFragment newInstance(String tag) { 15 | DisplayCursorDialogFragment dialogFragment = new DisplayCursorDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select Cursor."); 35 | 36 | builder.setItems(new String[]{ 37 | "Off", 38 | "Blink", 39 | "On"}, 40 | mOnCursorClickListener); 41 | 42 | setupNegativeButton(builder); 43 | 44 | mCallbackTarget = (Callback) getParentFragment(); 45 | 46 | return builder.create(); 47 | } 48 | 49 | private DialogInterface.OnClickListener mOnCursorClickListener = new DialogInterface.OnClickListener() { 50 | @Override 51 | public void onClick(DialogInterface dialog, int which) { 52 | Intent intentForPassingData = new Intent(); 53 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INDEX, which); 54 | 55 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 56 | 57 | dismiss(); 58 | } 59 | }; 60 | } 61 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DisplayGraphicDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DisplayGraphicDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static DisplayGraphicDialogFragment newInstance(String tag) { 15 | DisplayGraphicDialogFragment dialogFragment = new DisplayGraphicDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select Graphic."); 35 | 36 | builder.setItems(new String[]{ 37 | "Pattern 1", 38 | "Pattern 2"}, 39 | mOnGraphicClickListener); 40 | 41 | setupNegativeButton(builder); 42 | 43 | mCallbackTarget = (Callback) getParentFragment(); 44 | 45 | return builder.create(); 46 | } 47 | 48 | private DialogInterface.OnClickListener mOnGraphicClickListener = new DialogInterface.OnClickListener() { 49 | @Override 50 | public void onClick(DialogInterface dialog, int which) { 51 | Intent intentForPassingData = new Intent(); 52 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INDEX, which); 53 | 54 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 55 | 56 | dismiss(); 57 | } 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DisplayTextDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DisplayTextDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static DisplayTextDialogFragment newInstance(String tag) { 15 | DisplayTextDialogFragment dialogFragment = new DisplayTextDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select Text."); 35 | 36 | builder.setItems(new String[]{ 37 | "Pattern 1", 38 | "Pattern 2", 39 | "Pattern 3", 40 | "Pattern 4", 41 | "Pattern 5", 42 | "Pattern 6"}, 43 | mOnTextClickListener); 44 | 45 | setupNegativeButton(builder); 46 | 47 | mCallbackTarget = (CommonAlertDialogFragment.Callback) getParentFragment(); 48 | 49 | return builder.create(); 50 | } 51 | 52 | private DialogInterface.OnClickListener mOnTextClickListener = new DialogInterface.OnClickListener() { 53 | @Override 54 | public void onClick(DialogInterface dialog, int which) { 55 | Intent intentForPassingData = new Intent(); 56 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INDEX, which); 57 | 58 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 59 | 60 | dismiss(); 61 | } 62 | }; 63 | } 64 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DisplayTurnOnOffDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DisplayTurnOnOffDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static DisplayTurnOnOffDialogFragment newInstance(String tag) { 15 | DisplayTurnOnOffDialogFragment dialogFragment = new DisplayTurnOnOffDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select Turn On/Off."); 35 | 36 | builder.setItems(new String[]{ 37 | "Turn On", 38 | "Turn Off"}, 39 | mOnTurnOnOffClickListener); 40 | 41 | setupNegativeButton(builder); 42 | 43 | mCallbackTarget = (Callback) getParentFragment(); 44 | 45 | return builder.create(); 46 | } 47 | 48 | private DialogInterface.OnClickListener mOnTurnOnOffClickListener = new DialogInterface.OnClickListener() { 49 | @Override 50 | public void onClick(DialogInterface dialog, int which) { 51 | Intent intentForPassingData = new Intent(); 52 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INDEX, which); 53 | 54 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 55 | 56 | dismiss(); 57 | } 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DisplayUserDefinedCharacterDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DisplayUserDefinedCharacterDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static DisplayUserDefinedCharacterDialogFragment newInstance(String tag) { 15 | DisplayUserDefinedCharacterDialogFragment dialogFragment = new DisplayUserDefinedCharacterDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select User Defined Character."); 35 | 36 | builder.setItems(new String[]{ 37 | "Set", 38 | "Reset"}, 39 | mOnSetResetClickListener); 40 | 41 | setupNegativeButton(builder); 42 | 43 | mCallbackTarget = (Callback) getParentFragment(); 44 | 45 | return builder.create(); 46 | } 47 | 48 | private DialogInterface.OnClickListener mOnSetResetClickListener = new DialogInterface.OnClickListener() { 49 | @Override 50 | public void onClick(DialogInterface dialog, int which) { 51 | Intent intentForPassingData = new Intent(); 52 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INDEX, which); 53 | 54 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 55 | 56 | dismiss(); 57 | } 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/DrawerOpenActiveSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class DrawerOpenActiveSelectDialogFragment extends CommonAlertDialogFragment { 11 | private CommonAlertDialogFragment.Callback mCallbackTarget; 12 | 13 | public static DrawerOpenActiveSelectDialogFragment newInstance(String tag) { 14 | DrawerOpenActiveSelectDialogFragment dialogFragment = new DrawerOpenActiveSelectDialogFragment(); 15 | 16 | Bundle args = new Bundle(); 17 | args.putString(DIALOG_TAG, tag); 18 | args.putBoolean(CANCEL, false); 19 | args.putBoolean(CALLBACK, true); 20 | args.putString(LABEL_NEGATIVE, "Cancel"); 21 | 22 | dialogFragment.setArguments(args); 23 | dialogFragment.setCancelable(false); 24 | 25 | return dialogFragment; 26 | } 27 | 28 | @Override 29 | public @NonNull 30 | Dialog onCreateDialog(Bundle savedInstanceState) { 31 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 32 | 33 | builder.setTitle("Select CashDrawer Open Status."); 34 | 35 | builder.setItems(new String[]{ 36 | "High when Open", 37 | "Low when Open"}, 38 | mOnDrawerStatusClickListener); 39 | 40 | setupNegativeButton(builder); 41 | 42 | mCallbackTarget = (CommonAlertDialogFragment.Callback) getParentFragment(); 43 | 44 | return builder.create(); 45 | } 46 | 47 | private DialogInterface.OnClickListener mOnDrawerStatusClickListener = new DialogInterface.OnClickListener() { 48 | @Override 49 | public void onClick(DialogInterface dialog, int which) { 50 | boolean activeHigh; 51 | 52 | switch (which) { 53 | default: 54 | case 0: activeHigh = true; break; 55 | case 1: activeHigh = false; break; 56 | } 57 | 58 | Intent intentForPassingData = new Intent(); 59 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_DRAWER_OPEN_STATUS, activeHigh); 60 | 61 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 62 | 63 | dismiss(); 64 | } 65 | }; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/EnJpLanguageSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class EnJpLanguageSelectDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static EnJpLanguageSelectDialogFragment newInstance(String tag) { 15 | EnJpLanguageSelectDialogFragment dialogFragment = new EnJpLanguageSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select language."); 35 | 36 | builder.setItems(new String[]{ 37 | "English", 38 | "Japanese"}, 39 | mOnLanguageClickListener); 40 | 41 | setupNegativeButton(builder); 42 | 43 | mCallbackTarget = (Callback) getParentFragment(); 44 | 45 | return builder.create(); 46 | } 47 | 48 | private DialogInterface.OnClickListener mOnLanguageClickListener = new DialogInterface.OnClickListener() { 49 | @Override 50 | public void onClick(DialogInterface dialog, int which) { 51 | int selectedLanguage = PrinterSettingConstant.LANGUAGE_ENGLISH; 52 | 53 | switch (which) { 54 | case 0: selectedLanguage = PrinterSettingConstant.LANGUAGE_ENGLISH; break; 55 | case 1: selectedLanguage = PrinterSettingConstant.LANGUAGE_JAPANESE; break; 56 | } 57 | 58 | Intent intentForPassingData = new Intent(); 59 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_LANGUAGE, selectedLanguage); 60 | 61 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 62 | 63 | dismiss(); 64 | } 65 | }; 66 | } 67 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/InterfaceSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import androidx.appcompat.app.AlertDialog; 4 | import android.app.Dialog; 5 | import android.content.DialogInterface; 6 | import android.content.Intent; 7 | import android.os.Bundle; 8 | import androidx.annotation.NonNull; 9 | 10 | public class InterfaceSelectDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private CommonAlertDialogFragment.Callback mCallbackTarget; 13 | 14 | public static InterfaceSelectDialogFragment newInstance(String tag) { 15 | InterfaceSelectDialogFragment dialogFragment = new InterfaceSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull Dialog onCreateDialog(Bundle savedInstanceState) { 31 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 32 | 33 | builder.setTitle("Select interface."); 34 | 35 | builder.setItems(new String[]{ 36 | "LAN", 37 | "Bluetooth", 38 | "USB", 39 | "All", 40 | "Manual"}, 41 | mOnInterfaceClickListener); 42 | 43 | setupNegativeButton(builder); 44 | 45 | mCallbackTarget = (CommonAlertDialogFragment.Callback) getParentFragment(); 46 | 47 | return builder.create(); 48 | } 49 | 50 | private DialogInterface.OnClickListener mOnInterfaceClickListener = new DialogInterface.OnClickListener() { 51 | @Override 52 | public void onClick(DialogInterface dialog, int which) { 53 | String[] selectedInterfaceArray; 54 | 55 | switch (which) { 56 | case 0: 57 | selectedInterfaceArray = new String[] {PrinterSettingConstant.IF_TYPE_ETHERNET}; 58 | break; 59 | case 1: 60 | selectedInterfaceArray = new String[] {PrinterSettingConstant.IF_TYPE_BLUETOOTH}; 61 | break; 62 | case 2: 63 | selectedInterfaceArray = new String[] {PrinterSettingConstant.IF_TYPE_USB}; 64 | break; 65 | case 3: 66 | default: 67 | selectedInterfaceArray = new String[] {PrinterSettingConstant.IF_TYPE_ETHERNET, PrinterSettingConstant.IF_TYPE_BLUETOOTH, PrinterSettingConstant.IF_TYPE_USB}; 68 | break; 69 | case 4: 70 | selectedInterfaceArray = new String[] {PrinterSettingConstant.IF_TYPE_MANUAL}; 71 | break; 72 | } 73 | 74 | Intent intentForPassingData = new Intent(); 75 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_INTERFACE, selectedInterfaceArray); 76 | 77 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 78 | 79 | dismiss(); 80 | } 81 | }; 82 | } 83 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/ItemListFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.os.Bundle; 4 | import androidx.annotation.Nullable; 5 | import androidx.fragment.app.Fragment; 6 | import androidx.core.content.ContextCompat; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.AdapterView; 11 | import android.widget.ArrayAdapter; 12 | import android.widget.CompoundButton; 13 | import android.widget.ListView; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | public class ItemListFragment extends CommonFragment implements ListView.OnItemClickListener, CompoundButton.OnCheckedChangeListener { 19 | 20 | protected List list; 21 | protected ArrayAdapter adapter; 22 | 23 | private ListView mListView; 24 | 25 | public ItemListFragment(){ 26 | } 27 | 28 | @Override 29 | public void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | 32 | list = new ArrayList<>(); 33 | 34 | adapter = new ItemListAdapter(getActivity(), list); 35 | } 36 | 37 | @Nullable 38 | @Override 39 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 40 | View rootView = inflater.inflate(R.layout.fragment_item_list, container, false); 41 | 42 | mListView = rootView.findViewById(R.id.commonListView); 43 | 44 | return rootView; 45 | } 46 | 47 | @Override 48 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 49 | super.onActivityCreated(savedInstanceState); 50 | 51 | // Set adapter 52 | mListView.setAdapter(adapter); 53 | 54 | mListView.setOnItemClickListener(this); 55 | 56 | mListView.setDivider(null); 57 | } 58 | 59 | @Override 60 | public void onItemClick(AdapterView parent, View view, int position, long id) { 61 | // do nothing 62 | } 63 | 64 | @Override 65 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 66 | // do nothing 67 | } 68 | 69 | protected void addTitle(String title) { 70 | List textList = new ArrayList<>(); 71 | 72 | textList.add(new TextInfo(title, R.id.menuTextView)); 73 | 74 | adapter.add(new ItemList(R.layout.list_main_title_row, textList, false)); 75 | } 76 | 77 | protected void addMenu(String title) { 78 | addMenu(title, true); 79 | } 80 | 81 | protected void addMenu(String title, boolean isClickable) { 82 | List textList = new ArrayList<>(); 83 | 84 | if (isClickable) { 85 | textList.add(new TextInfo(title, R.id.menuTextView)); 86 | } 87 | else { 88 | textList.add(new TextInfo(title, R.id.menuTextView, ContextCompat.getColor(getActivity(), R.color.disabled_text))); 89 | } 90 | 91 | adapter.add(new ItemList(R.layout.list_main_row, textList, isClickable)); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/ItemListInfo.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.widget.CompoundButton; 4 | 5 | class TextInfo { 6 | private static final int defaultTextColor = 0xFF4285F4; 7 | 8 | private final String mText; 9 | private final int mTextResourceID; 10 | private final int mAnimationResourceID; 11 | private final int mTextColor; 12 | private boolean mIsAnimated; 13 | private boolean mIsCustomTextColor; 14 | 15 | TextInfo(String text, int resourceID) { 16 | this(text, resourceID, defaultTextColor); 17 | mIsAnimated = false; 18 | mIsCustomTextColor = false; 19 | } 20 | 21 | TextInfo(String text, int resourceID, int textColor) { 22 | this(text, resourceID, 0, textColor); 23 | mIsAnimated = false; 24 | mIsCustomTextColor = true; 25 | } 26 | 27 | TextInfo(String text, int textResourceId, int animationResourceId, int textColor) { 28 | mText = text; 29 | mTextResourceID = textResourceId; 30 | mAnimationResourceID = animationResourceId; 31 | mTextColor = textColor; 32 | mIsAnimated = true; 33 | mIsCustomTextColor = true; 34 | } 35 | 36 | String getText() { 37 | return mText; 38 | } 39 | 40 | int getTextResourceID() { 41 | return mTextResourceID; 42 | } 43 | 44 | int getAnimationResourceID() { 45 | return mAnimationResourceID; 46 | } 47 | 48 | int getTextColor() { return mTextColor; } 49 | 50 | boolean isAnimated() { 51 | return mIsAnimated; 52 | } 53 | 54 | boolean isCustomTextColor() { 55 | return mIsCustomTextColor; 56 | } 57 | } 58 | 59 | class SwitchInfo { 60 | private boolean mIsChecked; 61 | private int mResourceID; 62 | private String mTag; 63 | private CompoundButton.OnCheckedChangeListener mListener; 64 | 65 | SwitchInfo(boolean isChecked, int resourceID, String tag, CompoundButton.OnCheckedChangeListener listener) { 66 | mIsChecked = isChecked; 67 | mResourceID = resourceID; 68 | mTag = tag; 69 | mListener = listener; 70 | } 71 | 72 | boolean isChecked() { 73 | return mIsChecked; 74 | } 75 | 76 | int getResourceID() { 77 | return mResourceID; 78 | } 79 | 80 | String getTag() { 81 | return mTag; 82 | } 83 | 84 | CompoundButton.OnCheckedChangeListener getListener() { 85 | return mListener; 86 | } 87 | } 88 | 89 | class ImgInfo { 90 | private int mImgResourceID; 91 | private int mResourceID; 92 | 93 | ImgInfo(int imgResourceID, int resourceID) { 94 | mImgResourceID = imgResourceID; 95 | mResourceID = resourceID; 96 | } 97 | 98 | int getImgResourceID() { 99 | return mImgResourceID; 100 | } 101 | 102 | int getResourceID() { 103 | return mResourceID; 104 | } 105 | } 106 | 107 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/JsonUtils.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | class JsonUtils { 11 | static String createJsonStringOfPrinterSettingList(List printerSettingList) { 12 | JSONArray jsonArray = new JSONArray(); 13 | 14 | try { 15 | for (PrinterSettings printerSettings : printerSettingList) { 16 | JSONObject jsonObject = new JSONObject(); 17 | 18 | jsonObject.put("ModelIndex", printerSettings.getModelIndex()); 19 | jsonObject.put("PortName", printerSettings.getPortName()); 20 | jsonObject.put("PortSettings", printerSettings.getPortSettings()); 21 | jsonObject.put("MACAddress", printerSettings.getMacAddress()); 22 | jsonObject.put("ModelName", printerSettings.getModelName()); 23 | jsonObject.put("CashDrawerOpenActiveHigh", printerSettings.getCashDrawerOpenActiveHigh()); 24 | jsonObject.put("PaperSize", printerSettings.getPaperSize()); 25 | 26 | jsonArray.put(jsonObject); 27 | } 28 | } catch (JSONException e) { 29 | // do nothing 30 | } 31 | 32 | return jsonArray.toString(); 33 | } 34 | 35 | static List createPrinterSettingListFromJsonString(String jsonString) { 36 | List printerSettingList = new ArrayList<>(); 37 | 38 | try { 39 | JSONArray jsonArray = new JSONArray(jsonString); 40 | 41 | for (int i = 0; i < jsonArray.length(); i++) { 42 | JSONObject jsonObject = jsonArray.getJSONObject(i); 43 | 44 | PrinterSettings printerSettings = new PrinterSettings( 45 | jsonObject.getInt("ModelIndex"), 46 | jsonObject.getString("PortName"), 47 | jsonObject.getString("PortSettings"), 48 | jsonObject.getString("MACAddress"), 49 | jsonObject.getString("ModelName"), 50 | jsonObject.getBoolean("CashDrawerOpenActiveHigh"), 51 | jsonObject.getInt("PaperSize")); 52 | 53 | printerSettingList.add(printerSettings); 54 | } 55 | } 56 | catch (JSONException e) { 57 | // do nothing 58 | } 59 | 60 | return printerSettingList; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/LabelTypeSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.appcompat.app.AlertDialog; 10 | 11 | public class LabelTypeSelectDialogFragment extends CommonAlertDialogFragment { 12 | 13 | private Callback mCallbackTarget; 14 | 15 | public static LabelTypeSelectDialogFragment newInstance(String tag) { 16 | LabelTypeSelectDialogFragment dialogFragment = new LabelTypeSelectDialogFragment(); 17 | 18 | Bundle args = new Bundle(); 19 | args.putString(DIALOG_TAG, tag); 20 | args.putBoolean(CANCEL, false); 21 | args.putBoolean(CALLBACK, true); 22 | args.putString(LABEL_NEGATIVE, "Cancel"); 23 | 24 | dialogFragment.setArguments(args); 25 | dialogFragment.setCancelable(false); 26 | 27 | return dialogFragment; 28 | } 29 | 30 | @Override 31 | public @NonNull 32 | Dialog onCreateDialog(Bundle savedInstanceState) { 33 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 34 | 35 | builder.setTitle("Select label type."); 36 | 37 | builder.setItems(new String[]{ 38 | "Invalid", 39 | "Valid", 40 | "Valid with Detection"}, 41 | mOnTypeClickListener); 42 | 43 | setupNegativeButton(builder); 44 | 45 | mCallbackTarget = (Callback) getParentFragment(); 46 | 47 | return builder.create(); 48 | } 49 | 50 | private DialogInterface.OnClickListener mOnTypeClickListener = new DialogInterface.OnClickListener() { 51 | @Override 52 | public void onClick(DialogInterface dialog, int which) { 53 | Intent intentForPassingData = new Intent(); 54 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_LABEL_TYPE_INDEX, which); 55 | 56 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 57 | 58 | dismiss(); 59 | } 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/LanguageSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class LanguageSelectDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static LanguageSelectDialogFragment newInstance(String tag) { 15 | LanguageSelectDialogFragment dialogFragment = new LanguageSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select language."); 35 | 36 | builder.setItems(new String[]{ 37 | "English", 38 | "Japanese", 39 | "French", 40 | "Portuguese", 41 | "Spanish", 42 | "German", 43 | "Russian", 44 | "Simplified Chinese", 45 | "Traditional Chinese", 46 | "UTF8 Multi language"}, 47 | mOnLanguageClickListener); 48 | 49 | setupNegativeButton(builder); 50 | 51 | mCallbackTarget = (CommonAlertDialogFragment.Callback) getParentFragment(); 52 | 53 | return builder.create(); 54 | } 55 | 56 | private DialogInterface.OnClickListener mOnLanguageClickListener = new DialogInterface.OnClickListener() { 57 | @Override 58 | public void onClick(DialogInterface dialog, int which) { 59 | int selectedLanguage = PrinterSettingConstant.LANGUAGE_ENGLISH; 60 | 61 | switch (which) { 62 | case 0: selectedLanguage = PrinterSettingConstant.LANGUAGE_ENGLISH; break; 63 | case 1: selectedLanguage = PrinterSettingConstant.LANGUAGE_JAPANESE; break; 64 | case 2: selectedLanguage = PrinterSettingConstant.LANGUAGE_FRENCH; break; 65 | case 3: selectedLanguage = PrinterSettingConstant.LANGUAGE_PORTUGUESE; break; 66 | case 4: selectedLanguage = PrinterSettingConstant.LANGUAGE_SPANISH; break; 67 | case 5: selectedLanguage = PrinterSettingConstant.LANGUAGE_GERMAN; break; 68 | case 6: selectedLanguage = PrinterSettingConstant.LANGUAGE_RUSSIAN; break; 69 | case 7: selectedLanguage = PrinterSettingConstant.LANGUAGE_SIMPLIFIED_CHINESE; break; 70 | case 8: selectedLanguage = PrinterSettingConstant.LANGUAGE_TRADITIONAL_CHINESE; break; 71 | case 9: selectedLanguage = PrinterSettingConstant.LANGUAGE_CJK_UNIFIED_IDEOGRAPH; break; 72 | } 73 | 74 | Intent intentForPassingData = new Intent(); 75 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_LANGUAGE, selectedLanguage); 76 | 77 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 78 | 79 | dismiss(); 80 | } 81 | }; 82 | } 83 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/LicenseDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.os.Bundle; 5 | import androidx.annotation.NonNull; 6 | import androidx.appcompat.app.AlertDialog; 7 | 8 | public class LicenseDialogFragment extends CommonAlertDialogFragment { 9 | 10 | public static LicenseDialogFragment newInstance(String tag) { 11 | LicenseDialogFragment dialogFragment = new LicenseDialogFragment(); 12 | 13 | Bundle args = new Bundle(); 14 | args.putString(DIALOG_TAG, tag); 15 | args.putBoolean(CANCEL, false); 16 | args.putBoolean(CALLBACK, true); 17 | args.putString(LABEL_POSITIVE, "OK"); 18 | 19 | dialogFragment.setArguments(args); 20 | dialogFragment.setCancelable(true); 21 | 22 | return dialogFragment; 23 | } 24 | 25 | @Override 26 | public @NonNull 27 | Dialog onCreateDialog(Bundle savedInstanceState) { 28 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 29 | 30 | builder.setTitle("Open Source License"); 31 | 32 | builder.setMessage( 33 | "This application contains deliverables distributed under license of Apache License, Version 2.0 (" + 34 | "http://www.apache.org/licenses/LICENSE-2.0).\n" + 35 | "\n" + 36 | "Notices for libraries:\n" + 37 | "[ZXing]\n" + 38 | "------------------------------\n" + 39 | "NOTICES FOR BARCODE 4J\n" + 40 | "------------------------------\n" + 41 | "\n" + 42 | "Barcode 4J\n" + 43 | "Copyright 2002-2010 Jeremias Märki\n" + 44 | "Copyright 2005-2006 Dietmar Bürkle\n" + 45 | "\n" + 46 | "Portions of this software were contributed under section 5 of the\n" + 47 | "Apache License. Contributors are listed under:\n" + 48 | "http://barcode4j.sourceforge.net/contributors.html\n" + 49 | "\n" + 50 | "------------------------------\n" + 51 | "NOTICES FOR JCOMMANDER\n" + 52 | "------------------------------\n" + 53 | "\n" + 54 | "Copyright 2010 Cedric Beust cedric@beust.com"); 55 | 56 | setupPositiveButton(builder); 57 | 58 | return builder.create(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.os.Bundle; 4 | import android.view.KeyEvent; 5 | 6 | import androidx.core.view.WindowCompat; 7 | 8 | @SuppressWarnings("SimplifiableIfStatement") 9 | public class MainActivity extends CommonActivity { 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | 14 | setContentView(R.layout.activity_main); 15 | } 16 | 17 | public boolean onKeyDown(int keyCode, KeyEvent event) { 18 | if (keyCode != KeyEvent.KEYCODE_BACK) { // Do not close MainActivity. 19 | return super.onKeyDown(keyCode, event); 20 | } 21 | else { 22 | return false; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/ModelConfirmDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class ModelConfirmDialogFragment extends CommonAlertDialogFragment { 11 | 12 | public static ModelConfirmDialogFragment newInstance(String tag, int model) { 13 | ModelConfirmDialogFragment dialogFragment = new ModelConfirmDialogFragment(); 14 | 15 | Bundle args = new Bundle(); 16 | args.putString(DIALOG_TAG, tag); 17 | args.putBoolean(CANCEL, false); 18 | args.putBoolean(CALLBACK, true); 19 | args.putString(LABEL_POSITIVE, "Yes"); 20 | args.putString(LABEL_NEGATIVE, "No"); 21 | args.putInt(CommonActivity.BUNDLE_KEY_MODEL_INDEX, model); 22 | 23 | dialogFragment.setArguments(args); 24 | 25 | return dialogFragment; 26 | } 27 | 28 | @Override 29 | public @NonNull 30 | Dialog onCreateDialog(Bundle savedInstanceState) { 31 | final Bundle args = getArguments(); 32 | 33 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 34 | 35 | String modelTitle = ModelCapability.getModelTitle(getArguments().getInt(CommonActivity.BUNDLE_KEY_MODEL_INDEX)); 36 | 37 | builder.setTitle("Confirm."); 38 | builder.setMessage("Is your printer " + modelTitle + " ?"); 39 | 40 | builder.setPositiveButton(args.getString(LABEL_POSITIVE), new DialogInterface.OnClickListener() { 41 | @Override 42 | public void onClick(DialogInterface dialog, int which) { 43 | Intent intentForPassingData = new Intent(); 44 | intentForPassingData.putExtra(LABEL_POSITIVE, LABEL_POSITIVE); 45 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_MODEL_INDEX, args.getInt(CommonActivity.BUNDLE_KEY_MODEL_INDEX)); 46 | 47 | callbackToTarget(args.getString(DIALOG_TAG), intentForPassingData); 48 | 49 | dialog.dismiss(); 50 | } 51 | }); 52 | 53 | builder.setNegativeButton(args.getString(LABEL_NEGATIVE), new DialogInterface.OnClickListener() { 54 | @Override 55 | public void onClick(DialogInterface dialog, int which) { 56 | Intent intentForPassingData = new Intent(); 57 | intentForPassingData.putExtra(LABEL_NEGATIVE, LABEL_NEGATIVE); 58 | 59 | callbackToTarget(args.getString(DIALOG_TAG), intentForPassingData); 60 | 61 | dialog.dismiss(); 62 | } 63 | }); 64 | 65 | return builder.create(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/ModelSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class ModelSelectDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static ModelSelectDialogFragment newInstance(String tag) { 15 | ModelSelectDialogFragment dialogFragment = new ModelSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | 25 | return dialogFragment; 26 | } 27 | 28 | @Override 29 | public @NonNull 30 | Dialog onCreateDialog(Bundle savedInstanceState) { 31 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 32 | 33 | builder.setTitle("Confirm. What is your printer?"); 34 | 35 | builder.setItems(new String[]{ 36 | "mC-Print2", 37 | "mC-Print3", 38 | "mC-Label2", 39 | "mC-Label3", 40 | "mPOP", 41 | "FVP10", 42 | "TSP100", 43 | "TSP100IV", 44 | "TSP650II", 45 | "TSP700II", 46 | "TSP800II", 47 | "TUP500", 48 | "SP700", 49 | "SM-S210i", 50 | "SM-S220i", 51 | "SM-S230i", 52 | "SM-T300i/T300", 53 | "SM-T400i", 54 | "SM-L200", 55 | "SM-L300", 56 | "BSC10", 57 | "BSC10II", 58 | "SM-S210i StarPRNT", 59 | "SM-S220i StarPRNT", 60 | "SM-S230i StarPRNT", 61 | "SM-T300i/T300 StarPRNT", 62 | "SM-T400i StarPRNT", 63 | "SK1-211/221/V211", 64 | "SK1-211/221/V211 Presenter", 65 | "SK1-311/321/V311", 66 | "SK1-311/V311 Presenter"}, 67 | mOnModelClickListener); 68 | 69 | setupNegativeButton(builder); 70 | 71 | mCallbackTarget = (Callback) getParentFragment(); 72 | 73 | return builder.create(); 74 | } 75 | 76 | private DialogInterface.OnClickListener mOnModelClickListener = new DialogInterface.OnClickListener() { 77 | @Override 78 | public void onClick(DialogInterface dialog, int which) { 79 | int model = ModelCapability.NONE; 80 | 81 | switch (which) { 82 | case 0: model = ModelCapability.MC_PRINT2; break; 83 | case 1: model = ModelCapability.MC_PRINT3; break; 84 | case 2: model = ModelCapability.MC_LABEL2; break; 85 | case 3: model = ModelCapability.MC_LABEL3; break; 86 | case 4: model = ModelCapability.MPOP; break; 87 | case 5: model = ModelCapability.FVP10; break; 88 | case 6: model = ModelCapability.TSP100; break; 89 | case 7: model = ModelCapability.TSP100IV; break; 90 | case 8: model = ModelCapability.TSP650II; break; 91 | case 9: model = ModelCapability.TSP700II; break; 92 | case 10: model = ModelCapability.TSP800II; break; 93 | case 11: model = ModelCapability.TUP500; break; 94 | case 12: model = ModelCapability.SP700; break; 95 | case 13: model = ModelCapability.SM_S210I; break; 96 | case 14: model = ModelCapability.SM_S220I; break; 97 | case 15: model = ModelCapability.SM_S230I; break; 98 | case 16: model = ModelCapability.SM_T300I_T300; break; 99 | case 17: model = ModelCapability.SM_T400I; break; 100 | case 18: model = ModelCapability.SM_L200; break; 101 | case 19: model = ModelCapability.SM_L300; break; 102 | case 20: model = ModelCapability.BSC10; break; 103 | case 21: model = ModelCapability.BSC10II; break; 104 | case 22: model = ModelCapability.SM_S210I_StarPRNT; break; 105 | case 23: model = ModelCapability.SM_S220I_StarPRNT; break; 106 | case 24: model = ModelCapability.SM_S230I_StarPRNT; break; 107 | case 25: model = ModelCapability.SM_T300I_T300_StarPRNT; break; 108 | case 26: model = ModelCapability.SM_T400I_StarPRNT; break; 109 | case 27: model = ModelCapability.SK1_211_221_V211; break; 110 | case 28: model = ModelCapability.SK1_211_221_V211_Presenter; break; 111 | case 29: model = ModelCapability.SK1_311_321_V311; break; 112 | case 30: model = ModelCapability.SK1_311_V311_Presenter; break; 113 | } 114 | 115 | Intent intentForPassingData = new Intent(); 116 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_MODEL_INDEX, model); 117 | 118 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 119 | 120 | dismiss(); 121 | } 122 | }; 123 | } 124 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/PaperSizeSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class PaperSizeSelectDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private CommonAlertDialogFragment.Callback mCallbackTarget; 13 | 14 | public static PaperSizeSelectDialogFragment newInstance(String tag) { 15 | PaperSizeSelectDialogFragment dialogFragment = new PaperSizeSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select paper size."); 35 | 36 | builder.setItems(new String[]{ 37 | "2\" (384dots)", 38 | "3\" (576dots)", 39 | "4\" (832dots)"}, 40 | mOnPaperSizeClickListener); 41 | 42 | setupNegativeButton(builder); 43 | 44 | mCallbackTarget = (CommonAlertDialogFragment.Callback) getParentFragment(); 45 | 46 | return builder.create(); 47 | } 48 | 49 | private DialogInterface.OnClickListener mOnPaperSizeClickListener = new DialogInterface.OnClickListener() { 50 | @Override 51 | public void onClick(DialogInterface dialog, int which) { 52 | int selectedPaperSize = PrinterSettingConstant.PAPER_SIZE_THREE_INCH; 53 | 54 | switch (which) { 55 | case 0: selectedPaperSize = PrinterSettingConstant.PAPER_SIZE_TWO_INCH; break; 56 | case 1: selectedPaperSize = PrinterSettingConstant.PAPER_SIZE_THREE_INCH; break; 57 | case 2: selectedPaperSize = PrinterSettingConstant.PAPER_SIZE_FOUR_INCH; break; 58 | } 59 | 60 | Intent intentForPassingData = new Intent(); 61 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_PAPER_SIZE, selectedPaperSize); 62 | 63 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 64 | 65 | dismiss(); 66 | } 67 | }; 68 | } 69 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/PortNameDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.content.Intent; 4 | import androidx.appcompat.app.AlertDialog; 5 | import android.app.Dialog; 6 | import android.content.DialogInterface; 7 | import android.os.Bundle; 8 | import androidx.annotation.NonNull; 9 | import android.text.InputType; 10 | import android.widget.EditText; 11 | 12 | public class PortNameDialogFragment extends CommonAlertDialogFragment { 13 | 14 | public PortNameDialogFragment() { 15 | // Required empty public constructor 16 | } 17 | 18 | public static PortNameDialogFragment newInstance(String tag, String portName) { 19 | PortNameDialogFragment dialogFragment = new PortNameDialogFragment(); 20 | 21 | Bundle args = new Bundle(); 22 | args.putString(DIALOG_TAG, tag); 23 | args.putBoolean(CANCEL, false); 24 | args.putBoolean(CALLBACK, true); 25 | args.putString(LABEL_POSITIVE, "OK"); 26 | args.putString(LABEL_NEGATIVE, "Cancel"); 27 | args.putString(CommonActivity.BUNDLE_KEY_PORT_NAME, portName); 28 | 29 | dialogFragment.setArguments(args); 30 | dialogFragment.setCancelable(false); 31 | 32 | return dialogFragment; 33 | } 34 | 35 | @NonNull 36 | @Override 37 | public Dialog onCreateDialog(Bundle savedInstanceState) { 38 | final Bundle args = getArguments(); 39 | 40 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 41 | 42 | builder.setTitle("Please enter the port name."); 43 | 44 | setupNegativeButton(builder); 45 | 46 | final EditText editText = new EditText(getActivity()); 47 | editText.setInputType(InputType.TYPE_CLASS_TEXT); 48 | editText.setText(args.getString(CommonActivity.BUNDLE_KEY_PORT_NAME)); 49 | 50 | builder.setView(editText); 51 | 52 | builder.setPositiveButton(args.getString(LABEL_POSITIVE), new DialogInterface.OnClickListener() { 53 | @Override 54 | public void onClick(DialogInterface dialog, int which) { 55 | Intent intentForPassingData = new Intent(); 56 | intentForPassingData.putExtra(LABEL_POSITIVE, LABEL_POSITIVE); 57 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_PORT_NAME, editText.getText().toString()); 58 | 59 | callbackToTarget(args.getString(DIALOG_TAG), intentForPassingData); 60 | 61 | dialog.dismiss(); 62 | } 63 | }); 64 | 65 | return builder.create(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/PortSettingsDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | import android.text.InputType; 10 | import android.widget.EditText; 11 | 12 | public class PortSettingsDialogFragment extends CommonAlertDialogFragment { 13 | 14 | public PortSettingsDialogFragment() { 15 | // Required empty public constructor 16 | } 17 | 18 | public static PortSettingsDialogFragment newInstance(String tag, String portSettings) { 19 | PortSettingsDialogFragment dialogFragment = new PortSettingsDialogFragment(); 20 | 21 | Bundle args = new Bundle(); 22 | args.putString(DIALOG_TAG, tag); 23 | args.putBoolean(CANCEL, false); 24 | args.putBoolean(CALLBACK, true); 25 | args.putString(LABEL_POSITIVE, "OK"); 26 | args.putString(LABEL_NEGATIVE, "Cancel"); 27 | args.putString(CommonActivity.BUNDLE_KEY_PORT_SETTINGS, portSettings); 28 | 29 | dialogFragment.setArguments(args); 30 | dialogFragment.setCancelable(false); 31 | 32 | return dialogFragment; 33 | } 34 | 35 | @NonNull 36 | @Override 37 | public Dialog onCreateDialog(Bundle savedInstanceState) { 38 | final Bundle args = getArguments(); 39 | 40 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 41 | 42 | builder.setTitle("Please enter the port settings."); 43 | 44 | setupNegativeButton(builder); 45 | 46 | final EditText editText = new EditText(getActivity()); 47 | editText.setInputType(InputType.TYPE_CLASS_TEXT); 48 | editText.setText(args.getString(CommonActivity.BUNDLE_KEY_PORT_SETTINGS)); 49 | 50 | builder.setView(editText); 51 | 52 | builder.setPositiveButton(args.getString(LABEL_POSITIVE), new DialogInterface.OnClickListener() { 53 | @Override 54 | public void onClick(DialogInterface dialog, int which) { 55 | Intent intentForPassingData = new Intent(); 56 | intentForPassingData.putExtra(LABEL_POSITIVE, LABEL_POSITIVE); 57 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_PORT_SETTINGS, editText.getText().toString()); 58 | 59 | callbackToTarget(args.getString(DIALOG_TAG), intentForPassingData); 60 | 61 | dialog.dismiss(); 62 | } 63 | }); 64 | 65 | return builder.create(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/PrintableAreaTypeSelectDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.Dialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | 10 | public class PrintableAreaTypeSelectDialogFragment extends CommonAlertDialogFragment { 11 | 12 | private Callback mCallbackTarget; 13 | 14 | public static PrintableAreaTypeSelectDialogFragment newInstance(String tag) { 15 | PrintableAreaTypeSelectDialogFragment dialogFragment = new PrintableAreaTypeSelectDialogFragment(); 16 | 17 | Bundle args = new Bundle(); 18 | args.putString(DIALOG_TAG, tag); 19 | args.putBoolean(CANCEL, false); 20 | args.putBoolean(CALLBACK, true); 21 | args.putString(LABEL_NEGATIVE, "Cancel"); 22 | 23 | dialogFragment.setArguments(args); 24 | dialogFragment.setCancelable(false); 25 | 26 | return dialogFragment; 27 | } 28 | 29 | @Override 30 | public @NonNull 31 | Dialog onCreateDialog(Bundle savedInstanceState) { 32 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 33 | 34 | builder.setTitle("Select printable area type."); 35 | 36 | builder.setItems(new String[]{ 37 | "Standard", 38 | "Type1", 39 | "Type2", 40 | "Type3", 41 | "Type4"}, 42 | mOnTypeClickListener); 43 | 44 | setupNegativeButton(builder); 45 | 46 | mCallbackTarget = (Callback) getParentFragment(); 47 | 48 | return builder.create(); 49 | } 50 | 51 | private DialogInterface.OnClickListener mOnTypeClickListener = new DialogInterface.OnClickListener() { 52 | @Override 53 | public void onClick(DialogInterface dialog, int which) { 54 | Intent intentForPassingData = new Intent(); 55 | intentForPassingData.putExtra(CommonActivity.BUNDLE_KEY_PRINTABLE_AREA_TYPE_INDEX, which); 56 | 57 | mCallbackTarget.onDialogResult(getArguments().getString(DIALOG_TAG), intentForPassingData); 58 | 59 | dismiss(); 60 | } 61 | }; 62 | } 63 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/PrinterSettingConstant.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | public class PrinterSettingConstant { 4 | public static final int LANGUAGE_ENGLISH = 0; 5 | public static final int LANGUAGE_JAPANESE = 1; 6 | public static final int LANGUAGE_FRENCH = 2; 7 | public static final int LANGUAGE_PORTUGUESE = 3; 8 | public static final int LANGUAGE_SPANISH = 4; 9 | public static final int LANGUAGE_GERMAN = 5; 10 | public static final int LANGUAGE_RUSSIAN = 6; 11 | public static final int LANGUAGE_SIMPLIFIED_CHINESE = 7; 12 | public static final int LANGUAGE_TRADITIONAL_CHINESE = 8; 13 | public static final int LANGUAGE_CJK_UNIFIED_IDEOGRAPH = 9; 14 | 15 | public static final int PAPER_SIZE_TWO_INCH = 384; 16 | public static final int PAPER_SIZE_THREE_INCH = 576; 17 | public static final int PAPER_SIZE_FOUR_INCH = 832; 18 | public static final int PAPER_SIZE_ESCPOS_THREE_INCH = 512; 19 | public static final int PAPER_SIZE_DOT_THREE_INCH = 210; 20 | public static final int PAPER_SIZE_SK1_TWO_INCH = 432; 21 | 22 | public static final String IF_TYPE_ETHERNET = "TCP:"; 23 | public static final String IF_TYPE_BLUETOOTH = "BT:"; 24 | public static final String IF_TYPE_USB = "USB:"; 25 | public static final String IF_TYPE_MANUAL = "Manual:"; 26 | } 27 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/PrinterSettingManager.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.preference.PreferenceManager; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Printer information manager class. 11 | */ 12 | @SuppressWarnings({"unused", "WeakerAccess"}) 13 | public class PrinterSettingManager { 14 | 15 | public static final String PREF_KEY_PRINTER_SETTINGS_JSON = "pref_key_printer_settings_json"; 16 | 17 | private Context mContext; 18 | private List mPrinterSettingsList; 19 | 20 | PrinterSettingManager(Context context) { 21 | mContext = context; 22 | 23 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); 24 | 25 | if (!prefs.contains(PREF_KEY_PRINTER_SETTINGS_JSON)) { 26 | prefs.edit() 27 | .clear() 28 | .apply(); 29 | } 30 | 31 | mPrinterSettingsList = JsonUtils.createPrinterSettingListFromJsonString(prefs.getString(PREF_KEY_PRINTER_SETTINGS_JSON, "")); 32 | } 33 | 34 | public void storePrinterSettings(int index, PrinterSettings settings) { 35 | if (mPrinterSettingsList.size() > 1) { 36 | mPrinterSettingsList.remove(index); 37 | } 38 | 39 | mPrinterSettingsList.add(index, settings); 40 | 41 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); 42 | 43 | prefs.edit() 44 | .putString(PREF_KEY_PRINTER_SETTINGS_JSON, JsonUtils.createJsonStringOfPrinterSettingList(mPrinterSettingsList)) 45 | .apply(); 46 | } 47 | 48 | public PrinterSettings getPrinterSettings() { 49 | if (mPrinterSettingsList.isEmpty()) { 50 | return null; 51 | } 52 | 53 | return mPrinterSettingsList.get(0); 54 | } 55 | 56 | public PrinterSettings getPrinterSettings(int index) { 57 | if (mPrinterSettingsList.isEmpty() || (mPrinterSettingsList.size() - 1) < index) { 58 | return null; 59 | } 60 | 61 | return mPrinterSettingsList.get(index); 62 | } 63 | 64 | public List getPrinterSettingsList() { 65 | return mPrinterSettingsList; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/PrinterSettings.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | public class PrinterSettings { 6 | private int mModelIndex; 7 | private String mPortName; 8 | private String mPortSettings; 9 | private String mMacAddress; 10 | private String mModelName; 11 | private boolean mCashDrawerOpenActiveHigh; 12 | private int mPaperSize; 13 | 14 | public PrinterSettings(int modelIndex, @NonNull String portName, @NonNull String portSettings, @NonNull String macAddress, @NonNull String modelName, boolean cashDrawerOpenActiveHigh, int paperSize) { 15 | mModelIndex = modelIndex; 16 | mPortName = portName; 17 | mPortSettings = portSettings; 18 | mMacAddress = macAddress; 19 | mModelName = modelName; 20 | mCashDrawerOpenActiveHigh = cashDrawerOpenActiveHigh; 21 | mPaperSize = paperSize; 22 | } 23 | 24 | public int getModelIndex() { 25 | return mModelIndex; 26 | } 27 | 28 | public String getPortName() { 29 | return mPortName; 30 | } 31 | 32 | public String getPortSettings() { 33 | return mPortSettings; 34 | } 35 | 36 | public String getMacAddress() { 37 | return mMacAddress; 38 | } 39 | 40 | public String getModelName() { 41 | return mModelName; 42 | } 43 | 44 | public boolean getCashDrawerOpenActiveHigh() { 45 | return mCashDrawerOpenActiveHigh; 46 | } 47 | 48 | public int getPaperSize() { 49 | return mPaperSize; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/SerialNumberDialogFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | 4 | import android.app.Dialog; 5 | import android.app.ProgressDialog; 6 | import android.os.Bundle; 7 | import androidx.annotation.NonNull; 8 | import androidx.appcompat.app.AlertDialog; 9 | import android.view.View; 10 | import android.widget.TextView; 11 | 12 | import com.starmicronics.starprntsdk.Communication.CommunicationResult; 13 | import com.starmicronics.starprntsdk.Communication.Result; 14 | 15 | public class SerialNumberDialogFragment extends CommonAlertDialogFragment { 16 | 17 | private TextView mSerialNumberTextView; 18 | 19 | private ProgressDialog mProgressDialog; 20 | 21 | private boolean mIsFirst = true; 22 | private boolean mIsForeground; 23 | 24 | public static SerialNumberDialogFragment newInstance(String tag) { 25 | SerialNumberDialogFragment dialogFragment = new SerialNumberDialogFragment(); 26 | 27 | Bundle args = new Bundle(); 28 | args.putString(DIALOG_TAG, tag); 29 | args.putBoolean(CANCEL, false); 30 | args.putBoolean(CALLBACK, false); 31 | 32 | dialogFragment.setArguments(args); 33 | dialogFragment.setCancelable(false); 34 | 35 | dialogFragment.setPositiveButton("OK"); 36 | 37 | return dialogFragment; 38 | } 39 | 40 | @Override 41 | public @NonNull 42 | Dialog onCreateDialog(Bundle savedInstanceState) { 43 | mProgressDialog = new ProgressDialog(getActivity()); 44 | 45 | mProgressDialog.setMessage("Communicating..."); 46 | mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 47 | mProgressDialog.setCancelable(false); 48 | 49 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 50 | 51 | View dialogView = View.inflate(getActivity(), R.layout.dialog_serial_number, null); 52 | 53 | builder.setTitle("Product Serial Number"); 54 | 55 | builder.setView(dialogView); 56 | 57 | mSerialNumberTextView = dialogView.findViewById(R.id.serialNumberTextView); 58 | 59 | setupPositiveButton(builder); 60 | 61 | return builder.create(); 62 | } 63 | 64 | @Override 65 | public void onStart() { 66 | super.onStart(); 67 | 68 | if (mIsFirst) { 69 | mProgressDialog.show(); 70 | 71 | PrinterSettingManager settingManager = new PrinterSettingManager(getActivity()); 72 | PrinterSettings settings = settingManager.getPrinterSettings(); 73 | 74 | Communication.getSerialNumber(SerialNumberDialogFragment.class, settings.getPortName(), settings.getPortSettings(), 10000, getActivity(), mCallback); 75 | } 76 | } 77 | 78 | @Override 79 | public void onResume() { 80 | super.onResume(); 81 | 82 | mIsForeground = true; 83 | } 84 | 85 | @Override 86 | public void onPause() { 87 | super.onPause(); 88 | 89 | mIsForeground = false; 90 | 91 | if (mProgressDialog != null) { 92 | mProgressDialog.dismiss(); 93 | } 94 | } 95 | 96 | final Communication.SerialNumberCallback mCallback = new Communication.SerialNumberCallback() { 97 | @Override 98 | public void onSerialNumber(CommunicationResult communicationResult, String serialNumber) { 99 | if (!mIsForeground) { 100 | return; 101 | } 102 | 103 | if (mProgressDialog != null) { 104 | mProgressDialog.dismiss(); 105 | } 106 | 107 | mIsFirst = false; 108 | 109 | if (communicationResult.getResult() == Result.Success) { 110 | mSerialNumberTextView.setText(serialNumber); 111 | } 112 | else { 113 | mSerialNumberTextView.setText(Communication.getCommunicationResultMessage(communicationResult)); 114 | } 115 | } 116 | }; 117 | } 118 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/TitleActivity.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.os.Bundle; 4 | import androidx.appcompat.app.AppCompatActivity; 5 | 6 | public class TitleActivity extends AppCompatActivity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | 12 | setContentView(R.layout.activity_title); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/TitleFragment.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.pm.PackageInfo; 6 | import android.content.pm.PackageManager; 7 | import android.os.Bundle; 8 | import android.app.Fragment; 9 | import android.os.Handler; 10 | import android.view.LayoutInflater; 11 | import android.view.View; 12 | import android.view.ViewGroup; 13 | 14 | import java.util.Timer; 15 | import java.util.TimerTask; 16 | 17 | public class TitleFragment extends CommonFragment { 18 | Timer mTimer; 19 | 20 | public TitleFragment() { 21 | // Required empty public constructor 22 | } 23 | 24 | @Override 25 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 26 | return inflater.inflate(R.layout.fragment_title, container, false); 27 | } 28 | 29 | @Override 30 | public void onResume() { 31 | super.onResume(); 32 | 33 | final Handler handler = new Handler(); 34 | 35 | TimerTask task = new TimerTask(){ 36 | @Override 37 | public void run() { 38 | handler.post(new Runnable() { 39 | @Override 40 | public void run() { 41 | startMainActivity(); 42 | } 43 | }); 44 | } 45 | }; 46 | 47 | mTimer = new Timer(); 48 | mTimer.schedule(task, 1500); 49 | } 50 | 51 | @Override 52 | public void onPause() { 53 | super.onPause(); 54 | mTimer.cancel(); 55 | } 56 | 57 | private void startMainActivity() { 58 | Intent intent = new Intent(getActivity(), MainActivity.class); 59 | intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); 60 | intent.putExtra(CommonActivity.BUNDLE_KEY_TOOLBAR_TITLE, getString(R.string.app_name) + " Ver." + getVersionName(getActivity())); 61 | intent.putExtra(CommonActivity.BUNDLE_KEY_SHOW_INFO_BUTTON, true); 62 | 63 | startActivity(intent); 64 | } 65 | 66 | private static String getVersionName(Context context) { 67 | String versionName = ""; 68 | 69 | try { 70 | PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); 71 | versionName = packageInfo.versionName; 72 | } 73 | catch (PackageManager.NameNotFoundException e) { 74 | // do nothing 75 | } 76 | 77 | return versionName; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/UsbAttachedActivity.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk; 2 | 3 | import android.app.ActivityManager; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.annotation.Nullable; 10 | import androidx.appcompat.app.AppCompatActivity; 11 | 12 | import java.util.List; 13 | 14 | public class UsbAttachedActivity extends AppCompatActivity { 15 | private static final String BUNDLE_KEY_SAVED_INSTANCE = "bundle_key_saved_instance"; 16 | 17 | private boolean mIsExecuted; 18 | 19 | @Override 20 | protected void onCreate(@Nullable Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | 23 | if(savedInstanceState != null) { 24 | mIsExecuted = savedInstanceState.containsKey(BUNDLE_KEY_SAVED_INSTANCE); 25 | } 26 | 27 | if (!mIsExecuted) { 28 | ActivityManager activityManager = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); 29 | List tasks = activityManager.getAppTasks(); 30 | ActivityManager.RecentTaskInfo taskInfo = tasks.get(0).getTaskInfo(); 31 | Intent baseIntent = taskInfo.baseIntent; 32 | 33 | if (baseIntent.getComponent().getClassName().equals(this.getComponentName().getClassName())) { 34 | Intent intent = new Intent(getApplicationContext(), MainActivity.class); 35 | 36 | intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); 37 | intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY); 38 | intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); 39 | 40 | startActivity(intent); 41 | mIsExecuted = true; 42 | } else { 43 | finish(); 44 | } 45 | } 46 | } 47 | 48 | @Override 49 | protected void onSaveInstanceState(@NonNull Bundle outState) { 50 | super.onSaveInstanceState(outState); 51 | 52 | outState.putBoolean(BUNDLE_KEY_SAVED_INSTANCE, mIsExecuted); 53 | } 54 | 55 | @Override 56 | protected void onResume() { 57 | super.onResume(); 58 | 59 | if (mIsExecuted) { 60 | finish(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/functions/CashDrawerFunctions.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk.functions; 2 | 3 | 4 | import com.starmicronics.starioextension.ICommandBuilder; 5 | import com.starmicronics.starioextension.StarIoExt; 6 | import com.starmicronics.starioextension.StarIoExt.Emulation; 7 | 8 | import static com.starmicronics.starioextension.ICommandBuilder.PeripheralChannel; 9 | 10 | public class CashDrawerFunctions { 11 | public static byte[] createData(Emulation emulation, PeripheralChannel channel) { 12 | ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); 13 | 14 | builder.beginDocument(); 15 | 16 | builder.appendPeripheral(channel); 17 | 18 | builder.endDocument(); 19 | 20 | return builder.getCommands(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/functions/CombinationFunctions.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk.functions; 2 | 3 | import android.content.res.Resources; 4 | import android.graphics.Bitmap; 5 | 6 | import com.starmicronics.starioextension.ICommandBuilder; 7 | import com.starmicronics.starioextension.StarIoExt; 8 | import com.starmicronics.starprntsdk.localizereceipts.ILocalizeReceipts; 9 | 10 | import static com.starmicronics.starioextension.StarIoExt.Emulation; 11 | import static com.starmicronics.starioextension.ICommandBuilder.BitmapConverterRotation; 12 | import static com.starmicronics.starioextension.ICommandBuilder.CutPaperAction; 13 | import static com.starmicronics.starioextension.ICommandBuilder.PeripheralChannel; 14 | 15 | public class CombinationFunctions { 16 | 17 | public static byte[] createTextReceiptData(Emulation emulation, ILocalizeReceipts localizeReceipts, boolean utf8) { 18 | ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); 19 | 20 | builder.beginDocument(); 21 | 22 | localizeReceipts.appendTextReceiptData(builder, utf8); 23 | 24 | builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); 25 | 26 | builder.appendPeripheral(PeripheralChannel.No1); 27 | 28 | builder.endDocument(); 29 | 30 | return builder.getCommands(); 31 | } 32 | 33 | public static byte[] createRasterReceiptData(Emulation emulation, ILocalizeReceipts localizeReceipts, Resources resources) { 34 | ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); 35 | 36 | builder.beginDocument(); 37 | 38 | Bitmap image = localizeReceipts.createRasterReceiptImage(resources); 39 | 40 | builder.appendBitmap(image, false); 41 | 42 | builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); 43 | 44 | builder.appendPeripheral(PeripheralChannel.No1); 45 | 46 | builder.endDocument(); 47 | 48 | return builder.getCommands(); 49 | } 50 | 51 | public static byte[] createScaleRasterReceiptData(Emulation emulation, ILocalizeReceipts localizeReceipts, Resources resources, int width, boolean bothScale) { 52 | ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); 53 | 54 | builder.beginDocument(); 55 | 56 | Bitmap image = localizeReceipts.createScaleRasterReceiptImage(resources); 57 | 58 | builder.appendBitmap(image, false, width, bothScale); 59 | 60 | builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); 61 | 62 | builder.appendPeripheral(PeripheralChannel.No1); 63 | 64 | builder.endDocument(); 65 | 66 | return builder.getCommands(); 67 | } 68 | 69 | public static byte[] createCouponData(Emulation emulation, ILocalizeReceipts localizeReceipts, Resources resources, int width, BitmapConverterRotation rotation) { 70 | ICommandBuilder builder = StarIoExt.createCommandBuilder(emulation); 71 | 72 | builder.beginDocument(); 73 | 74 | Bitmap image = localizeReceipts.createCouponImage(resources); 75 | 76 | builder.appendBitmap(image, false, width, true, rotation); 77 | 78 | builder.appendCutPaper(CutPaperAction.PartialCutWithFeed); 79 | 80 | builder.appendPeripheral(PeripheralChannel.No1); 81 | 82 | builder.endDocument(); 83 | 84 | return builder.getCommands(); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/functions/MelodySpeakerFunctions.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk.functions; 2 | 3 | import android.content.Context; 4 | import android.net.Uri; 5 | 6 | import com.starmicronics.starioextension.IMelodySpeakerCommandBuilder; 7 | import com.starmicronics.starioextension.IMelodySpeakerCommandBuilder.SoundStorageArea; 8 | import com.starmicronics.starioextension.SoundSetting; 9 | import com.starmicronics.starioextension.StarIoExt; 10 | import com.starmicronics.starioextension.StarIoExt.MelodySpeakerModel; 11 | 12 | import java.io.ByteArrayOutputStream; 13 | import java.io.IOException; 14 | import java.io.InputStream; 15 | 16 | public class MelodySpeakerFunctions { 17 | public static byte[] createPlayingRegisteredSound(MelodySpeakerModel model, SoundStorageArea soundStorageArea, boolean specifySound, int soundNumber, boolean specifyVolume, int volume) { 18 | IMelodySpeakerCommandBuilder builder = StarIoExt.createMelodySpeakerCommandBuilder(model); 19 | 20 | SoundSetting setting = new SoundSetting(); 21 | 22 | if (specifySound) { 23 | setting.setSoundStorageArea(soundStorageArea); 24 | setting.setSoundNumber(soundNumber); 25 | } 26 | 27 | if (specifyVolume) { 28 | setting.setVolume(volume); 29 | } 30 | 31 | builder.appendSound(setting); 32 | 33 | return builder.getCommands(); 34 | } 35 | 36 | public static byte[] createPlayingReceivedData(MelodySpeakerModel model, Uri uri, boolean specifyVolume, int volume, Context context) { 37 | InputStream inputStream = null; 38 | byte[] soundData; 39 | 40 | try { 41 | inputStream = context.getContentResolver().openInputStream(uri); 42 | 43 | byte[] buffer = new byte[1024]; 44 | 45 | int bytesRead; 46 | 47 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); 48 | 49 | while ((bytesRead = inputStream.read(buffer)) != -1) { 50 | outputStream.write(buffer, 0, bytesRead); 51 | } 52 | 53 | soundData = outputStream.toByteArray(); 54 | 55 | inputStream.close(); 56 | } 57 | catch (IOException e) { 58 | if (inputStream != null) { 59 | try { 60 | inputStream.close(); 61 | } 62 | catch (IOException e1) { 63 | // do nothing 64 | } 65 | } 66 | 67 | return null; 68 | } 69 | 70 | IMelodySpeakerCommandBuilder builder = StarIoExt.createMelodySpeakerCommandBuilder(model); 71 | 72 | SoundSetting setting = new SoundSetting(); 73 | 74 | if (specifyVolume) { 75 | setting.setVolume(volume); 76 | } 77 | 78 | builder.appendSoundData(soundData, setting); 79 | 80 | return builder.getCommands(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /SDK/app/src/main/java/com/starmicronics/starprntsdk/functions/PresenterFunctions.java: -------------------------------------------------------------------------------- 1 | package com.starmicronics.starprntsdk.functions; 2 | 3 | import com.starmicronics.starioextension.IPresenterCommandBuilder; 4 | 5 | import com.starmicronics.starioextension.PresenterSetting; 6 | import com.starmicronics.starioextension.PresenterSetting.Mode; 7 | import com.starmicronics.starioextension.PresenterSetting.PaperRetractFunction; 8 | import com.starmicronics.starioextension.StarIoExt; 9 | import com.starmicronics.starioextension.StarIoExt.Emulation; 10 | 11 | public class PresenterFunctions { 12 | public static byte[] createSetPresenterOperation(Emulation emulation, Mode mode, PaperRetractFunction retractFunction, int holdTime) { 13 | IPresenterCommandBuilder builder = StarIoExt.createPresenterCommandBuilder(emulation); 14 | 15 | PresenterSetting setting = new PresenterSetting(); 16 | 17 | setting.setMode(mode); 18 | 19 | setting.setPaperRetractFunction(retractFunction); 20 | 21 | if (retractFunction == PaperRetractFunction.Retract || 22 | retractFunction == PaperRetractFunction.Eject) { 23 | setting.setPaperHoldTime(holdTime); 24 | } 25 | 26 | builder.appendOperation(setting); 27 | 28 | return builder.getCommands(); 29 | } 30 | 31 | public static byte[] createClearCounter(Emulation emulation) { 32 | IPresenterCommandBuilder builder = StarIoExt.createPresenterCommandBuilder(emulation); 33 | 34 | builder.appendClearPaperCounter(); 35 | 36 | return builder.getCommands(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/anim/blink.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image_french.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image_french.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image_german.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image_german.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image_japanese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image_japanese.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image_portuguese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image_portuguese.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image_russian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image_russian.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image_simplified_chinese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image_simplified_chinese.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image_spanish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image_spanish.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/coupon_image_traditional_chinese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/coupon_image_traditional_chinese.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/display_image_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/display_image_1.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/display_image_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/display_image_2.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/printable_area_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/printable_area_image.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/sphere_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/sphere_image.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable-nodpi/star_logo_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable-nodpi/star_logo_image.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/checked_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable/checked_icon.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/ic_info_outline_white_24px.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/ic_refresh_white_24px.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/launch_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable/launch_image.jpg -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/segmented_ctrl_radio_button_left_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/segmented_ctrl_radio_button_left_unselected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/segmented_ctrl_radio_button_right_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/segmented_ctrl_radio_button_right_unselected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/segmented_ctrl_radio_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 14 | 17 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/segmented_ctrl_radio_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 14 | 17 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/segmented_ctrl_radio_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 14 | 17 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/drawable/unchecked_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/star-micronics/StarPRNT-SDK-Android-Java/32bb91c4f9b13be1c8f48fd565a17a41ec50e85d/SDK/app/src/main/res/drawable/unchecked_icon.png -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_api.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_auto_switch_interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_auto_switch_interface_ext.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_barcode_reader_ext.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_blackmark.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_blackmark_paste.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_bluetooth_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_cash_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_cash_drawer_ext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_combination.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_combination_ext.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_device_status.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_display.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_display_ext.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_hold_print.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_led.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_melody_speaker.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_page_mode.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_presenter.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_print_redirection.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_printer.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_printer_ext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_printer_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_title.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/activity_usb_serial_number_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/dialog_serial_number.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 17 | 18 | -------------------------------------------------------------------------------- /SDK/app/src/main/res/layout/fragment_auto_switch_interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 14 | 15 | 21 | 22 |