Quick Start
The StarXpand SDK includes a sample application that allows you to test printing operation.
As the first step to control the printer using the StarXpand SDK, let's try to build the sample application in the following 4 steps and print a sample receipt.
Step 1. Connection between Printer and Device
Step 2. Construct Environment for ReactNative Applications
Step 1.
Set Connection between Printer and Upper Level Terminal
Prepare the printer and make it communicable to a tablet or PC.
Select the OS and the printer interface.
OS
Interface
LAN Bluetooth Bluetooth Low Energy USB
Procedure for communication settings
For connection through Bluetooth, you need to first pair the iOS device to the printer.
- 1. Turn the printer power on.
Memo
If you are using TSP650II, TSP650IISK, TSP700II, TSP800II, or SP700, press and hold the PAIR button on the back of the main unit after power-on to blink the LED in green. - 2. Open "Settings" on iOS and select [Bluetooth].
- 3. Turn Bluetooth on.
- 4. Select the device name you would like to pair.
Memo
If you are prompted to enter the PIN, type in the PIN. (The default is "1234".) - 5. When pairing is completed, "Connected" will be displayed next to the device name.
Connect the printer and the iOS device to the same network (segment).
- 1. Open "Settings" on iOS and select [Wi-Fi].
- 2. Turn Wi-Fi on.
- 3. Select the network you would like to use and connect the iOS device.
- 4. Turn the printer power on.
- 5. Plug the LAN cable into the printer and connect the printer and the iOS device to the same network (same segment).
Memo
The default for the Star POS printer is "DHCP: Enabled".
For an environment without DHCP, select "Supported OS and Environment List" > "Utility List" on this link, see "Ethernet Printer User Guide", and set a static IP address for the printer.
Preparation is not required.
In the case of Bluetooth Low Energy, you do not need to pair the iOS device with the printer.
Turn the printer power on and connect the iOS device to the printer with the USB cable or Lightning cable.
Memo
USB ports communicable with iOS devices vary depending on the printer.
Check the online manual of the printer you are using or the Hardware Manual.
Connect the printer and the Android device to the same network (segment).
- 1. From the Android Settings, select Network & Internet > Internet.
- 2. Turn Wi-Fi on, select a network you would like to use, and connect the Android device.
- 3. Turn the printer power on.
- 4. Plug the LAN cable into the printer and connect the printer and the Android device to the same network (same segment).
Memo
The default for the Star POS printer is "DHCP: Enabled".
For an environment without DHCP, select "Supported OS and Environment List" > "Utility List" on this link, see "Ethernet Printer User Guide", and set a static IP address for the printer.
For connection through Bluetooth, you need to first pair the Android device to the printer.
- 1. Turn the printer power on.
Memo
If you are using TSP650II, TSP650IISK, TSP700II, TSP800II, or SP700, press and hold the PAIR button on the back of the main unit after power-on to blink the LED in green. - 2. Turn Bluetooth on for the Android device.
- 3. From the Android Settings, select Connected devices > + Pair new device.
- 4. Select a device name you would like to pair.
Memo
If you are prompted to enter the PIN, type in the PIN. (The default is "1234".) - 5. When pairing is complete, the device name will be displayed under "Paired devices".
Turn the printer power on and connect the Android device to the printer with the USB cable.
Memo
USB ports communicable with Android devices vary depending on the printer.
Check the online manual of the printer you are using or the Hardware Manual.
Connect the printer and the Windows device to the same network (segment).
- 1. Click the network icon on the taskbar, turn Wi-Fi on, and connect to the network you would like to use.
- 2. Turn the printer power on.
- 3. Plug the LAN cable into the printer and connect the printer and the Windows device to the same network (same segment).
Memo
The default for the Star POS printer is "DHCP: Enabled".
For an environment without DHCP, select "Supported OS and Environment List > Utility List" on this link, see "Ethernet Printer User Guide", and set a static IP address for the printer.
For connection through Bluetooth, you need to first pair the Windows device to the printer.
- 1. Turn the printer power on.
Memo
If you are using TSP650II, TSP650IISK, TSP700II, TSP800II, or SP700, press and hold the PAIR button on the back of the main unit after power-on to blink the LED in green. - 2. Turn Bluetooth on for the Windows device.
- 3. From the Android Settings, select Connected devices > + Pair new device.
- 4. Select the device name you would like to pair.
Memo
If you are prompted to enter the PIN, type in the PIN. (The default is "1234".) - 5. When pairing is complete, the device name will be displayed under "Paired devices".
Step 2.
Construct Development Environment for ReactNative Applications
Prepare a development environment for ReactNative applications.
https://reactnative.dev/docs/environment-setup
Memo
For the supported development environments, see here.
Step 3.
Building Sample Application
Execute the following command to build the sample application contained in the StarXpand SDK cloned from GitHub.
Memo https://starmicronics.com/support/developers/cross-platform-sdks/
The ZIP package of the StarXpand SDK is available for download on our Developer site.
Obtain the ZIP package from the following URL and unzip it.
OS Commands
$ git clone https://github.com/star-micronics/react-native-star-io10.git $ cd react-native-star-io10/example $ yarn install $ cd ios $ pod update $ cd .. $ npx react-native run-ios
$ git clone https://github.com/star-micronics/react-native-star-io10.git $ cd react-native-star-io10/example $ yarn install $ npx react-native run-android
$ git clone https://github.com/star-micronics/react-native-star-io10.git $ cd react-native-star-io10/example $ yarn install $ npx react-native run-windows
Step 4.
Print Sample Receipt
When the build succeeds, the print screen sample application starts.
First, search for the printer.
Execute the following command to switch to the search screen sample.
$ cp samples/discovery/App.tsx ./
Select Interface and tap [Discovery].
Printers that can be connected to tablets are displayed.
The text following ":" indicates the “Identifier”. Copy or take note of it.
Next, print a sample receipt.
Execute the following command to switch to the print screen sample again.
$ cp samples/printing/App.tsx ./
Enter the printer Identifier you copied on the Discovery screen in the Identifier field and tap [Print].
Was the sample receipt successfully printed?
Next, let's use the printer from your application. Refer to API User Guide.