I'm trying to use CameraX and MlKit to read barcodes but I get the following error when I try to build my app :
Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules jetified-kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and jetified-kotlin-stdlib-jdk8-1.6.0 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0)
Does anyone know where this problem could come from and how to solve it?
And could anyone tell me where I could find a comprehensive CameraX doc using Java and not Kotlin?
Check out this site for the java coding of camerax:
https://learntodroid.com/how-to-create-a-qr-code-scanner-app-in-android/.
I use ML-Kit instead of zxing and it works well.
Related
I'm trying to make an app which creates a DICOM file. There is a java library called PixelMed. I tried to use it in my Android project but when accessing methods from the library I get
Failed resolution of: Ljavax/imageio/stream/FileImageInputStream
From what I found I get this because javax is not a part of Android SDK. My question is: Is there a way to somehow import this library or make the PixelMed work on Android?
Thanks in advance.
I am currently working on a java project on face detection. I am using OpenCV API opencv_310 available at the official site and started writing the program following
this tutorial
But the main problem is that this tutorial was written more than five years ago. So the OpenCV APIs and working procedures have changed over the years. So I encountered a problem regarding the file haarcascade_frontalface_alt.xml.
new CvHaarClassifierCascade(cvLoad(FACE_CASCADE_PATH));
This line of code throws the following exception:
OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file ........\opencv\modules\core\src\persistence.cpp, line 4991
Exception in thread "main" java.lang.RuntimeException: ........\opencv\modules\core\src\persistence.cpp:4991: error: (-2) The node does not represent a user object (unknown type?) in function cvRead
So I browsed the Internet for a while and found this. It says the old C API does not support the newer haarcascade format. It also suggests to try with the C++ API.
What should I do now? I don't know how to try the C++ API. It will be highly appreciable if you can give some instructions on how to deal with the problem.
Thanks.
Try checking this tutorial which is from opencv site. This has a link to the source code. The xml file which you have trouble is the trained data.. if you would like to just download this file, you can find it here
regards
guys, I'm looking for the source of the official android keyboard code but whenever I find in the official repositories, it is always with missing classes. I wonder where I can find the source (which is open), this terclado to be able to create and modify it and that works in versions 2.2 to the last.
I want to create an application where I can customize the layout with specific colors, etc. audio inputs and the like.
They could help me? I know it's maybe my question is not appropriate but do not give negative to block my account.
I just want to know where I can get the full source google Keyboard customize for me, but whenever I think, is missing classes at SRC.
thanks
Repos you can use
AnySoftKeyboard.git
LatinIME
A quick and concise google search is all you need to get what I just got. The first one is open source so it should be properly documented. The second one has a weird layout, but I don't use Google Source, so I wouldn't know how well it works/functions.
I'm trying to make a control flow graph with the soot API from an Android APK. I have read a lot but i feel a little bit helpless how to start from scratch. I'm using a nighty build of soot (downloaded here: https://ssebuild.cased.de/nightly/soot/lib/) because I read that version 2.5.0 is outdated. I found a lot with google, for example:
https://mailman.cs.mcgill.ca/pipermail/soot-list/2014-September/007303.html
First I need to load the Android APK file. On the link it's done with:
SetupApplication app = new SetupApplication(...)
But thats already the first problem, there is no SetupApplication in the nightly build soot.jar.
I did it with the command line, like here:
http://www.abartel.net/dexpler/
that worked almost, but building the control flow graph is only the first step. After that I have to manipulate the graphs and use it as an input for some other framework. So command line is no option for me. I would prefer to do it with Java!
Can someone help a soot newbie?
For getting call graph through Soot, try the Soot lib located at https://github.com/secure-software-engineering/soot-infoflow-android instead.
Then import soot.jimple.infoflow.android.SetupApplication in your Java source code.
Everything should be fine.
I am having trouble with nonfree methdos usage in android. SIFT and SURF methods are not included in opencv-android-2.4.8. They are needed to be complied seperately.
https://sites.google.com/site/wghsite/technical-notes/sift_surf_opencv_android
This is the main tutorial about nonfree module compilation. However, the jni part for java users are not included. I have searched how to use compiled .so libraries but I could not achieve.
I wonder that someone can share the jni part for nonfree modules or detailed explanation for it, because I work on that issue over a week and I could not do it.
Thanks.
I am the author of the tutorial. I will be adding another tutorial showing the JNI part. Hope that will help. Please go back and check the tutorial in the next couple of days. I will post it soon.
I solved the problem. When you follow the tutorial(the link given in the question) you get the necessary libraries(.so files). In order to use them in java you do not need to implement jni part. When you load the libraries in your java code (System.load(libraryName)), then you can use sift and surf methods like the other detectors or descriptors. You can directly use the code pattern supplied by the opencv-2.4.8.
Assuming that you've already gotten OpenCV 4 Android to work on your Android device;
1) I placed libnonfree.so, libopencv_java.so and libgnustl_shared.so (not sure if the last one is needed) in the correct folder for your platform, in my case jniLibs/armeabi-v7a. Already compiled version can be find in the demo folder here; https://github.com/bkornel/opencv_android_nonfree
2) Make sure you load both libraries.
static {
System.loadLibrary("opencv_java");
System.loadLibrary("nonfree");
}
This was all that was required in order for it to work for me.
#fetifati, Do you mean to say that if I copy libnonfree.so and libopencv_java.so in say lib/armeabi folder and do System.load("nonfree"); System.load("opencv_java"), I can use code like:
private static final FeatureDetector detector = FeatureDetector
.create(FeatureDetector.SIFT);
private static final DescriptorExtractor extractor = DescriptorExtractor
.create(DescriptorExtractor.SIFT);
directly ? ... It doesn't seem to work for me. I am getting some errors.