I want to implement a feature where scanning a QR brings up a browser and scanning anything else (barcode, text, etc) brings up a label

Yes, I must have been using a translator and not understanding it very well.

Apparently it's difficult to implement that feature in AppInventor, thanks for the answer.

Which feature ? All the blocks you show are available in AppInventor...

2 Likes

I'm referring to the ability to create a scanner app with AppInventor's native barcode scanner feature so that when a QR code is scanned, it launches in the browser (android.intent.action.VIEW) and when something other than a URL is scanned, the result is displayed as a label.

This can be done....

1 Like

I'd like to ask if this is possible and if so, how?

Try your blocks in AppInventor, see what happens....

although you might want to re-work this:

image

1 Like

I tested that block in AppInventor as is, using the MIT AI2 Companion.

When I did so, whether I scanned a QR code or a barcode, all of them were labelled as "not QR code".

png

The image below is an image of the AppInventor block.

You can use this logic with an Activity Starter, too.

1 Like

Wow, thank you. I tried it and it works with WebViewer. However, when I tried to run it with Activty_Starter as shown in the image below, it ignores the QR code and everything else works fine. I'm trying to implement the ability to open with a web browser using "android.intent.action.VIEW" and was wondering if there's a way to do that as well.
(Note that "액티비티스타터1" is an Activity_Starter.)

If you are using one component name in the green blocks that set up the Activity Starter, why is a different component name being used in the Start Activity block?

1 Like

I used a translator, so maybe I didn't understand it well.
If it's HTTP, I put it in because I wanted to run it with a web browser using the activity starter.

I've been trying to resolve the error by swapping blocks, but it's not working...

I don't have any bar codes to scan, so this is a guess.
activity_starter.aia (2.9 KB)
blocks

1 Like

I tried it and the QR code with http opens in a web browser and works very well. Thank you so much!
Sorry for the many questions, but finally, I was wondering if there was a way to tell if the scanned result was a URL or not, as opposed to whether it contained http or not, as I was getting an error if there was any text with http in it (e.g. this is http).

Sorry for asking so many questions and thank you so much!
I've been stumped for months on my own and you've solved it for me.

You could use this:

but it may be easier to simply do this:

image

If you read through the link above, you will see the warning that this is not perfect, there are other types of url....

1 Like

Possibly better:

image

which tests for just the first 8 characters of the url (where the http:// or https:// is found in a common url)

1 Like

@USER1
You should also close your topic in kodular.

1 Like

Are you telling me to delete my question post on Kodular?
If so, My post is still pending approval in Kodular, so I can't delete it at the moment. I'll delete it as soon as it's approved.

Once again, thank you so much to everyone.
I don't know what country you live in, so I don't know if it's morning or afternoon, but have a great day!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.