2

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...

Thaddeus Albers
  • 4,094
  • 5
  • 32
  • 42
kosbou
  • 3,919
  • 8
  • 31
  • 36

1 Answers1

1

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.

LtH
  • 692
  • 7
  • 18
  • 1
    is there a step by step tutorial on how to include an external library to a project??? – kosbou Jun 19 '12 at 18:43
  • if i want to use portable printer what do i have to do?? import StarIOPort.jar to my project and use the function from MiniPrinterFunctions.java???? – kosbou Jun 19 '12 at 18:56
  • Yes. Reference these page numbers in their portable printer manual. Step 1: Import StarIOPort.jar to your app. (page 17) Step 2: Import StarIO in your app. At the top of your main code add: import com.starmicronics.stario.StarIOPort; import com.starmicronics.stario.StarIOPortException; import com.starmicronics.stario.StarPrinterStatus; (page 17) Step 3: Copy and paste whatever code you like from MiniPrinterFunctions.java into your app. – LtH Jun 20 '12 at 06:41
  • main code is my appnameactivity??? i make my app with jquery... how to add MiniPrinterFunctions.java functions to jquery code??? – kosbou Jun 20 '12 at 12:31
  • Are you using Eclipse or another programming tool? – LtH Jun 20 '12 at 13:11
  • I looked into this over the weekend. The SDK isn't compatible alone with JQuery or JavaScript (assuming that's the language being used). If you import the app in Eclipse and are using Java, you can simply open the .java files and copy/paste whatever code you want to use in your own app. But you probably don't want to use the whole MiniPrinterFunctions.java since it contains code Star used to make their sample app. Have you tried contacting Star? – LtH Jun 25 '12 at 00:04