Encoding QR codes

73 views
Skip to first unread message

demiurge

unread,
Feb 2, 2018, 8:15:49 AM2/2/18
to zxing
I'm working on an app which should generate QR's. I have imported 'zxing:core' and 'android-integration' successfully, but the problem is when i'm trying to encode MeCard, as shown in the example https://github.com/zxing/zxing/blob/04595508b63c3bde614b59dac361b50bfadb8757/android/src/com/google/zxing/client/android/Contents.java

* {@code
* import android.provider.Contacts;
*
* Intent intent = new Intent(Intents.Encode.ACTION);
* intent.putExtra(Intents.Encode.TYPE, CONTACT);
* Bundle bundle = new Bundle();
* bundle.putString(ContactsContract.Intents.Insert.NAME, "Jenny");
* bundle.putString(ContactsContract.Intents.Insert.PHONE, "8675309");
* bundle.putString(ContactsContract.Intents.Insert.EMAIL, "je...@the80s.com");
* bundle.putString(ContactsContract.Intents.Insert.POSTAL, "123 Fake St. San Francisco, CA 94102");
* intent.putExtra(Intents.Encode.DATA, bundle);
* }

I got an error on the "(Intents.Encode.ACTION)" part. Because the Intents.java stored in the zxing/android, not zxing/core and i don't know how to import /android folder (or particular classes from it) to my project for further use.
I googled, but all the "import zxing" questions were about importing /core. And also you talk Sathish out of copying and pasting the whole project here (https://stackoverflow.com/questions/12314236/how-to-import-and-use-zxing-libraries)

Should i just copy classes i need? Or is there a better way to do it?
Sorry if that's a stupid question, i just can't seem to find the answer to how to use /android classes in my project.

Lachezar Dobrev

unread,
Feb 5, 2018, 8:18:04 AM2/5/18
to demiurge, zxing
The Intent based method is designed to work with an installed ZXing
application on the same device.
You also do not need to include core in the application, just have
ZXing Application installed alongside your application.
> --
> You received this message because you are subscribed to the Google Groups "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to zxing+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages