README StarIO PortablePrinter Android SDK



Comments



Description

StarIO Software Development Kit for AndroidAndroid Software Development Kit How to Use StarIO for Portable Printers This SDK contains a Java Eclipse project for Android devices. Supported Versions Supported Star Interfaces Compatible StarIO JAR File Android OS 2.2 and Higher Bluetooth, Ethernet, WLAN StarIOPort3.1.jar Android OS 2.1 Bluetooth, Ethernet, WLAN StarIOPort.jar Tools · · · · · · Needed: JDK 6 Eclipse Android SDK Manager ADT (Android Development Tool) Plugin for Eclipse USB Windows Driver by Android Device Manufacturer StarIO Android SDK 1 StarIO Software Development Kit for Android Table of Contents v About this Manual v Star Portable Printer Compatibility Chart v Connecting a Star Portable Printer to an Android Device o Bluetooth o Network Interface v Configuring an Android Device for Development v How to Import and Run the Android SDK v Using the SDK with Star Micronics Portable Printers o Wireless LAN o Bluetooth Port Discovery o Bluetooth Manual Port Entry v v Overview of how this Android SDK is designed v StarIO - (StarIOPort3.1.jar) o Selecting a StarIO library o How to include StarIO into your project o StarIO Methods Quick Overview v StarIO Android SDK Functionality o Port Discovery o Help o Get Status o Sample Receipts o Begin / End Checked Printing o 1D Barcodes o 2D Barcodes o Text Formatting o Japanese Kanji Text Formatting o Raster Graphics Printing o Image Printing o MSR v Tips for software application development when using StarIO v Additional Resources o Star Micronics Developers Network o ASCII Table v SDK Version History 2 StarIO Software Development Kit for Android About this Manual This manual is designed to help you understand StarIO and how to build an Android application to interact with Star Micronics Thermal Portable Printers. It is important to understand the basics of the Java language. Although this SDK is for Android, there are SDKs available for many different operating systems and programming languages at our Global Support Site. Check the Developers Section of our site for the newest SDKs, technical documentation, FAQs, and many more additional resources. Key Legend: Warning Explains potential issues Avoid Doing This Explains things not to do Note Provides important information and tips CAUTION: · · · · · Android is a trademark of Google Inc. The information in this manual is subject to change without notice. STAR MICRONICS CO., LTD. has taken every measure to provide accurate information, but assumes no liability for errors or omissions. STAR MICRONICS CO., LTD. is not liable for any damages resulting from the use of information contained in this manual. Reproduction in whole or in part is prohibited. © 2012–2013 Star Micronics Co., Ltd. 3 StarIO Software Development Kit for Android Star Printer Compatibility Chart The below chart summarizes the Star Portable Printer Models supported on Android Operating Systems. Status Sample Receipts 2D Barcodes Text Formatting Kanji Text Formatting Sample Images MSR SM-S200 Bluetooth ü ü ü (*1) ü ü ü ü ü (*2) (*2) ü ü SM-S210i Bluetooth ü ü ü ü ü ü ü ü ü ü ü Bluetooth ü ü ü ü ü ü ü ü ü ü ü Bluetooth ü ü ü (*1) ü ü ü ü ü (*2) (*2) ü ü ü ü (*1) ü ü ü ü ü (*2) (*2) ü ü (Jp model only) SM-S220i (Excluding Jp model) SM-T300 WLAN Raster Graphics Interface Begin / End Checked Block 1D Barcodes Model Port Discovery Star Printer ü ü ü SM-S300 Bluetooth ü ü ü (*1) ü ü ü ü ü (*2) ü (*2) ü ü SM-T300i Bluetooth ü ü ü ü ü ü ü ü ü ü ü SM-S400 Bluetooth ü ü ü (*1) ü ü ü ü ü (*2) (*2) ü ü SM-T400i Bluetooth ü ü ü ü ü ü ü ü ü ü ü ü (*1) F/W Ver.2.4 or later is required. (*2) F/W Ver.2.4 or later is required. If the F/W Ver.2.3 is used, please read the notes below. • Raster Graphical Text Printing • Image File Pringing Note: This SDK offers the most popular features, but not all printer functionality has been included. The commands not included in this SDK application are available in the Star Mobile Printer Programming Manual. 4 StarIO Software Development Kit for Android Connecting a Star Portable Printer to an Android These screenshots were captured using an Android 4.0 tablet. Screenshots and wording can vary between Android operating systems. Bluetooth 1. Tap Settings. 2. Ensure Bluetooth is enabled and the printer is powered on. 3. Tap Bluetooth to access its settings. 4. Tap Search for Devices. Find the printer you wish to connect to and tap it to pair. 5. Enter the PIN number. The factory default for standard Star Portable Printers is “1234”. 5 Connect to the same network the Star Printer is on. 2. 3. Ensure Wi-Fi is enabled. this can set by using the WLAN Setup Utility for Mobile Printers available on Star’s website. This can be neglected as connection is established at the time of printing. Tap Settings. such as V2.StarIO Software Development Kit for Android 6. 5. Standard Star Printers do not ship with an IP Address pre-assigned. No pairing or further settings are necessary to connect the printer as the Android device will output data directly to the printer’s TCP/IP port.2 in the above screenshot. Wireless LAN 1. Older Android Operating Systems. display the message “Paired but not connected”. 6 . 4. Assign an IP Address to the Star Printer and connect it to the network. StarIO Software Development Kit for Android Configuring an Android Device for Development 1. 5. 2. Enable Unknown sources. Tap Security. Tap Settings. 4. Tap Developer options. 3. Enable USB debugging. 7 . StarIO Software Development Kit for Android Importing and Running the StarIO Android SDK It is assumed Eclipse has already been configured to support Android development. Execute Eclipse. How to import the Android SDK project into Eclipse. Enabling debug mode in Eclipse. How to import the Android SDK project into Eclipse: 1. refer to Star’s Android Setup Guide in the documentation folder of this SDK package. 8 . 3. Running the project. This section will explain: 1. Should you need assistance with this. 2. StarIO Software Development Kit for Android 2. File > Import 9 . StarIO Software Development Kit for Android 3. General > Existing Projects into Workspace 10 . 11 .StarIO Software Development Kit for Android 4. Click Finish. Browse to the location where the Star SDK is saved. Click the Application tab. 3. Set Debuggable to true.StarIO Software Development Kit for Android Enabling debug mode in Eclipse: 1. 2.xml. 12 . Click AndroidManifest. StarIO Software Development Kit for Android Running the project: 1. Tip: The above error occurs if you attempt to reinstall the . Choose PrinterTypeActivity. Click the green arrow. delete the application on your Android device and rerun the app.apk from a different host. 2. To remedy it.java. 13 . These are very important to understand because not following the naming convention correctly will fail to communicate with the printer. Port Name and Interface Relation: StarIO uses specific port names to identify what port will be used.StarIO Software Development Kit for Android Using the SDK with Portable Star Micronics Printers Please make sure you have a compatible Star Micronics Portable Printer Model. Interface Bluetooth Wireless LAN (TCP/IP) Port Name BT: BT:Device Name Port Settings mini mini BT:Printer MAC Address mini TCP:IP Address mini (Explanation of the portSetting class variable can be found in this document. This section contains all Mobile Printer samples. 14 .) Using a Mobile Printer 1. Tap “Star Mobile Printers”. StarIO Software Development Kit for Android Wireless LAN Printers 1. Enter TCP:<IP Address> without brackets around the printer’s IP Address. 15 . The IP Address must be manually entered into the “PortName” field. Alternatively. Tap the name of printer you want to connect to. 16 . 2. See here for details. Tap “Search” to find all connected Star Printers.StarIO Software Development Kit for Android Bluetooth Printers – Port Discovery 1. the device name can be manually typed into the “PortName” field. using “BT:” with no parameters will automatically communicate to the only printer connected. BT:<DeviceName> Add the full device name after “BT:” without brackets. BT: If only one Star Bluetooth Printer is connected. It is impossible to communicate with Star Bluetooth/USB printers. Using an Android Virtual Device(AVD) The operation of SDK can be checked by using the AVD (Android Virtual Device). 2.StarIO Software Development Kit for Android Bluetooth Printers – Manual Port Entry Above: No parameters needed if using only one Star Bluetooth Printer Above: Using the Device Name as the parameter There are three types of port details that can be used for Star Bluetooth Printers: 1. BT:<MAC Address> Add the printer’s MAC Address after “BT:” without brackets. 3. This is case sensitive so ensure it matches exactly. 17 . this source code is the starting point for both POS and Mobile Printers. It is important to note that not every function is available for both printer types. All functionality is located in the src folder in the com. 18 . See how specific functions work by clicking on the other source files. StarBitmap. For example. “code128Activity. They are listed again here for convenience: Portable Printers · No Cash Drawer support · No Cut Pattern support POS Printers · No Magnetic Stripe Reader support In addition. Run the program by selecting PrinterTypeActivity.java applies to both printer types.java” corresponds to the 1D barcode Code128 in the GUI.StarIO Software Development Kit for Android Overview of How This Android SDK is Designed This overview will touch briefly on key components of the SDK.StarMicronics.StarIOSDK package.java. The first page of each SDK manual shows which functions are supported. source files containing “Mini” are for portable printer models only. import com.StarIO Software Development Kit for Android StarIO – (StarIOPort3.jar is a library that you can include into your Java projects to expose StarIO methods.1. 6. WLAN Bluetooth. Drag the appropriate StarIO library file into the Project Explorer from the SDK package 2.1.stario. WLAN Compatible StarIO JAR File StarIOPort3. Click Java Build Path 4. At the top of your main code add: import com.jar) The file StarIOPort3. Ethernet. Selecting a StarIO Library: The StarIO SDK contains two library files.2 and Higher Android OS 2. import com.StarPrinterStatus.1 Supported Star Interfaces Bluetooth.stario. Ethernet.starmicronics.jar StarIOPort.starmicronics. Supported Versions Android OS 2. Use the one which corresponds to the Android OS Version your application is being developed for.starmicronics.stario.1.StarIOPort.jar How to include StarIO into your project: To include this library into your project: 1. Now you can access all of StarIO’s methods! 19 . Right click the project folder and choose Properties 3. Click Libraries and the Add JARs button 5.StarIOPortException. but caused the application to crash beginning with r17.StarIO Software Development Kit for Android Android SDK Tools r17 and Higher: Library management has been changed starting from Android SDK Tools r17. Highlight the StarIOPort JAR and relocate it to above the application code 20 . 1. Right click the project name and select properties 2. Please ensure the same caution is taken when using the StarIOPort JAR in your own application. Click Java Build Path and then Order and Export 3. Star Micronics rectified this issue in the StarIO Android SDK V2.4. This method presented no problem from Android SDK Tools r16 and lower. It is essential to order the StarIOPort JAR before StarIOSDK/src. portSettings.getPort(portName. Comment this line: port = StarIOPort.1 supports Ethernet.StarIO Software Development Kit for Android Android OS V2. portSettings.jar library.jar Upon including this library. This allows for the use of the legacy StarIOPort.2 and higher support Ethernet. 1. No modifications to the source code are necessary.1. 10000). the source code of the StarIO SDK application must be modified. Android OS 2. and Bluetooth connections.1: Include the legacy library: StarIOPort. WLAN. 2.2 and Higher: Include the default library: StarIOPort3.getPort(portName. 10000. context). the StarIO SDK application will successfully run. WLAN. Android OS V2. Android OS 2. and Bluetooth connections. Uncomment this line: port = StarIOPort.jar Upon including this library. 21 . millisecond timeout controlled internally and is used for communication in the APIs (this parameter guarantees that all of the below APIs will complete in a bounded amount of time. but does NOT guarantee the exact timeout length) timeout is a 22 . To assign them use getPort(portName. TCP:192. which will allow you to pass in variables to this methods which then assigns the 3 class variables with values.1. portName(String).portSettings(String). Ex.2 / BT:DeviceName portSettings must be set to “mini” for portable printers.and timeout(int).StarIO Software Development Kit for Android StarIO Methods Overview: Property StarIO Port class includes 3 properties. portName is what you will be using to specify the port of communication to the printer. These 3 variables will be “read only” if accessed directly.168.portSettings.timeout). catch like the above example. //The following would be an actual usage of getPort: StarIOPort port = null. it is necessary to execute getPort() and releasePort() before the printer physically enters Sleep Mode 23 . The above example shows the port being created and set to null then being assigned the actual port hook on the following line that contains getPort. your program will crash unless you use a try. portSettings. try { port = StarIOPort. Always use a try. Using one of the valid inputs for portName and portSettings as mentioned previously before this.getPort(portName. int timeoutMillis) throws StarIOPortException GetPort is what you will be using to “open” the port to the printer. 10000).StarIO Software Development Kit for Android getPort public static StarIOPort getPort(String portName. If the port cannot be opened because of connection problems. } catch (StarIOPortException e) { //There was an error opening the port } StarIOPort is a part of StarIO and this will allow you to create a “port” handle. catch when using getPort. String portSettings. you can pass your connection string into the StarIO class so that it will correctly set its private variables. When Sleep Mode is enabled. StarIO Software Development Kit for Android searchPrinter public static ArrayList<PortInfo> searchPrinter(String target) throws StarIOPortException searchPrinter gets Bluetooth devices which connect with Android terminal. PortInfo class of return value includes. set “BT: with specifc string” returns Bluetooth deivces which name from specific strings. } } catch (StarIOPortException e) { //There was an error searching the port } 24 . for (PortInfo port : portList) { Log. Log. //The following would be an actual usage of searchPrinter: try { List<PortInfo> portList = StarIOPort.searchPrinter(“BT:Star”).). return all Bluetooth devices.getPortName()).getMacAddress()). MAC address for Bluetooth devices and you can get them by String getPortName().i (“LOG”. “MAC Address: ” + port. When set “BT:” as a Argument value.i (“LOG”. as a list. “Port Name: “ + port. and String getMacAddress() method. PortName. You can use PortName as a Argument value of getPort(). StarIO Software Development Kit for Android This sample shows. searchPrinter detects not only Star portable printers but also any Bluetooth devices. To use original name. get connected Bluetooth devices which name start from “Star” and output to log. 25 . just search specific pritners. A byte array buffer into which data is read.Total number of bytes to read. Under some interface types. Throws: StarIOPortException 26 . Do not use this method to read raw status. Returns: The number of bytes that were actually read.specifies where to begin writing data into the readBuffer[] size . Your application should call this function a limited number of times until the expected data has been read in or until an application determined retry threshold has been reached.when a communication failure occurs . int size) throws StarIOPortException This method reads data from the device. Parameters: readBuffer . this function will succeed even when no data was read in. Use retreiveStatus for getting status. offset . Only use this if you really need to read raw bytes from the printer.StarIO Software Development Kit for Android readPort public int readPort(byte[] readBuffer. int offset. You must run the getPort method after 500msec from releasePort. Leaving a port open will cause future calls to open the port to fail. Parameters: port – StarIOPort type representing a previously initialized port. For Ethernet Interface: The getPort method may fail if you run it just after running releasePort. 27 . release (close) ports. When do not send the data.StarIO Software Development Kit for Android releasePort public static void releasePort(StarIOPort port) This function closes a connection to the port specified. int size) throws StarIOPortException This method writes data to the device. Under some interface types. Returns: The number of bytes that were actually written.StarIO Software Development Kit for Android writePort public int writePort(Byte[] writeBuffer.Specifies where to begin pulling data from writeBuffer . Use this to print to the printer. offset .Contains the output data in a byte array. 0x1B. 0. 0x42. Your application should call this function a limited number of times until all the data has been written out or until an application determined retry threshold has been reached. B.when a communication failure occurs . etc.writePort(command. size . Feed 3mm. Parameters: writeBuffer . send commands. The SDK has code in printToPrinter that is more complex than this but that code block will show you how to verify data transmission to the printer whereas this code is just dumping it: //Set a byte array to send to the printer //command = { A. int offset. command. this function will succeed even when no data was written out. The following is an example of how to use this method: Please keep in mind this is the simplest way to send data to the printer. Throws: StarIOPortException 28 . catch for safe programming practices.Number of bytes to write. 0x44. C. 0x02 }.length). } catch (StarIOPortException e) { //There was an error writing to the port } Remember to use a try. 0x1B. Full Cut} Byte[] command = new Byte[] { 0x41. try { port. 0x64. 0x7A. D. 0x00. 0x43. blackMarkError == true) { //There was a black mark error } if (status.StarIO Software Development Kit for Android retreiveStatus public StarPrinterStatus retreiveStatus () throws StarIOPortException This method retrieves detailed status from the printer with StarIO. 29 . Returns: StarPrinterStatus structure giving the current device status Throws: StarIOPortException .compulsionSwitch == true) { //Cash drawer is open } else { //Cash drawer is closed } } else { //If true.retreiveStatus(). then the printer is offline. if (printerStatus.when a communication failure occurs This method uses a class structure that is included with StarIO called StarPrinterStatus This structure gives the printer's status in both boolean and binary form.offline == false) { if (status. coverOpen returns a Boolean. Create the StarPrinterStatus object in your project by doing the following: StarPrinterStatus status = port. } This is a list of statuses that are in the class structure StarPrinterStatus: offline returns a Boolean. (SM-T300 Only) receiptPaperEmpty returns a Boolean. SM-S200. Note: The following models requires firmware 2. You must run beginCheckedBlock just before sending print data. Bluetooth model) 30 .An error sending the command (such as Off-Line) . SM-S400. SM-S300. you need to run this method just before sending print data and endCheckedBlock just after sending print data. can get the return value which is the current device status when this method is executed. Returns: StarPrinterStatus structure giving the current device status Throws: StarIOPortException .No response for the completion of printing from a printer within the timeout Timeout length is specified by getPort. To check if the whole data is completely printed. endCheckedBlock public StarPrinterStatus endCheckdBlock () throws StarIOPortException This method is used in combination with beginCheckedBlock and checks the completion of printing. SM-T300 (Wi-Fi.4 or later. Returns: StarPrinterStatus structure giving the current device status Throws: StarIOPortException . If an error has occurred while printing.when the printer is off line See the sample code here. See the sample code here.when a communication failure occurs .StarIO Software Development Kit for Android beginCheckedBlock public StarPrinterStatus beginCheckdBlock () throws StarIOPortException This method is used in combination with endCheckedBlock and checks the completion of printing. or is 10 seconds if specified less than 10 seconds. } finally { if (port != null) { try { StarIOPort. if (status.length).StarIO Software Development Kit for Android try { port = StarIOPort. portSettings. } catch (StarIOPortException e) {} } } 31 . //Start checking the completion of printing StarPrinterStatus status = port. "An timeout error has occurred during printing. context).releasePort(port). 0.getPort(portName.endCheckedBlock(). } } catch (StarIOPortException e) { Log.offline == true) { //If true. port. //Printing byte[] command = MiniPrinterFunctions.beginCheckedBlock().writePort(command. then the printer is offline. //End checking the completion of printing status = port. 10000.d("StarIOSample". command.").createPrintData(paperWidthInch). StarIO Software Development Kit for Android generateBitImageCommand public byte[] generateBitImageCommand (int width. byte[] imageData. String portSettings) throws StarIOPortException This method generates the print command from image data. Parameters: width – Width of image data (pixel) height – Height of image data (pixel) imageData – Byte array of image data to convert portSettings – Port settings ”mini” is specified for a portable printer Returns: Success: Print command Failure: null Throws: StarIOPortException 32 . int height.When failed to generate the print command . cutterError Auto-cutter Error boolean Portable printers are not supported. headThermistorError Head Thermistor Error boolean Portable printers are not supported. " false " : Printer is Online overTemp Stopped by high head temperature boolean Portable printers are not supported. presenterState Presenter Paper Position int Portable printers are not supported. voltageError Electric Voltage Error boolean Portable printers are not supported. receiveBufferOverflow Receive Buffer Overflow boolean Portable printers are not supported. 33 . " false " : Cover is closed. " false " : Paper does not end.StarIO Software Development Kit for Android Status List of the class structure StarPrinterStatus Member name Contents Type Detail blackMarkError Black Mark Error boolean Portable printers are not supported. raw Byte column of status byte[63] Byte column of status (example : HEX 23 86 00 00 00 00 00 00 00) rawLength raw length int raw length receiptPaperEmpty Paper end boolean " true " : Paper end. coverOpen Cover Status boolean You can check status of Cover " true " : Cover is opened. " true " : Printer is Offline. compulsionSwitch Compulsion SW boolean Portable printers are not supported. receiptPaperNearEmptyInner Paper Near-end (Inner Side) boolean Portable printers are not supported. offline ONLINE/OFFLINE Status boolean You can check status of Online or offline. unrecoverableError Non-recoverable Error boolean Portable printers are not supported. etbAvailable ETB available or not boolean " true " : available to use " false " : not available to use etbCounter ETB Counter int Portable printers are not supported. presenterPaperJamError Presenter Paper Jam Error boolean Portable printers are not supported. StarIO Software Development Kit for Android Class structure StarPrinterStatus Supported by Portable Printers SMT300 SMS200 SMS300 SMS400 SM-S210i (Jp model only) SM-S220i ( Excluding Jp model ) SMT300i SMT400i ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ raw ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ rawLength ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ receiptPaperEmpty ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ Member name blackMarkError compulsionSwitch coverOpen cutterError etbAvailable etbCounter headThermistorError offline overTemp presenterPaperJamError presenterState receiptPaperNearEmptyInner receiveBufferOverflow unrecoverableError voltageError 34 . Upon running the SDK. Choosing Portable Printer Commands 1. This SDK also has page and section references to the Mobile Command Manual for more information so please download and study it if you need more detail on a specific command. Tap “Star Portable Printers”.StarIO Software Development Kit for Android StarIO Android SDK Functionality Overview of this SDK functionality and StarIO Printer Commands All of these commands can be found in the Star Mobile Printer Command Manual. This section describes what each does and how the command can be tailored to fit your needs. the above buttons are displayed to demonstrate different functionality. 35 . StarIO Software Development Kit for Android Supported Samples Port Discovery Get Status Sample Receipt JP Sample Receipt Begin/End Checked Block 1D Barcodes 2D Barcodes Text Formatting JP Kanji Text Formatting Raster Graphics Text Printing Image File Printing Magnetic Stripe Reading 36 . This feature is documented in greater detail here. 37 .StarIO Software Development Kit for Android Port Discovery Automatically detects which Star Micronics Bluetooth Printers are paired. Manually entering port data is unnecessary if Port Discovery is used. Help Displays rules for manually entering the printer’s port data into the “PortName” field. Tap the printer to connect to it. Wireless portable printers currently do not support this feature. This part of the source code is heavily commented to demonstrate how receipts can be fully customized. 38 .StarIO Software Development Kit for Android Get Status StarPrinterStatus public boolean retreiveStatus() See status return values here offline false = printer online. while “JP Sample Receipt” outputs one in Japanese. true = printer offline other See status return values here Sample Receipts Prints a premade sample receipt in the chosen command type. Select the sample’s width and tap “OK” to print it. “Sample Receipt” outputs a receipt in English. 39 .StarIO Software Development Kit for Android Begin / End Checked Block This sample program checks the completion of printing using “beginCheckedBlock” and ”endCheckedBlock”. See details of success and error of printing here. dn NUL m = Barcode Type n = Number of data d1…dn = Barcode Data 40 .StarIO Software Development Kit for Android 1D Barcodes Set Barcode Height GS h n 0 ≤ n ≤ 255 Set Barcode Width GS w n 1≤n≤8 Print Barcode GS k m n d1... StarIO Software Development Kit for Android 2D Barcodes QR Code Select QR Code GS Z n n = 2 (QR Code) Print QR Code ESC Z m a k nL nH d1…dn m = Version of the symbol m = 1~40. 0 = Auto size a = Correction Level L = 7%. Q = 25%.. H = 30% k = Model Size k = 1~8 nL = Lower Byte Value. nH = Higher Byte Value d1..dn = QR Code Data 41 . M = 15%. StarIO Software Development Kit for Android PDF417 Select PDF417 GS Z n n = 0 (PDF417) Set PDF417 Size GS w n 1≤n≤8 Print PDF417 ESC Z m a k nL nH d1…dn m = Column Number 1 ≤ m ≤ 30 a = Correction Level 0≤n≤8 k = Horizontal/Vertical Ratios 2≤k≤5 nL = Lower Byte Value. nH = Higher Byte Value d1…dn = Barcode Data 42 . StarIO Software Development Kit for Android Text Formatting 43 . StarIO Software Development Kit for Android Text Formatting (continued from above) Underline ESC – n 1 = Underline On. 2 dots thick 0 = Underline Off [Default] Emphasized ESC E n 1 = On 0 = Off [Default] 1 = On 0 = Off [Default] 1 = On 0 = Off [Default] Upside Down Text ESC { n Invert Color GS B n Character Expansion GS ! n 0≤n≤8 Left Margin GS L nL nH 0 ≤ nL ≤ 255 0 ≤ nH ≤ 255 0 = Left [Default] 1 = Center Alignment ESC a n 44 2 = Right . 1 dot thick 2 = Underline On. except Japanese Kanji is supported.StarIO Software Development Kit for Android Japanese Kanji Text Formatting This functionality is the same as that of Text Formatting. 45 . 1 dot thick 2 = Underline On.StarIO Software Development Kit for Android Japanese Kanji Text Formatting (continued from above) Enable Shift JIS Mode FS C 1 Cancel Shift JIS Mode FS C 0 Underline ESC – n 1 = Underline On. 2 dots thick 0 = Underline Off [Default] Emphasized ESC E n 1 = On 0 = Off [Default] 1 = On 0 = Off [Default] 1 = On 0 = Off [Default] Upside Down Text ESC { n Invert Color GS B n Character Expansion GS ! n 0≤n≤8 Left Margin GS L nL nH 0 ≤ nL ≤ 255 0 ≤ nH ≤ 255 0 = Left [Default] 1 = Center Alignment ESC a n 46 2 = Right . refer to the programming manual for a listing of all Raster commands.java". As there are many options on how to customize output in Raster Mode. refer to the following in order to prevent "data defective".4 later] Use beginCheckedBlock / endCheckBlock method “before / after” sending data by writePort method. Detail refer to the "printBitmap" method in the "MiniPrinterFunctions. Store Print Job as Raster Graphic ESC X 4 Print Stored Raster Graphic Data ESC X 2 47 .StarIO Software Development Kit for Android Raster Graphical Text Printing Raster Mode converts all print data into image data and then outputs it to the printer. Note: If send large amounts of raster data command. This enables Star Printers to print at high speeds. [Printer Device Firmware version 2. regardless of outputting receipts with only text or text and logos/coupons. [Printer Device Firmware version 2. send query commands after writePort data.3 earlier] For confirming the end of printing. These commands are also conveniently listed right on the Android device by tapping the Help button on the screen. refer to the programming manual for a listing of all Raster commands. regardless of outputting receipts with only text or text and logos/coupons. 48 . Note: If send large amounts of raster data command. Detail refer to the "printBitmapImage" method in the "MiniPrinterFunctions. As there are many options on how to customize output in Raster Mode.StarIO Software Development Kit for Android Image File Printing Use the dropdown box to select one of four different sample images to print via Raster Graphics and choose the desired paper width. These commands are also conveniently listed right on the Android device by tapping the Help button on the screen.java". Raster Mode converts all print data into image data and then outputs it to the printer. This enables Star Printers to print at high speeds. refer to the following in order to prevent "data defective". StarIO Software Development Kit for Android MSR (Magnetic Stripe Reading) Read One Track ESC M C Read Track 1 or Read Track 2 Read One Track ESC M D Read Track 2 or Read Track 3 Read Two Tracks ESC M E Read Track 1&2 or Read Tracks 2&3 Set JIS-II Mode ESC M J Read Japanese Characters Cancel MSR Mode EOT 49 Return to standard print mode . TIP #4: If there is a command that is not covered in this SDK but you wish to see a code snippet of that command in use then visit our Developers’ section for a possible code block that matches your needs.StarIO Software Development Kit for Android Tips for App Development when using StarIO Star Micronics prides itself as the industry leader in great POS products and with great power comes great responsibility. you will be fully taking advantage of object oriented programming. or strings when choosing a variable to contain your print job data. Below is a tips section just to help you get on the fast track to software development with StarIO. Big mistakes made in Unicode are culture-sensitive search and casing. and (Byte & Char) are. Try to code with Bytes instead of Chars. combining characters. A byte is normally 8-bits long which would be 8 digits of binary (1s and 0s). surrogate pairs. 50 . TIP #2: Know what the differences and definitions of (ASCII & Unicode). These bytes are just 8 bits of binary data but bytes can also be int or char. ints. The three different variable types basically hold the data in the same way but there are slight differences. TIP #5: Looking for an iOS printing SDK? Visit our Developers section to get access to Star developer tools for these environments. create a class to abstract all the printing methods into class(s) instead of having the code reside in the main code block. and normalization which are answered here. This will help with code reusability and will also save you time in the long run from having to find one line of code in the main code. All the available StarIO commands are available in the Thermal Line Mode Spec Manual and that is the best resource to use when researching a specific StarIO command. This SDK & Manual was built to help you (The Developer) have a very easy job ahead of you to program for Star Printers. ASCII to Unicode and vice versa conversions are sometimes unsecure so make sure you know what and how the encoding class works with these. By having StarIO only reside in the class(s). TIP #3: Do not waste time trying to reverse engineer StarIO command codes. (Hex & Decimal). TIP #1: If you are going to be coding a large project. and Mac. The Developers Network gets you access to: § § § Updated Versions of this Manual and Source Code Star Micronics Printer Drivers Technical Questions/Support Android Developers Resource The official Android development resource. etc. Star Micronics Developers Network Browse Star Micronics’ FAQs. Unicode. ask a question. 1D Barcodes Barcode Island is a great resource for specs on 1D barcodes.StarIO Software Development Kit for Android Additional Resources Please get the programmers manual for Star Portable Printers from the link below. QR Codes. and PDF417 Code Pages Learn about Code Pages here. System Requirements for Android Development See requirements for Windows. look up information.org The Unicode Consortium – Good place to learn more about Unicode. 2D Barcodes Great place for information on 2D Barcodes. 51 . Linux. 2F / 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F ` a b c d e f g h i j k l m n o ASCII Hex Symbol 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 0 1 2 3 4 5 6 7 8 9 : . < = > ? ASCII Hex Symbol 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F p q r s t u v w x y z { | } ~  . 52 20 (space) 21 ! 22 " 23 # 24 $ 25 % 26 & 27 ' 28 ( 29 ) 2A * 2B + 2C .StarIO Software Development Kit for Android ASCII Table Resource ASCII Hex Symbol 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F NUL SOH STX ETX EOT ENQ ACK BEL BS TAB LF VT FF CR SO SI ASCII Hex Symbol 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F @ A B C D E F G H I J K L M N O ASCII Hex Symbol 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US ASCII Hex Symbol 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F P Q R S T U V W X Y Z [ \ ] ^ _ ASCII Hex Symbol 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ASCII Hex Symbol 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 Use this to compare hex values to symbol (ASCII) values. 2D 2E . . 12 2012 2.Updated default StarIO Port Class name .Added Star Printer Status List Feb.0 . 18 2013 3.3.Added SM-T300i.7.2.Revised default order of StarIOPort JAR to support Android SDK r17 and higher Mar.Added Port Discovery support .0 .StarIO Software Development Kit for Android SDK Package Version History Release Date SDK Package Version Jul.Added generateBitmapCommand support .Added Japanese Text Formatting Sample .Updated Sample Printing Jun.0 Beta . 18 2012 2.Updated Begin / End Checked Block method Nov.4. 14 2011 2.Updated Raster Graphical Text Printing.0 .Added SM-S210i . 25 2013 3.0 . 27 2012 3.0 Beta .Added Japanese Manuals Oct. 03 2011 1. SM-T400i Jan.Added Begin/End Checked Block support Jul. 3 2013 3.Added Apple AirPort Express support (POS Printers Only) .Added Raster Image Printing Sample Jan.1.2.0. 15 2012 2.0 .0 .Added Sample Receipt Printing support May.Initial Release 53 Update .Added USB Printing Support (POS Printers Only) Jan.1.0.4. 30 2012 3.Changed SDK UI to tree structure .0 . 31 2012 2.0 .3.0 .Added Bluetooth support . Buckinghamshire HP13 7DL UK +44-(0)-1494-471111 http://www. 536 Nanatsushinya Shimizu-ku.com Star Micronics Southeast Asia Co. we are obsessed with exceeding the demands of our valued customers every day. Interactive Coupons with Triggers. Hospitality. JavaPOS. Android.co. 1150 King Georges Post Road Edison. NJ 08837 USA 1-800-782-7636 +1-732-623-5500 http://www. Labeling. Inc. Ticketing.com Star Micronics EMEA Star House Peregrine Business Park. POS for . United Center Bldg. 323 Silom Road.th/ . We have a long history of implementations into Retail.star-emea.starmicronics. Restaurants and Kitchens. Kiosk and Impact Dot Matrix printers. Bangkok 10500 Thailand +66-2-631-1161 x 2 http://www. Room 2902C. OPOS. Gomm Road High Wycombe... Mobile. Blackberry Printing Support. Offering a diverse line of Thermal. ENERGY STAR. Ltd. Law Enforcement. 29th Fl. Payment Processing. Salons and Spas. Mac and Linux. MSR Reading. We apply over 50 years of knowhow and innovation to provide elite printing solutions that are rich in stellar reliability and industry-respected features. Ltd. Demand a Star! Star Micronics America. Advanced Drivers for Windows. iOS. Gaming and Lottery. Eco-Friendly Paper and Power Savings with Reporting Utility.htm Star Micronics is a global leader in the manufacturing of small printers. Point of Sale. and more! High Quality POS Receipts. Hybrid. Demand everything from your printer.jp/eng/index. Shizuoka 424-0066 Japan +81-54-347-2163 http://www. Complete SDK Packages. Banking and Credit Unions. ATMs. futurePRNT.NET. Medical. Kiosks and Digital Signage.star-m.starmicronics.Star Micronics Worldwide Star Micronics Co. StarPRNT… How can Star help you fulfill the needs of your application? Don’t just settle on hardware that won’t work as hard as you do. Logo Printing for Branding. Silom Bangrak.
Copyright © 2024 DOKUMEN.SITE Inc.