Code Monkey home page Code Monkey logo

nativescript-hprt's People

Contributors

boyombo avatar davorpeic avatar subhojit-me avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nativescript-hprt's Issues

Discover devices

Hi, thanks for you're grate plugin.
I use this plugin and can connect and use but just can connect to paired devices.
how can discovering unpaired devices?

iOS Devices

I know it's not tested, but it should work?

IOS Device[Urgent]

I need using Android and IOS device to print the recipe, and I tested in nativescript-star-printer , it no support using Xprinter printer. Currently I using this plugin to print at android is no problem but IOS can't , is it this plugin still got update ?

Printing Multi languages, Images, Barcode and QR Code

Hi,

I would like to build these functionalities with this Plugin. Guide me how to implement below features. Appreciate your help on this.

  1. Multi language print capability
  2. Image printing from URL
  3. Barcode/ QR code printing

Thank you.

Error: com.tns.NativeScriptException: Failed to find module: "./workers/enable-bluetooth", relative to: app//

Hi everyone, I'm trying to use a thermal printer but I keep on getting the below error.

The application can connect to the bluetooth printer.
I've also installed other applications from the playstore on my phone just to see if I can print on the thermal printer and they all can print however, when I use this lib, my application cannot print.

I have created a folder under *project/src/app/workers and also created files(enable-bluetooth.js, connect-printer.js)

  • Any ideas?

JS: Error Error: com.tns.NativeScriptException: Failed to find module: "./workers/enable-bluetooth", relative to: app//
JS: Printer found = {
JS: "portName": "A0:E6:F8:34:1E:99",
JS: "modelName": "XX706*"
JS: }
JS: Connect error Error: com.tns.NativeScriptException: Failed to find module: "./workers/connect-printer", relative to: app//
JS: ERROR Error: Uncaught (in promise): Error: java.lang.NullPointerException: Attempt to invoke interface method 'int HPRTAndroidSDK.IPort.WriteData(byte[], int)' on a null object reference
JS: push.../node_modules/nativescript-hprt/hprt.js.Hprt.horizontalLine(file: node_modules/nativescript-hprt/hprt.android.js:204:0)
JS: at webpackHotUpdate../app/home/home.component.ts.HomeComponent.printText(file: src/app/home/home.component.ts:138:18)
JS: at webpackHotUpdate../app/home/home.component.ts.HomeComponent.connect(file: src/app/home/home.component.ts:79:13)
JS: at HomeComponent(file: src/app/home/home.component.ts:63:13)
JS: at createClass(file: node_modules/@angular/core/fesm5/core.js:21158:0)
JS: at createDirectiveInstance(file: node_modules/@angular/core/fesm5/core.js:21027:0)
JS: at createViewNodes(file: node_modules/@angular/core/fesm5/core.js:29387:0)

Update to V1.01PRO

I have the 1.0.1.1801PRO.jar for hprt. The jar is missing the header files though that this version has. Been trying to work on an updated version for this plugin but not having much luck. How did you generate the header files from the given jar?

HPRT connects to all paired devices even when they are off

Hi @krushkamx

First of all, thank you for the great plugin, it has helped us immensely on the current project.

I am trying to connect to multiple devices but iterating through the search printer results I realise that the results are basically all devices paired in the past, and when I connect with the results using HPRT.connect(result) it basically allows me to connect even when the device is switched off - that is to say, even for the devices that are switched off it goes in the then() instead of catch(). Can you please shed some light on this, is this expected behaviour.

Regards

Rahul

doesn't support vue?

Hi, this plugin doen't work with nativescript-vue.
will there be updates?
Thanks in advance
P

Printing of images

Hello excellent framework has helped me a lot in what I need, would you know how to print an image using the sdk? I would really appreciate it very much.

I have obtained this document but I have not managed to make it work, it is also possible to print an external image through some url.

Android_ESC_SDK.Manual.pdf

Unable to connect to bluetooth printer

Hi,

I added the config as mentioned in the above documentation.. I also see it is getting copied in webpack.. but still same issue

app/workers/connect-printer.js 321 bytes [emitted] bundle.js 43.6 KiB bundle [emitted] bundle package.json 2.31 KiB [emitted] runtime.js 77.1 KiB runtime [emitted] runtime tns-java-classes.js 0 bytes [emitted] vendor.js 17.2 MiB vendor [emitted] vendor Entrypoint bundle = runtime.js vendor.js bundle.js [../$$_lazy_route_resource lazy recursive] ../$$_lazy_route_resource lazy namespace object 160 bytes {bundle} [built] [./app.css] 1.2 KiB {bundle} [built] [./app/app-routing.module.tns.ts] 1.39 KiB {bundle} [built] [./app/app.component.tns.ts] 7.25 KiB {bundle} [built] [./app/app.module.tns.ts] 1.73 KiB {bundle} [built] [./app/auto-generated/auto-generated.component.ts] 1.15 KiB {bundle} [built] [./main.tns.ts] 2.31 KiB {bundle} [built] [~/package.json] external "~/package.json" 42 bytes {bundle} [optional] [built] + 563 hidden modules Webpack compilation complete. Watching for file changes. Webpack build done! Updating runtime package.json with configuration values...

Able To connect to printer not able to print using Zebra imz320 printer

Hi,
I have created new application in that i need printing option using its Bluetooth feature in both android and ios app in native-script(typescript) , currently i am using nativescript-hprt plugin to print simple text using Zebra imz320 printer but i am not able to print anything, its connecting to printer successfully but when i try to print it shows success but nothing is printing .
Any help would be appreciated

Thank you

Cannot connect to printer

I'm using nativescript vue with webpack.

The module is installed, and searchPrinters() is working, but when I try to connect a printer I got this error:

'Connect error' [Error: com.tns.NativeScriptException: Failed to find module: "./workers/connect-printer", relative to: app// JS: com.tns.Module.resolvePathHelper(Module.java:146) JS: com.tns.Module.resolvePath(Module.java:55) JS: com.tns.Runtime.callJSMethodNative(Native Method) JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116) JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:996) JS: com.tns.Runtime.callJSMethod(Runtime.java:983) JS: com.tns.Runtime.callJSMethod(Runtime.java:967) JS: com.tns.Runtime.callJSMethod(Runtime.java:959) JS: com.tns.gen.android.content.DialogInterface_OnClickListener.onClick(DialogInterface_OnClickListener.java:17) JS: com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:1168) JS: android.widget.AdapterView.performItemClick(AdapterView.java:321) JS: android.widget.AbsListView.performItemClick(AbsListView.java:1217) JS: android.widget.AbsListView$PerformClick.run(AbsListView.java:3203) JS: android.widget.AbsListView$3.run(AbsListVi...

I don't know if it is a bug or I'm not using it correctly, but I will be grateful for solution suggestions.

Cannot find module rxjs/Observable

Hi!! im trying to create an app with svelte native, to use on sunmi V2 pro android device, but im getting this error when install this script.

Error: Cannot find module rxjs/Observable File: (file:///data/data/org.nativescript.posprint/files/app/vendor.js:53249:89)
I also had the following error: Error: Cannot find module 'utils/utils' which I think I have solved with

webpack.chainWebpack((config) => {
config.resolve.alias.set(
"@nativescript/core/utils/utils",
"@nativescript/core/utils"
);
config.resolve.alias.set("utils/utils", "@nativescript/core/utils");
config.resolve.alias.set(
"tns-core-modules/utils/utils",
"@nativescript/core/utils"
);
config.resolve.alias.set("tns-core-modules", "@nativescript/core");
});

Any idea how I can solve these problems?

Error: android.os.NetworkOnMainThreadException

Hi, I'm facing an issue to print. I modified the code to connect to a wifi printer. It's connected but it caused an error when I try to print. am I missing something? Is it because some settings for bluetooth? I don't have any idea

System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onClick failed
System.err: Error: android.os.NetworkOnMainThreadException
System.err:
System.err: StackTrace:
System.err: Hprt.printText(file: node_modules/nativescript-hprt/hprt.android.js:190:45)
System.err: at invokeWithErrorHandling(file: node_modules/nativescript-vue/dist/index.js:3364:25)
System.err: at invoker(file: node_modules/nativescript-vue/dist/index.js:4030:13)
System.err: at Observable.notify(file: node_modules/@nativescript/core/data/observable/observable.js:110:22)
System.err: at Observable._emit(file: node_modules/@nativescript/core/data/observable/observable.js:127:17)
System.err: at ClickListenerImpl.onClick(file: node_modules/@nativescript/core/ui/button/button.android.js:29:22)
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1134)
System.err: at com.tns.gen.java.lang.Object_vendor_18382_26_ClickListenerImpl.onClick(Object_vendor_18382_26_ClickListenerImpl.java:18)
System.err: at android.view.View.performClick(View.java:6308)
System.err: at android.widget.TextView.performClick(TextView.java:11202)
System.err: at android.view.View$PerformClick.run(View.java:23969)
System.err: at android.os.Handler.handleCallback(Handler.java:751)
System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: at android.os.Looper.loop(Looper.java:154)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6823)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
System.err: Caused by: android.os.NetworkOnMainThreadException
System.err: at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1303)
System.err: at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
System.err: at java.net.SocketOutputStream.write(SocketOutputStream.java:157)
System.err: at HPRTAndroidSDK.WiFiOperator.WriteData(WiFiOperator.java:210)
System.err: at HPRTAndroidSDK.WiFiOperator.WriteData(WiFiOperator.java:192)
System.err: at HPRTAndroidSDK.HPRTPrinterHelper.PrintText(HPRTPrinterHelper.java:2394)
System.err: ... 17 more

java.lang.NullPointerException when printing

i using demo version and migrate to latest version, all connect is fine but when printing will shown out the error message

JS: ERROR Error: java.lang.NullPointerException: Attempt to invoke interface method 'int HPRTAndroidSDK.IPort.WriteData(byte[], int)' on a null object reference

JS: HPRTAndroidSDK.HPRTPrinterHelper.PrintText(HPRTPrinterHelper.java:2394)
JS: com.tns.Runtime.callJSMethodNative(Native Method)
JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
JS: com.tns.Runtime.callJSMethod(Runtime.java:1109)
JS: com.tns.Runtime.callJSMethod(Runtime.java:1089)
JS: com.tns.Runtime.callJSMethod(Runtime.java:1081)
JS: com.tns.gen.java.lang.Object_vendor_115390_32_ClickListenerImpl.onClick(Object_vendor_115390_32_ClickListenerImpl.java:18)

JS: android.view.View.performClick(View.java:6663)
JS: android.view.View.performClickInternal(View.java:6635)
JS: android.view.View.access$3100(View.java:794)

JS: android.view.View$PerformClick.run(View.java:26199)
JS: android.os.Handler.handleCallback(Handler.java:907)
JS: android.os.Handler.dispatchMessage(Handler.java:105)

is it need use new hprt jar file or ?

Printing of images

it worked for my printer but i am still trying to figure out how to print an image..please kindly help me ?..ill really apreaciate it

Isn't support vanilla Nativescript?

Hi,
I using hprt plugin in valilla nativescript but the error occur. But I try in angular nativescript, it work.

"nativescript": {
    "id": "org.nativescript.testing",
    "tns-android": {
      "version": "3.4.1"
    }
  },
  "dependencies": {
    "nativescript-hprt": "^0.9.7",
    "nativescript-pro-ui": "^3.3.0",
    "nativescript-theme-core": "~1.0.4",
    "tns-core-modules": "~3.4.0"
  }

var Hprt= require("nativescript-hprt");

I just put inside this code then error occur.

System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.testing/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Failed to find module: "rxjs/Observable", relative to: app/tns_modules/
System.err: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2464)
System.err: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
System.err: 	at android.app.ActivityThread.access$900(ActivityThread.java:154)
System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: 	at android.os.Looper.loop(Looper.java:224)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:5526)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)

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.