简体   繁体   中英

how to include and use stariosdk for android bluetooth printing

i am in android app and i want to use stariosdk in order to print a receipt from my app.

This is the link for star SDK: http://www.starmicronics.com/support/SDKDocumentation.aspx

I'm trying to follow the sdk's guides:

All functionality is located in the src folder in the com.StarMicronics.StarIOSDK package.

Run the program by selecting StarIOSDKActivity.java; this source code is the starting point for both POS and Mobile Printers.

See how specific functions work by clicking on the other source files. For example, “code128Activity.java” corresponds to the 1D barcode Code128 in the GUI.

It is important to note that not every function is available for both printer types. The first page of each SDK manual shows which functions are supported. 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, source files containing “Mini” are for portable printer models only.

StarBitmap.java applies to both printer types.

and these:

The file StarIO.jar is a library that you can include into your Java projects to expose StarIO methods. To include this library into your project:

  1. Drag StarIOPort.jar into the Project Explorer from the SDK package

  2. Right click the project folder and choose Properties

  3. Click Java Build Path

  4. Click Libraries and the Add JARs button

  5. At the top of your main code add:

    import com.starmicronics.stario.StarIOPort;

    import com.starmicronics.stario.StarIOPortException;

    import com.starmicronics.stario.StarPrinterStatus;

  6. Now you can access all of StarIO's methods!

I need help in order to understand the difference between StarIOPort.jar and StarIOSDKActivity.java and how to use it.

I want to use only MiniPrinterFunctions.java for mobile printers...

StarIOPort.jar is the library file responsible for opening/closing the printer port, getting status, and sending print jobs to the printer.

StarIOSDKActivity.java is a sample application demonstrating printer capabilities. The commands are different depending on the printer you're using.

The SDK app itself has a tick box for mobile printers. As soon as you tick it, you're using the functionality in MiniPrinterFunctions.java. If you don't tick it, you're using PrinterFunctions.java.

Use the sample code in MiniPrinterFunctions.java if you're only including mobile printer support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM