Manual installation - ahmed-basyouni/QRParserLib GitHub Wiki
Welcome to the QRParserLib wiki!
Manual installation
Parsing
-
Make your activity
implements OnQRCodeReadListener
-
get qr code using any QR reader Lib and then call
QRParser.getInstance().parseQRObject(text from qr reader , context)
which return a formatted string if you want to display it on textView , it would also generate a well formatted object and save history. -
To get the formatted object (for more details check following BarCodeObject) call
QRParser.getInstance().getBarCodeObject()
. -
You can pass both values to listener by calling
mOnQRCodeReadListener.onQRCodeRead(well formated text);
mOnQRCodeReadListener.onQRCodeReadWithObject(QRParser.getInstance().getBarCodeObject());
and that is it for parsing.
handle actions
- To handle actions after parsing all you have to do is annotate your field which must be a member variable with one of the following annotations
@AddToCalender
@AddToContacts
@OpenBrowser
@SendEmail
@SendSMS
@ShowOnMap
@Call
and then before setContentView call QRParser.init(this);
For example
@Call
private Button callBtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// call it before setContentView
QRParser.init(this);
setContentView(R.layout.ark_capture_activity);
callBtn = (Button) findViewById(R.id.callBtn);
}