I need to create QR code from contact info which is in MeCard format. I need to encode the following field:
I can correctly create all 3 fields using ZXing QR Code Generator (here is the generated QR code from the example below). However it doesn't work with ZXing app on Android Emulator. I'm using this snippet:
Intent i = new Intent("com.google.zxing.client.android.ENCODE");
Bundle data = new Bundle();
data.putString(Contacts.Intents.Insert.NAME, "name1");
data.putString("url", "http://www");
//data.putString(Contacts.Intents.Insert.POSTAL, "http://www");
data.putString(Contacts.Intents.Insert.NOTES, "xyz");
i.putExtra("ENCODE_TYPE", "CONTACT_TYPE");
i.putExtra("ENCODE_DATA", data);
startActivity(i);
The result: ZXing app only encode the name
field.
1.) How can I solve this issue? Hopefully without dumping everything in name field.
2.) Are there any alternative library support encoding? ZXing seem to be the most popular.
You're not doing anything wrong, it's that the Intent does not support a note or URL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With