Home Database Mysql Tutorial zxing 2.3 生成jar包,并使项目正常运行

zxing 2.3 生成jar包,并使项目正常运行

Jun 07, 2016 pm 03:26 PM
jar zxing Down normal generate run project

下面我写的教程修改自sonikk的csdn博客http://blog.csdn.net/sonikk/article/details/9228481在此向博主sonikk表示敬意! 下载后解压缩ZXing-2.3.0 目录当中我们用的文件夹有: android ——这是一个Android的示例工程 android-integration ——这是使用QR码



下面我写的教程修改自sonikk的csdn博客http://blog.csdn.net/sonikk/article/details/9228481在此向博主sonikk表示敬意!

下载后解压缩ZXing-2.3.0

目录当中我们用的文件夹有:

android ——这是一个Android的示例工程

android-integration ——这是使用QR码工程需要引用的一个源码

androidtest ——这是一个Android的简单测试工程,好像是需要先安装android目录中的应用才能运行

core ——这是核心代码

其它文件夹都用不到的。。。

第一步:

下面将android目录下的工程带入Eclipse

包名:com.google.zxing.client.android

默认工程名:CaptureActivity

第二步:

导入引用代码:

右键工程名 -> Properties -> Java Build Path -> Source -> Link Source... -> 用browse..按钮

选择ZXing-2.3.0\core\src\main\java这个绝对路径,起名core

选择ZXing-2.3.0\android-integration\src\main\java这个绝对路径,起名android-integration

(名称需要手动修改,可以起不一样的名字,但是我个人感觉这样命名比较合理)

第三步:

清除android-integration路径下的IntentIntegratorSupportV4.java文件的报错:

我把android的Project Build Target改成了4.0.3(API-15)并在其他的项目的libs中复制了一个android-support-v4.jar到CaptureActivity新建的libs文件夹下。(eclipse没有其他项目的话手动建一个就有了,Android是在Android 3.0 (API level 11)开始引入Fragment的,3.0以上开始起为了兼容3.0以下的需要加入这个jar)。

第四步:

右键分别点击core目录和android-integration目录,选择Export..

打开Java目录,选中JAR file

勾选

Export generated class files and resources

Export Java source files and resources

勾选Options:

Compress the contents of the JAR file

单击Browse...导出选择的目录,起名:

core-2.3.0.jar

android-integration-2.3.0.jar

大功告成!这样需要的jar文件就生成好了。

zxing主页

https://code.google.com/p/zxing/

源码下载:

https://code.google.com/p/zxing/downloads/list

Eclipse生成jar的一般方法,请参考:

http://www.cnblogs.com/lan0725/archive/2008/08/28/1873947.html

下一步,如何精简代码?请参考这篇文章:

http://www.cnblogs.com/keyindex/archive/2011/06/08/2074900.html

接着,如何将横屏更改为竖屏?请参考这篇文章:

http://blog.csdn.net/duqiuke/article/details/8289921

扫描时如何打开闪光灯?请参考:

http://www.cnblogs.com/lee0oo0/archive/2012/04/05/2433815.html

希望对大家有所帮助,有问题请加我QQ472950043,android开发大家一起进步!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to run jar files in Linux How to run jar files in Linux Feb 20, 2024 am 10:40 AM

Prerequisites for running JAR files Running JAR files on a Linux system requires the installation of the Java Runtime Environment (JRE), which is the basic component required to execute Java applications, including the Java Virtual Machine (JVM), core class libraries, etc. Many mainstream Linux distributions, such as Ubuntu, Debian, Fedora, openSUSE, etc., provide software libraries of JRE packages to facilitate user installation. The following article will detail the steps to install JRE on popular distributions. After setting up the JRE, you can choose to use the command line terminal or the graphical user interface to start the JAR file according to your personal preference. Your choice may depend on familiarity with Linux shells and personal preference

How to execute .sh file in Linux system? How to execute .sh file in Linux system? Mar 14, 2024 pm 06:42 PM

How to execute .sh file in Linux system? In Linux systems, a .sh file is a file called a Shell script, which is used to execute a series of commands. Executing .sh files is a very common operation. This article will introduce how to execute .sh files in Linux systems and provide specific code examples. Method 1: Use an absolute path to execute a .sh file. To execute a .sh file in a Linux system, you can use an absolute path to specify the location of the file. The following are the specific steps: Open the terminal

Share an easy way to package PyCharm projects Share an easy way to package PyCharm projects Dec 30, 2023 am 09:34 AM

Share the simple and easy-to-understand PyCharm project packaging method. With the popularity of Python, more and more developers use PyCharm as the main tool for Python development. PyCharm is a powerful integrated development environment that provides many convenient functions to help us improve development efficiency. One of the important functions is project packaging. This article will introduce how to package projects in PyCharm in a simple and easy-to-understand way, and provide specific code examples. Why package projects? Developed in Python

Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Apr 09, 2024 pm 03:20 PM

Fermat's last theorem, about to be conquered by AI? And the most meaningful part of the whole thing is that Fermat’s Last Theorem, which AI is about to solve, is precisely to prove that AI is useless. Once upon a time, mathematics belonged to the realm of pure human intelligence; now, this territory is being deciphered and trampled by advanced algorithms. Image Fermat's Last Theorem is a "notorious" puzzle that has puzzled mathematicians for centuries. It was proven in 1993, and now mathematicians have a big plan: to recreate the proof using computers. They hope that any logical errors in this version of the proof can be checked by a computer. Project address: https://github.com/riccardobrasca/flt

PyCharm usage tutorial: guide you in detail to run the operation PyCharm usage tutorial: guide you in detail to run the operation Feb 26, 2024 pm 05:51 PM

PyCharm is a very popular Python integrated development environment (IDE). It provides a wealth of functions and tools to make Python development more efficient and convenient. This article will introduce you to the basic operation methods of PyCharm and provide specific code examples to help readers quickly get started and become proficient in operating the tool. 1. Download and install PyCharm First, we need to go to the PyCharm official website (https://www.jetbrains.com/pyc

A closer look at PyCharm: a quick way to delete projects A closer look at PyCharm: a quick way to delete projects Feb 26, 2024 pm 04:21 PM

Title: Learn more about PyCharm: An efficient way to delete projects. In recent years, Python, as a powerful and flexible programming language, has been favored by more and more developers. In the development of Python projects, it is crucial to choose an efficient integrated development environment. As a powerful integrated development environment, PyCharm provides Python developers with many convenient functions and tools, including deleting project directories quickly and efficiently. The following will focus on how to use delete in PyCharm

PyCharm Practical Tips: Convert Project to Executable EXE File PyCharm Practical Tips: Convert Project to Executable EXE File Feb 23, 2024 am 09:33 AM

PyCharm is a powerful Python integrated development environment that provides a wealth of development tools and environment configurations, allowing developers to write and debug code more efficiently. In the process of using PyCharm for Python project development, sometimes we need to package the project into an executable EXE file to run on a computer that does not have a Python environment installed. This article will introduce how to use PyCharm to convert a project into an executable EXE file, and give specific code examples. head

Reasons why exe files cannot be run on Windows 7 Reasons why exe files cannot be run on Windows 7 Feb 18, 2024 pm 08:32 PM

Why can't win7 run exe files? When using the Windows7 operating system, many users may encounter a common problem, that is, they cannot run exe files. exe files are common executable files in Windows operating systems. They are usually used to install and run various applications. However, some users may find that when they try to run the exe file, the system does not respond or gives an error message. There are many reasons for this problem. Below are some common causes and corresponding solutions:

See all articles