English 中文(简体)
android上的zxing项目
原标题:zxing project on android

Many weeks ago,I tried to work on a mini project on Android OS requires ZXING, I followed several tutorials on this web site and on other Example: tuto1, and many tags and tutorials here tuto2, tuto3 ... But I failed each time. I can t import the android project into eclipse IDE to compile it with my code "not via Intent zxing APK-and my program like this example :

private Button.OnClickListener btScanListener = new Button.OnClickListener() {
    public void onClick(View v) {
        Intent intent = new Intent("com.google.zxing.client.android.SCAN");
        intent.putExtra("SCAN_MODE", "QR_CODE_MODE");


        try {
          startActivityForResult(intent, REQUEST_SCAN);
       } catch (ActivityNotFoundException e) {
         Toast.makeText(Main.this, "Barcode Scanner not intaled ", 2000).show();
       }
    }
};



public void onActivityResult(int reqCode, int resCode, Intent intent) {
    if (REQUEST_SCAN == reqCode) {
        if (RESULT_OK == resCode) {
            String contents = intent.getStringExtra("SCAN_RESULT");
            Toast.makeText(this, "Succès : " + contents, 2000).show();
        } else if (RESULT_CANCELED == resCode) {
            Toast.makeText(this, "Scan annulé", 2000).show();
        }
    }
}`

". I feel disappointed, frustrated and sad. I still have errors after importing the project. I tried both versions 1.5 and 1.6 zxing I tried to import the project c: ZXing-1.6 android, and an other new project with c: ZXing-1.6 zxing-1.6 android,I cheked out SVN: ttp: / / zxing.googlecode.com / svn / trunk / zxing-read-only with tortoiseSVN and reproduce the same work, but unfortunately without results! I really fed up with myself ... Please help me to solve this problem.how can I import the project and compile it correctly in my own project?

1-我使用Windows 7 64位家庭高级版

2-适用于Java EE Web开发人员的Eclipse IDE。版本:Helios Service Release 2构建id:20110218-0911

What is the effective and sure method to run this, otherwise if there is a video or a guide details or someone who already done it previously I would really appreciate it if someone would help me out

问题回答

Zxing是一个非常好的项目,不幸的是,集成它有时会很痛苦。我按照下面的步骤操作。如果没有,请参阅博客

  • 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

要下载示例导入,这个会让你立即开始。

你没有对你的问题说任何话。您还对是否通过Intent进行集成感到困惑。您在这里通过Intent进行集成,这是正确的方法,而不是像现在这样http://code.google.com/p/zxing/wiki/ScanningViaIntent





相关问题
In Eclipse, why doesn t "Show In" appear for non-Java files?

If I have a *java file open, I can right click on the source, scroll down to "Show In (Alt-Shift-W)", and select Navigator. If I have an *xml, *jsp, or pretty much anything besides a Java source ...

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

How to copy multiple projects into single folder in eclipse

I have two projects, Project1 and Project2. Now i want to copy this projects into eclipse workspace but i want these projects to be in a single folder like below. Eclipse Workspace -> Project -> ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

热门标签