How to include and use ZXing Library in Android with eclipse? - android

I am new to the concept of ZXing,so i want to know the step by step process to use the ZXing in android and i am using elicpse as IDE.Any one knows about it please help me.

As advised by the moderator, I am posting what did to import zxing into my android app, on this post. Seems like many people refer to this post to get an answer for zxing.
The zxing guys have made it easier to create a android project with 1.7. Its not as painful as it used to be. This is a quick blog for anyone who would like to create a zxing project for android quickly.
Checkout the zxing sources from zxing.org
Create a Android project on your eclipse
Delete main.xml
Right click on “src” directory and hit import. Browse to the following directories in the order mentioned. As you add them for
import one by one, ensure that you have the src directory in the edit
field of the import wizard. And that you select only the “com”
directory on the left directory tree. Do not select src.
core
android-integration
android
Ensure that your android sdk version is 9, anything lesser and androidmanifest.xml will cry.
Strings.xml in one of the languages will crib, just put a / before the ‘ character
For the benefit of people,
I have a android hello world integrated with zxing 1.7 http://www.4shared.com/file/bFx8Y5Ys/zXingJune2010.html
Another blog that has interesting direction for integrating zxing
http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/

Related

How to Import Sample ApiDemos into Android Studio 1.5.1

At the end of http://developer.android.com/guide/components/fragments.html is stated "For more samples using fragments (and complete source files for this example), see the API Demos sample app available in ApiDemos (available for download from the Samples SDK component)."
However, ApiDemos is not listed anywhere among the hundreds of items when I try to Import sample... in AS 1.5.1. ADVANCED ApiDemos is listed, but the description says this is NOT what I seek.
It sure would be nice to accomplish this task in one step as advertised instead of having to download each individual file (and worry if the app will work because of some omission) from https://github.com/googlesamples/android-ads/tree/master/APIDemo.
Is there a way to Import sample... ApiDemos somehow?
You can download an archive of ApiDemos directly from here.
https://android.googlesource.com/platform/development/+/master/samples/ApiDemos
Not sure if there is a direct git link, because as you can see, it is under the sample directory of the platform/development repository.
You are more than welcome to clone the whole 300+ MB of the android-development repository and get access to ApiDemos (and much more) like so
$ git clone https://android.googlesource.com/platform/development android-development
$ cd android-development/samples/ApiDemos
There is no samples folder under android sdk for Android Studio 2.1.2. I ended up getting API folders from the link provided by #cricket_007. Also, don't waste time looking for the Fragment sample code in https://github.com/googlesamples because its not there. It only has the latest sample codes.
A reasonable place to find help with Fragment is on one's own computer:
...\AppData\Local\Android\sdk\samples\android-17\ApiDemos\src\com\example\android\apis\app
A search for ArticleReaderFragment (a Fragment in the tutorial) in the parent folder C:\Users\Dov\AppData\Local\Android\sdk\samples\android-17\ApiDemos turned up nothing, so the sample code in question isn't there, but lots of Fragment*.java files could be profitable in one's self-education on the topic.
While not stored with any app, lots of xml files can be found here:
...\AppData\Local\Android\sdk\samples\android-17\ApiDemos\res
FragmentLayout.java is reasonably close to the app in the tutorial.

How to display the documentation for the support libraries inside Android Studio?

When I use the command 'Quick Documentation' in Android Studio in a class that comes from one of the support libraries (e.g. ActionBarActivity), the IDE does not show the documentation for the class. If I use it on one of the classes from, say, the Android API 19 (e.g. Activity), the IDE displays the complete documentation as is shown in the reference page on https://developer.android.com/reference/packages.html.
Is there any way to add the documentation for the support libraries to Android Studio so that they can be accessed through 'Quick Documentation' as well?
When Android Studio has opened the decompiled jar class, click on "Download..." blue link at top right, this will download jar with javadoc and save it in :
/.ideaLibSources
rebuild project if necessary, now doc is available.
Tested on android studio 2.0 preview 4.
If you are not using Gradle, this will be easier for you.
Go to File -> Project Structure. From there, on the left-hand side, select Libraries. Select the library you want to add source/java-docs to, then click the plus at the bottom and add the source and/or java-doc jars. There's a chance AS will automatically know what's what.
If you're using Gradle, more than likely in Project Structure, you won't see the Libraries tab, and I'm sorry but I don't know how to help from that point. If you use Gradle, AS detects that and takes away "unnecessary" options. Sorry to send you searching again, but I know there's something called a .properties file for jars that tell the source and java-docs, but I haven't implemented it. If I can find the page that told me that information, I'll update this.
EDIT: The answer is here. This should help you out.

OpenCV Circle Recognition in android devices

I am new to android app development. I need to develop a very simple app that could detect coloured circles.Can someone please tell me in detail how to use openCV Circle Recognition code in developing a simple android app that can detect coloured circles. I am currently using openCV+ Eclipcs but it does not allow me to compile the source code in to .apk file
I have already done what u are saying...I have done the following
I download the full NVidia tegra-devpack-2.0-windows-2013-02-06-14961502 and installed It contains both android ADT for eclipse and eclipse also. It also contains the open CV and it automatically configures everything.
Everything works fine when I make a new android app like “my first HELLO WORLD app” and I can even install it to my android phone that means everything is working fine and everything is configured correctly.
The problem arises when I try to import the source code of the “CVCamera” an common app for detecting circles in android devices
When I import it in the eclipse as an android project from existing code it gives me following 2 errors
(a) Project 'CVCamera' is missing required Java project: 'OpenCV'
(b) The project cannot be built until build path errors are resolved.
I have tried lots of things I even tried to link the open CV library to the project but of no use
I have a simple objective I want to develop an android application for detection of coloured circles by using the already available code on the web. Please help me in achieving the following
I am using openCV4android . I can even create new apps but the problem arises when i try develop the application by using already made source code. I am using the sources code of the CV camera app which has been already developed by so many developers Following is the link of the error I am getting in the eclipse.
Please see the image
Following is the link of the CV camera application which I am trying to import
stanford.edu/class/ee368/Android/OpenCV/CVCamera_Canny.zip
Here is the link for another error “Build path entry is missing: OpenCV”
image
building workspace problim image
Use opencv4android in eclipse.
Before that you should deploy android ADT for eclipse, or download bundle for android dev.
Then follow the tutorial at opencv official site to start your way to android.
Use hough transform for circle detection.
You must link JavaCV lib into your project rather than OpenCV.
Android app cannot use OpenCV(C++) unless you use JNI, which is far beyond the scope of this question.
So please follow the tutorial for using JavaCV on Android rather than doing the import stuff on your own. Please make some JavaCV examples compile and run on your phone before you try to adapt the code.
Besides I strongly recommend you use openCV4android, which is sure to work, rather than JavaCV + Android, which takes your considerable time coping with configuration and integration.

How does android source code work?

I have download a set of android source code, which has folders such as "bionic, bootable, build, dalvik, development, frameworks, hadware, packages, prebuilt" and so on. When I browse the whole code, wonder how "import android.preference.PreferenceActivity;" works in Settings.java(D:\android-srce\Google-source\packages\apps\Settings\src\com\android\settings\Settings.java). I guess there is a android.jar file somewhere after compilation. But how does Settings.java import PreferenceActivity correctly?? I'm a beginner in Android, please help me.
Sounds like you have downloaded the source code to the Android OS. If you want to build your own ROMS then you need to study about building the OS for a particular hardware platform. This is not trivial.
If you want to build an Android app that runs on an Android device then you want to download the SDK instead - start at Android SDK and follow your nose, buy a book, read the sample code.
There is not a lot of information how to change parts of Android. However, you can read information that is connected with the aosp tag. The first cite is source.android.com After the installation of android build system you can see video from marakana group. You'll find a lot of valuable information there.

Using third party libraries in android project

I am just starting off with android and have been googling high and low to find any tutorials/resources that could answer my beginners questions.
How can import a third party resource into my project and start using it?
For example, i wanted to use scrollableTabActivity, a widget that's available at https://github.com/honcheng/ScrollableTabHost-for-Android. I have downloaded and it looks like it is a project by itself. How can import into into my project and start using it?
This is the case of even projects like droid fu, for the life of me i could not figure out how to add them and start using in my project.
I did successfully added asynchttp into my project cause there was .jar download available. But for projects like droid-fu or scrollableTabActivity, how can i use the source files to add the functionality into my project?
Any help is highly appreciated
Thanks
Add the projectyou downloaded to you workspace.
Right click on it, properties, Android and be sure the Is Library checkbox is checked.
Then in your project, right click, properties, Android and click on add on the bottom right to add the previous project.
The project you refer to actually contains a lot of demonstration code which shows you how to use the ScrollTabHost control in your app. Rather than trying to include this stuff which will just bloat your app, simply copy the ScrollTabHost.java file in to your project, along with any resources upon which it depends.
I agree with Mark Allison's answer. But generally speaking to import a whole project in Eclipse, check the box next to that third party project name on the Project References tab in your project Properties.

Categories

Resources