[TIMOB-24224] Hyperlooop: Android - 3rd Party Android Library not correctly mapped
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2016-12-16T11:46:50.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android, Hyperloop |
Labels | android, hyperloop, titanium |
Reporter | Mike Stancliffe |
Assignee | Gary Mathews |
Created | 2016-12-13T16:56:00.000+0000 |
Updated | 2017-03-31T22:48:40.000+0000 |
Description
Trying to print to a bluetooth printer with the Zebra SDK from Android via Hyperloop, but the mappings seem incomplete.
I am able to connect to the printer but when I try to get and instance of ZebraPrinter and then print an image with that instance I am told the method does not exist even though it should be(its inherited, but is clearly documented by Zebra). This also seems to be true of other inherited methods as well, I have tried a few others to see what works and what doesn't.
the documentation:
http://link-os.github.io/PC/v2.9.2275/documentation/com/zebra/sdk/printer/ZebraPrinter.html
var ZComm = require('com.zebra.sdk.comm.*'),
ZPrinter = require('com.zebra.sdk.printer.*'),
ZDevice = require('com.zebra.sdk.device.*');
var theBtMacAddress = "XX:XX:XX:XX:XX:XX";
function print(e) {
var thePrinterConn = new ZComm.BluetoothConnection(theBtMacAddress);
thePrinterConn.open();
var printer = ZPrinter.ZebraPrinterFactory.getInstance(thePrinterConn);
printer.printImage('/testPage.png', 0, 0);
thePrinterConn.close();
}
$.index.open();
Attachments
File | Date | Size |
---|---|---|
hyperloop-android-1.2.9.zip | 2016-12-16T18:32:27.000+0000 | 5255856 |
ZSDK_ANDROID_API.jar | 2016-12-13T16:54:57.000+0000 | 481200 |
Any chance of a port to 1.x hyperloop? Our app is not 6.0 ready yet.
@gmathews Thank you for the backport, but I am seeing the same thing with it as well. I tried the same code as above with the same result when using the 1.2.9 provided {noformat} ERROR] : TiExceptionHandler: (main) [76155,111463] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,111463] - In print.js:21,13 [ERROR] : TiExceptionHandler: (main) [0,111463] - Message: Uncaught TypeError: Object [object com.zebra.sdk.printer.ZebraPrinter] has no method 'printImage' [ERROR] : TiExceptionHandler: (main) [0,111463] - Source: printer.printImage("/testPage.png", 0, 0); [ERROR] : V8Exception: Exception occurred at print.js:21: Uncaught TypeError: Object [object com.zebra.sdk.printer.ZebraPrinter] has no method 'printImage' {noformat}
as I keep looking for ways to get this project done, this seems to continue to happen, here is another example with java.util.Set
and here is the documentation https://developer.android.com/reference/java/util/Set.html#toArray()
Closing ticket as duplicate, the relevant ticket is linked above.