I'm trying to use javapos for an android application and I'm having quite an hard time making it works.
Here's what I tried untill now.
I have the jars of javapos an the jpos.xml file, which was given to me by the vendor of the printer. I loaded the jars inside the lib folder and jpos.xml inside the root folder of the application (I'm not sure if it is where it has to be). The I wrote the java to connect to it :
System.setProperty(JposPropertiesConst.JPOS_POPULATOR_FILE_PROP_NAME, "jpos.xml");
POSPrinter printer = new POSPrinter();
try {
printer.open("printf");
printer.claim(100);
printer.setDeviceEnabled(true);
printer.printNormal(1, "PRINT?");
} catch (jpos.JposException e) {
e.printStackTrace();
}
Where "printf" is the logicName inside my xml.
But when I try to print I always get this error :
pos.JposException: Service does not exist in loaded JCL registry
at jpos.loader.simple.SimpleServiceManager.createConnection(Unknown Source)
at jpos.loader.JposServiceLoader.findService(Unknown Source)
at jpos.BaseJposControl.open(Unknown Source)
So, my questions are:
is what I'm tring to do right? It is even possible? because I have seen a couple of question about this, but never on an android application.
If it is possible, how can I tell my application where to find JCL registry?