View Issue Details

IDProjectCategoryView StatusLast Update
0000374MantisDroidTaskpublic2012-10-22 22:00
Reportere7andy Assigned Toe7andy  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version1.1Fixed in Version1.1 
Summary0000374: Add scan QR code button on login screen
DescriptionAdd scan QR code button on login screen.

Check that scanned QR code is correct with regex and then create java.net.URL to check that it is formatted correctly:
Regex: (?i)^mantisdroid://(.*)


Java code:
-------------------
// Set values from Url
Uri data = getIntent().getData();

//TODO: Test scanning wrong QR codes and handle exceptions that occur.
    
if(data.getQuery() != null) {
    Log.d("UrlLoginActivity", data.getQuery());
}

String regex = "(?i)^mantisdroid://(.*)";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(data.toString());
if(m.matches()) {
    try {
        URL url = new URL(m.group(1));
    } catch (MalformedURLException e) {
        Intent loginIntent = new Intent(this, LoginActivity.class);
        loginIntent.putExtra(MantisDroid.,true);
        startActivity(loginIntent);
        this.finish();
}
-------------------
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2012-10-11 09:53 e7andy New Issue
2012-10-11 10:01 e7andy Status new => confirmed
2012-10-11 10:01 e7andy Target Version => 1.1
2012-10-21 12:30 e7andy Assigned To => e7andy
2012-10-21 12:30 e7andy Status confirmed => assigned
2012-10-22 10:06 e7andy Summary Add scan bar code button on login screen => Add scan QR code button on login screen
2012-10-22 10:06 e7andy Description Updated
2012-10-22 10:10 e7andy Description Updated
2012-10-22 10:15 e7andy Description Updated
2012-10-22 10:21 e7andy Description Updated
2012-10-22 11:15 e7andy Description Updated
2012-10-22 21:59 e7andy Description Updated
2012-10-22 22:00 e7andy Status assigned => closed
2012-10-22 22:00 e7andy Resolution open => fixed
2012-10-22 22:00 e7andy Fixed in Version => 1.1