Printing by monodroid - android

I have a BIXOLON mobile printer, I can print by this device in windows mobile programs.
I want to print by this device in MONODOIRD applicaiton...
there is sdk, but the lib that use that sdk is java...
is any body know how can I print by this device in monodroid?!

Is your "lib" is a .jar file? If it is, bind it, which will make it accessible from C#.

after I read xamarin help about bindding jar file, I get some errors....
I listed in the end of this post...
I need this jar file compile completly...
Warning 1 missing class error was raised while reflecting com.bixolon.android.library.BxlService : android/hardware/usb/UsbManager
Warning 2 missing class error was raised while reflecting
com.bixolon.android.library.UsbLauncher : android/hardware/usb/UsbManager
Warning 3 For ConnectThread, could not find enclosing type 'BxlService'.
Warning 4 For ConnectThread, could not find enclosing type 'BxlService'.
Warning 5 For ConnectedThread, could not find enclosing type 'BxlService'.
Warning 6 For ConnectedThread, could not find enclosing type 'BxlService'.

Related

Android Studio C++ inline compiler doesn't understand smart pointer upcasting

My Android Studio inline compiler shows me an error when passing an unique_ptr of a derived class to a function expecting an unique_ptr of a parent class. But the code compiles as I was expecting.
The error message from the code snippet above:
Parameter type mismatch: Class 'std::unique_ptr<B>' is not compatible with class 'std::unique_ptr<A>'
I guess is this a bug, related to Android Studio ? I was wondering if there was an options for this error checker, couldn't find anything
EDIT: Note that this code compiles with no errors from the compiler (the error I quoted is from the Android Studio's real time error checker). You can check the code here: https://ideone.com/xlUsKs

android data binding: how to get useful error messages

In android studio 2.1, the compile time error messages from xml mistakes are entirely non-helpful:
Error:(11, 41) error: package mypackage.databinding does not exist
Error:(15, 13) error: cannot find symbol class MyActivityBinding
The real error would usually be something like "there's no such attribute android:adapter", or "variable foo doesn't contain property bar" or something like that. But instead of actually showing such errors, it shows the above unhelpful ones, which only tell you that the bindings weren't generated because of some unknown error.
The way I use in Android Studio 4.0:
Select the top level Build: failed item on the Build Output panel
On the right part click Run with --stacktrace. When build is finished select the top Build: failed item again on the left panel. You'll get a databinding error description on the right panel:
In my case it's:
[databinding] {"msg":"Cannot find a getter for \u003ccom.google.android.material.slider.Slider app:value\u003e that accepts parameter type \u0027java.lang.Float\u0027\n\nIf a binding adapter provides the getter, check that the adapter is annotated correctly and that the parameter type matches.","file":"SliderDatabinding\src\main\res\layout\activity_main.xml","pos":[{"line0":14,"col0":8,"line1":21,"col1":41}]}
Clink on Toogle View, under the 'Build' icon will give you details logs
There's no easy way for now. In general, if you face such compilation error and error messages point at missing databinding classes it is usually either bad reference from layout (i.e. you try to access members classes you assigned do not expose - usually happens when you c&p layouts).
Even worse, when you use other code generating libraries (Icepick, Butterknife, etc) then the real culprit can be often in code completely unrelated to binding. So when something like this occur in my code, I usually check Gradle Console view and read it from the end up, ignoring all error messages related to databinding like "missing class" or "package does not exists"
One way of getting the proper error is to run gradle in a terminal with '--info', like:
gradle :app:build --info
That's not exactly integrated into AS, so I can't really accept that answer.

Error building openframeworks for android: “ invalid use of incomplete type ‘class Poco::Path’”

I am trying to build an android application with OF. The application runs in two other computers. However, it does not work on mine. I am using a mac.
I run the command "make AndroidDebug" in the project folder, and this is the error I have:
/Library/openFrameworks/addons/ofxHTTP/libs/ofxHTTP/src/PostRouteFileHandler.cpp:98:46: error: invalid use of incomplete type 'class Poco::Path'
ss << Poco::Path(formFileName).getExtension();
I have installed poco, but nothing changes afterwards.
What can I do to solve this?
Thanks
Have you included Poco/Path.h?
A forward declaration might appeared earlier (possibly in another header) without complete definition.

"trouble writing output: Too many field references: 70185; max is 65536. You may try using --multi-dex option." when building Android project

I hit this error and found no hits for the error message, so I thought I'd share the solution I came up with to save anyone else facing the problem repeating my work.
When writing a new Android library (apklib) for use in a (large) application, I'm getting the following error during dexing when I add my new project as a dependency:
trouble writing output: Too many field references: 70185; max is 65536.
You may try using --multi-dex option.
References by package:
<...long list of packages with field counts elided...>
The particular build step it fails on is:
java -jar $ANDROID_SDK/build-tools/19.0.3/lib/dx.jar --dex \
--output=$PROJECT_HOME/target/classes.dex \
<... long list of apklib and jar dependencies elided ...>
Using --multi-dex as recommended by the error message might be a solution, but I'm not the owner of the application project and it already has a large complex build process that I would hesitate to change regardless.
I can reproduce this problem with a no-op test library project that has literally no fields, but in the error output it's listed as having 6000+ fields. Of the packages listed in the error output, there are a handful with similar 6k+ field counts, but then the vast majority have more plausible <1k field counts.
This problem is similar to the "Too many methods" problem that Facebook famously hacked their way around. The FB solution seems insane, and the only other solutions I've found (e.g., this Android bug ticket, or this one, this SO answer, this other SO answer) all involve changing the main app's code which is well beyond the scope of what I want to do.
Is there any other solution?
The solution was to change the package in the AndroidManifest to match the main application's package.
A manifest like this:
<manifest package="com.example.testlibrary" ...
resulted in 6k+ fields and build failure. Changing it to match the main application's package
<manifest package="com.example.mainapplication" ...
resulted in the project building successfully.
Note that only the package in the manifest is changing, I did not make any changes to the library's Java source or its layout (the Java package was still com.example.testlibrary with directory structure to match).
I hypothesize that the different package name is causing all the Android fields to be included again under that package. All the packages in the error listing with 6k+ fields had a different package name than the main application.
I also (later, grr), found this blog post which details the same problem and the eventual same solution.

XMLVM Android to iPhone Errors

The conversion of my Android application to the iPhone ObjectX environment as described in the XMLVM user manual works almost fine on my MAC, but I end up with 3 errors in the resulting XCode:
The first two errors simply relate to missing files, namely:
org_w3c_dom_Node.h
android_app_DatePickerDialog_OnDateSetListener.h
These are clearly not files from the converted Android application. Where can I get these from?
The third is an error that keeps coming up in the file
java_lang_String.h
The error message is:
typedef NSMutableString java_lang_String: redefinition as different kind of symbol
This error has been reported before in the XMLVM user group but as far as I know has never been answered sufficiently.
About the first error:
this is part of the Android API that has not yet been implemented.
This is the reason why it can't find the files.
Now, the second problem is not actually an error, but a warning and shouldn't stop you form compiling.
If it does, it means that in your project you have set the option to make errors from these types of warnings.
You can safely turn this off and completely ignore this warning.

Categories

Resources