Giter Club home page Giter Club logo

android-thermal-bluetooth-print's Introduction

Android-Thermal-Bluetooth-Print

The app developed by Saeed Khalafinejad from Kasabeh Accounting Software Group for printing from Android to Bluetooth thermal printers. (Kasabeh means businessmen).

Description

This app demonstrates how you can print from an Android device to portable Bluetooth thermal printers. The library for printing is located at the org.kasabeh.androidprint.lib package. You can easily reuse the package in your own project. Some notes about the project:

  • The app works with all ESC/POS commands friendly printers.
  • We have tested the app on Bixolon, Woosim, Sewoo, Baby and Rongta printers.
  • Based on the implementation, the app should support almost all Bluetooth printers.
  • If you find any printer that is not supported by the app then you need to extends the WoosimPrnMng class based on the unsupported printer documentations.
  • Besides English characters, the app also supports Farsi/Arabic characters.
  • For other languages, based on the font installed on the device, you need to implement your owner character mapper (Similar to the WCharMapperCT42 class).
  • The printing library here is used in Kasabeh Pocket Accounting Software for printing invoices and person's transactions (Kasabeh means businessmen in Farsi). See this Gist: the application of the library package in a real project.

How to Print

First, implement the IPrintToPrinter interface:

    public class TestPrinter implements IPrintToPrinter {
        ...
        @Override
        public void printContent(WoosimPrnMng prnMng) {
            prnMng.printStr("Header", 2, WoosimCmd.ALIGN_CENTER);
            prnMng.printStr("1-First line", 1, WoosimCmd.ALIGN_LEFT);
            prnMng.printStr("2-Second line", 1, WoosimCmd.ALIGN_LEFT);
            prnMng.printNewLine();
            prnMng.printStr("Footer", 1, WoosimCmd.ALIGN_CENTER);
        }
        ...
    }

Then, instantiate the print manager class to make the Bluetooth connection and to issue the print command:

    ...
    IPrintToPrinter testPrinter = new TestPrinter(this);
    //The below command makes a connection to the printer and after successful connection issues the print command.
    mPrnMng = printerFactory.createPrnMng(this, blutoothAddr, testPrinter);
    ...

App Screenshot

To test the app, just choose your printer brand and press the print button.

Android portable Bluetooth thermal printer app

More information

Please contact us via Email or visit our websites for more information. Since the websites are in Farsi, Google Translate service can be helpful for translation however it is not always accurate.

android-thermal-bluetooth-print's People

Contributors

saeed-khalafinejad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

android-thermal-bluetooth-print's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.