Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start QR code scanner from app #369

Merged
merged 1 commit into from Jan 4, 2020
Merged

Start QR code scanner from app #369

merged 1 commit into from Jan 4, 2020

Conversation

di72nn
Copy link
Member

@di72nn di72nn commented Dec 9, 2016

In a feat of procrastination I wrote some code for the app to invoke QR-code scanner.
I added a button on one of the wizard pages. Suggestions are welcome.

@@ -132,6 +169,25 @@ private ConnectionData parseLoginData(String connectionUri) {
return new ConnectionData(values[0], values[1]);
}

public void scanQrCode() {
try {
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that enforce a specific QR scanner client ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. It seems that it might not, but I didn't test it.

@di72nn di72nn changed the title [WIP] Connection wizard improvement [WIP] Start QR code scanner from app Jan 7, 2017
@tcitworld
Copy link
Member

Needs rebase to have only the second commit.

@di72nn
Copy link
Member Author

di72nn commented Nov 13, 2019

It was a PITA to set up the app multiple times during development, so I updated this PR. I also added support for password. With these changes one can set up his account in one swift press-the-button-find-the-qr-code-point-the-phone-at-the-code motion.

The intent works with multiple QR code scanning applications: a list of apps is presented by Android. I can see "Barcode Scanner" and "Binary Eye" (I don't think I have any other installed).

@di72nn di72nn changed the title [WIP] Start QR code scanner from app Start QR code scanner from app Nov 13, 2019
@di72nn
Copy link
Member Author

di72nn commented Nov 14, 2019

Added intent.removeExtra(EXTRA_FILL_OUT_FROM_SETTINGS); which I missed yesterday. Without it the feature didn't work if the wizard wasn't started from settings.

@di72nn di72nn merged commit 4d69fd2 into master Jan 4, 2020
@di72nn di72nn deleted the wizard_improvement branch January 4, 2020 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants