StarXpand SDK for iOS/Android Developer's Manual Ver. 1.6.0

Last update: February 9, 2024

Quick Start

The procedure and the reference vary depending on the OS. Select the OS to display.

iOS Android


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.

Set Connection between Printer and Device

Prepare the printer and make it communicable to a tablet or PC.
Select the printer interface.

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 the 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 with 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 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".

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.

Step 2.

Prepare Development Environment for iOS Applications

Step 2.

Prepare Development Environment for Android Applications

Prepare a development environment for iOS applications.
Install Xcode.

Xcode:
https://developer.apple.com/xcode/

Prepare a development environment for Android applications.
Install Android Studio.

Android Studio:
https://developer.android.com/studio

Memo
For the supported development environments, see here.

Step 3.

Build Sample Application

Execute the following command to clone the StarXpand SDK from GitHub.

$ git clone https://github.com/star-micronics/StarXpand-SDK-iOS.git

Memo
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.
https://starmicronics.com/support/developers/ios-sdks/


From the Xcode menu, select File > Open... to open the SDK sample application project and build the sample application.


Execute the following command to clone the StarXpand SDK from GitHub.

$ git clone https://github.com/star-micronics/StarXpand-SDK-Android.git

Memo
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.
https://starmicronics.com/support/developers/android-sdks/


From the Android Studio menu, select File > Open... to open the SDK sample application project and build the sample application.


Step 4.

Print Sample Receipt

When the build succeeds, the print screen sample application starts.

First, search for the printer. Tap Discovery.

First, search for the printer. Tap [DISCOVERY].


When you select Interface and tap Discovery, printers that can be connected to tablets are displayed.
The text following ":" indicates the printer Identifier.
Copy the Identifier because it will be used to specify the destination printer in the next step.

When you select Interface and tap [DISCOVERY], printers that can be connected to tablets are displayed.
The text following ":" indicates the printer “Identifier”.
Take note of the Identifier because it will be used to specify the destination printer in the next step.


Finally, print a sample receipt.
Go back to the previous screen and tap Printing.

Enter the printer Identifier you copied on the Discovery screen in the Identifier field and tap Print.

Lastly, print a sample receipt.
Go back to the previous screen and tap [PRINTING].

Enter the printer Identifier of which you took note 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.