Encode Contact Information (MeCard) on Android with ZXing

I need to create a QR code from the contact information, which is in MeCard format . I need to encode the following field:

  • Name (N :)
  • URL (URL :)
  • Note (NOTE :)

I can correctly create all 3 fields using the ZXing QR Code Generator (here the generated QR code from the example below). However, it does not work with the ZXing app on Android Emulator. I am 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);

Result: ZXing only encodes a field name.

enter image description here

1.) How can I solve this problem? I hope you do not drop everything in the name field.

2.) ? ZXing .

+5
2

, , URL-.

+1

URL. : data.putString( " ", "http://www.xyz.com" );

0

All Articles