Android PubSubTutorial QR Code Scanner Bug
I have been running the PubSubTutorial app on my phone and it work perfectly fine except for when I try to scan a QR Code of the host IP Address. When I click the scan button in the app, it opens up the Bar Code scanner app on my phone, but when I scan the QR Code I get the following message:
"The application PubSubTutorial (process org.ros.android.app_chooser) has stopped unexpectedly."
After doing some digging around in the code behind the app, in particular how it handles the QR code scanning I came across this line(80) in org.android.ros.masterchooser:
Preconditions.checkstate(intent.getStringExtra("Scan_Result_Format").equals("Text_Type"));
After looking at what Preconditions.checkstate() and what intent.getStringExtra("Scan_Result_Format") does, I'm under the impression that the sole purpose of this line is to validate that the input is text.
If I comment out line 80 and scan in a QR code with the IP Address as text, the app works until I press "Ok" and then I get an "Invalid URI" message.
I changed my QR code to the IP Address as a URL, and the PubSubTutorial works correctly now.
Has anyone else had similar issues with scanning in a QR code? Is this line of code incorrectly implemented? Or is it a problem with my bar code scanner application not returning the expected type?
Hi, I am trying to make the same app but I am having many problems with the PubSub and the scanner. May I ask for your assistance?