lafras-h / javaprintooth Goto Github PK
View Code? Open in Web Editor NEWExample of using Printooth in Java
License: MIT License
Example of using Printooth in Java
License: MIT License
Hi, We know that startActivityForResult deprecated. So now, how can we pass the SCANNING_FOR_PRINTER value to intent and check this with requestcode. Cause it's result doesn't provide requestcCode.
i'm using
implementation files('libs/lambdaj-2.4-with-dependencies.jar')
implementation ('com.github.mazenrashed:Printooth:1.2.1')
So i'm gettig Error: Program type already present: org.objenesis.ObjenesisBase this Error.
to fix this issue i tried below and it's successfully compiled
implementation ('com.github.mazenrashed:Printooth:1.2.1'){
exclude group: 'org.objenesis'
}
But when i'm trying to use Printooth.INSTANCE.hasPairedPrinter() then it's throwing bellow errror
java.lang.NoClassDefFoundError: Failed resolution of: Lsun/reflect/ReflectionFactory;
at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.(SunReflectionFactoryInstantiator.java:40)
at org.objenesis.strategy.StdInstantiatorStrategy.newInstantiatorOf(StdInstantiatorStrategy.java:85)
at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1323)
at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1127)
at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1136)
at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:562)
at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:71)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:734)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:543)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:712)
at io.paperdb.DbStoragePlainFile.readContent(DbStoragePlainFile.java:307)
at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:285)
at io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:158)
at io.paperdb.Book.read(Book.java:73)
at com.mazenrashed.printooth.data.PairedPrinter$Companion.getPairedPrinter(PairedPrinter.kt:14)
at com.mazenrashed.printooth.Printooth.hasPairedPrinter(Printooth.kt:58)
at com.shapemore.btprinterdemo.MainActivity.onCreate(MainActivity.java:42)
at android.app.Activity.performCreate(Activity.java:6666)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
at android.os.Handler.dispatchMessage(Handler.java:110)
Hello poeple,
Actually i'm working on appcliation which use a Bluetooth printer but i have some issues when i want to print arabic words.
i know that this library support arabic language but my probléme is when i print an arabic words i find that the word is not fully correct.
for example :
Arabic word = سلطان
when i print this word i get = سلط ان
i want to know if this issues is due of printer or the library please i want your help.
thank you
i am trying to find devices in android 10 but dont find any. the problem is in android 10.
i can buy to you the update that solve this problem.
[email protected] yo could write to me
Activity com.mazenrashed.printooth.ui.ScanningActivity has leaked IntentReceiver com.mazenrashed.printooth.utilities.Bluetooth$3@c87d4f8 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Activity com.mazenrashed.printooth.ui.ScanningActivity has leaked IntentReceiver com.mazenrashed.printooth.utilities.Bluetooth$3@c87d4f8 that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.(LoadedApk.java:1390)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1150)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1426)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1399)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1387)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:609)
at com.mazenrashed.printooth.utilities.Bluetooth.startScanning(Bluetooth.java:198)
at com.mazenrashed.printooth.ui.ScanningActivity$onStart$1.run(ScanningActivity.kt:114)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6748)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:867)
2020-06-29 16:53:04.825 758-1084/com.shubham.printingapplication E/AndroidRuntime: FATAL EXCEPTION: Thread-2
Process: com.shubham.printingapplication, PID: 758
java.lang.BootstrapMethodError: Exception from call site #1 bootstrap method
at com.mazenrashed.printooth.utilities.Bluetooth$ConnectThread.run(Bluetooth.java:328)
Caused by: java.lang.NoClassDefFoundError: Invalid descriptor: mListener.
at com.mazenrashed.printooth.utilities.Bluetooth$ConnectThread.run(Bluetooth.java:328)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.