Android 上的 zxing 项目
许多周前,我尝试在 Android 操作系统上开发一个小型项目 需要 ZXING,我遵循了这个网站和其他网站上的几个教程 示例:tuto1,以及这里的许多标签和教程tuto2,tuto3 ...但我每次都失败了。我无法将 android 项目导入 eclipse IDE 来使用我的代码进行编译,“不能通过 Intent zxing APK - 和我的程序,如下例所示:
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();
}
}
}`
”。 我感到失望、沮丧和悲伤。 导入项目后仍然有错误。 我尝试了1.5和1.6 zxing版本 我尝试导入项目c:\ZXing-1.6\android,并用c:\ZXing-1.6\zxing-1.6\android导入另一个新项目,我签出了SVN:ttp://zxing.googlecode.com/svn /trunk/zxing-read-only 用 tortoiseSVN 重现同样的工作,但不幸的是没有结果! 我真的厌倦了自己... 请帮我解决这个问题。我如何导入项目并在我自己的项目中正确编译它?
1 - 我使用 Windows 7 64 位 Home Premium
2 - 面向 Java EE Web 开发人员的 Eclipse IDE。版本:Helios Service Release 2 内部版本号:20110218-0911
运行此程序的有效且可靠的方法是什么,否则是否有视频或指南详细信息或 以前已经做过的人 如果有人能帮助我,我将非常感激
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 - I use Windows 7 64-bit Home Premium
2 - Eclipse IDE for Java EE Web Developers. Version: Helios Service Release 2 Build 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Zxing 是一个非常好的项目,不幸的是集成它有时会很痛苦。我按照以下步骤操作。如果没有请参考博客。
要下载示例导入,这个 将让您立即开始。
Zxing is a very nice project, unfortunately integrating it can sometimes be a pain. I followed the steps below. If not refer to blog.
For a download of a sample import, this will get you started immediately.
你还没有对你的问题说任何话。您似乎对是否通过 Intent 进行集成感到非常困惑。您在这里通过 Intent 进行集成,这是正确的方法,而不是像您这样。 http://code.google.com/p/zxing/wiki/ScanningViaIntent
You have not said anything about your problem. You also appear pretty confused about whether you are integrating via Intent. You are integrating via Intent here, and this is the right way to do it, not as you are. http://code.google.com/p/zxing/wiki/ScanningViaIntent