zXing runtime error in Android - java

I'm trying to integrate zXing into my Android app.
I've created a new project from the "android project", set it as a library and insert the core.jar.
I've also have import it the project as a library into my app and insert the core.jar too, but when I launch my Intent, I keep getting this:
RuntimeException: Unable to resume activity
I've read all the posts and tutorials, and I mean it, ALL of them, but I get no solution.
Can anyone help me please?
Kind regards and thanks for advance.

Do one thing change the library project folder to the sdk location for this you have to make one folder which is extensions and then put zxing library file in to it and then import that all library in to you project explorer and then give the reference of library again and you can also follow this below site .....
http://www.androidaz.com/development/zxing-qr-reader-direct-integration

Related

How to fix packaging error in Aide (mobile IDE)?

I am creating android application using Aide (mobile ide).
My project has no errors but when I run the app, during building APK it displays an error dialog with message :
'Packaging error: com.blankj.utilcode.util.ReflectUtil sSReflectException: java.lang.refle ct.InvocationTargetException
'.
This has happened when I added these two libraries in my project:
Dexter library : to handle runtime permission in android
KingsMentor library : to scan barcode or QR code
Please help me how do I fix it?
Now I know where the actual bug is.
If the same happens to you then kindly note that it is due to the 3rd party library that you are using in your project.
So the solution is to remove that library from your project and try another one , moreover try to code from scratch for that task if possible instead of using such libraries.
It happens because those libraries use another library or libraries.
Hope it helps you.
Happy coding :)

Importing a GitHub project to Android Studio

As recently, I've been looking through Android Templates for Material UI design, as I want to get a feel on how to use the types of pieces in one. But, It's been a struggle. Every one I've done, I got an error when building the module. AndroidManifest.xml Not Found
I've looked every where, and it all doesn't apply to me. I am attempting to import a repository from GitHub to Android Studio, all updates installed. Here were my steps.
Clone the project into a .zip file.
Extract.
Import into Android Studio.
Import Gradle Files.
Configure framework.
All works, but only option to generate signed APK, normal apk, and build module.
Build Module.
Android Manifest isn't found.
Is there something I'm missing? Please let me know, as I am stuck. I've also read I need a local.properties file. I do not have it, so I do not know how to properly add it without messing up.
Thank You.
Refer this, How to import an existing project from github into Android Studio.
Still not convinced?.
Try these, https://github.com/rdrobinson3/WelcomeToL/issues/2 and https://github.com/google/beacon-platform/issues/24

Downloading a libgdx Project Gradle Problems

So my friends and I are making a game for Android and we are using Android studio. We are using libgdx. We are also learning how to use github. Anyways, using Android Studio, I uploaded the basic libgdx setup. The one that just displays the Bad Logic image. My friend downloads it from github using Android studio but there are errors everywhere. It says that it can't find the badlogic package and it gives the following error:
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
I know that libgdx uses gradle. So what is the problem? Why can't we simply upload and then download a simple project?
Thanks!
Try to remove the .gradle directory and re-import the project or use the Setup App Installer from here to create a new gradle project.
Thanks for the help! I finally figured it out.
Basically, when I imported the project, I was just importing with existing project files. These are the steps I took to get it fixed.
Check out from Version Control using Android Studio and the welcome screen.
When asked to open, say NO.
Go to the folder that is associated with the repo.
Create a local.properties file there and in that file it should have
sdk.dir = /YOUR/PATH/TO/SDK/HERE
Then go back to Android Studio.
Click Import Project and select the folder that has it in there.
From then on, it should work forever as the .gitignore file that is generated by libgdx will ignore the local.properties file when pushed. I hope this helps someone!

how to import ZXING library in android application?

I need to implement ZXING QR code scanner in my application.
I have complete source code for ZXING Android.
Now, I want to use this in my application.
my question is that should I copy all ZXING library code in my application including manifest,xml and java files or I can have a jar file which I need to just add in my application?
Can anybody tell me how to create jar file from android code, or is any ZXING jar already available which I can just include in my application?
http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/
Thats a step by step guide to natively integrating. It integrates the zxing project into yours as a backup of sorts. You will send out an intent request, but your application is registered as a receiver of that request. If the user doesn't have a different scanner, yours will be the only option. If they have other scanners it will allow the user to choose. If you want your app to always be chosen without another option, the comments in the tutorial detail how to change the intent filter to do it.
Keep in mind this is the quick and dirty way to do it. As others have mentioned, ZXing provides a great tutorial on how to send a barcode intent out and point them to the market if they don't have a scanner.
If all you need to do is scan a barcode...then you can simply do it via intents.
Check this page for a tutorial on scanning via intents.
In Zing library you only need the android/ and the core/ projects . ZXING library code doesn't have core.jar file.
You have to create core.jar file manually from the command line only (can be a ​bit tricky) so download core.jar alone from this link
core.3.2.0 download
then need to add the core.jar file into our project.
add this dependency in app level gradle
'com.google.zxing:core:3.2.0'
REFERENCE site
Integrate zxing barcode
QR code using ZXing library
You would never want to copy the android/ code completely. If anything, you want to compile the core/ code, and place the resulting core.jar in your project's libs/ folder. Then, you have access to the core scanning code in your project.
But, it is far easier to integrate via Intent as Archit says.
There is a project in github which was embedded in an android application and it is compatible as android studio project;
https://github.com/journeyapps/zxing-android-embedded
If you live a problem about gradle when you run above project, you can use below project which is same project but there is not any issue about gradle file;
https://bitbucket.org/_oguzhan/ocrandroid

Convert an java file into android program

hi i am a new android developer. When i am searching for a logic related to my app in google, i found a java application which is related to my android app. After making some changes i succeded in getting output, but i need the code to be in an android based project. When i change to convert it i get lot of errors, is there any possible way to convert the java application into an android app by including any external jar file..... The java application is just a part of my android app, based on that i have to develop more so pls help me....
thanx in Advance
If you intend to include external Java code via .jar files, that is supported in Android. Just put the file into the libs/ directory of your Android project and use the classes as you would somewhere else.
If you are using Eclipse IDE, this might help:
After including the .jar files in the libs/ folder, right click on the required .jar file and select "build path", then click on "add to build path". After doing this, u'll notice that the .jar file is added in the "Referenced libraries" in your project. Once done, you are all good to go and import methods from these files. Hope that helps you remove your errors. Happy coding. :)

Categories