Recent

Author Topic: Android, Android Module Wizard: printing from jni to POS (or receipt) printer?  (Read 3012 times)

osvaldotcf

  • New Member
  • *
  • Posts: 15
How can i print to a POS Printer (or receipt Printer) from an App made with Android Module Wizard ?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
I don't use the Android Module Wizard .... does anyone know how it works exactly? It uses LCL-CustomDrawn-Android?

If yes, then you need to write jni code for printing, follow these steps:
1> Find the Android APIs for printing and example code to do that (search stackoverflow)
2> Use JNI to call the APIs, read and study this example in the wiki: http://wiki.lazarus.freepascal.org/Android_Programming#Example_1:_Creating_a_Java_object_and_calling_a_Java_method

If you are lucky and the printing API can be used without creating subclasses, it should be streight forward from the link above. If not, then you need to write a new method in Java and call  that method from Pascal.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
I don't use the Android Module Wizard .... does anyone know how it works exactly? It uses LCL-CustomDrawn-Android?
No, it even has its own jni header translation. It uses native android UI instead of LCL, wrapped as components to be used in Lazarus form designer.

 

TinyPortal © 2005-2018