Can you help me convert Java code to Thunkable Blocks?

@Override
            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                if (type.equals("Register") && url.contains("/Mobile/Register/Register")) {
                    String referralCode = ShareReference.REFERRAL_CODE;
                    if (referralCode.equals("")) {
                        referralCode = "";
2 Likes

Hi @vickycode87xrf6 :wave:

Thanks for reaching out. If you can post a text description of what this code is supposed to do, I’m imagining you’ll get a much quicker and more meaningful response. We are here to help but the majority of us don’t know Java.

3 Likes


I need to fix the text in this ID

1 Like

Your code is using an invitation link and extract the referral code from the link to give credit to the one who invited you. This code and the example you show is not part of Thunkable and therefore you will not find good explanation.

var AgentID = document.querySelector(‘AgentID’);
AgentID.value = ‘Text’;
AgentID.readOnly = true;

Please help, how can I use such a command on thunkable?

2 Likes

You can only use these commands through a Web Viewer Extension

See this example
https://x.thunkable.com/projectPage/6093e98c10d4c4028ada2448
This is the official Thunkable sample app.

2 Likes

I can’t find import extension

It’s not an .aix file @vickycode87xrf6 it’s actually part of the web viewer component itself.

Here’s more:

2 Likes

Looking at your code i am guesing that you are working with a text input component

This Will return the first HTML element on the page with the given id/class
You already have that block in Thunkable it’s the green block refering to your element/component.

This Will set the text of An text input so you can Use a “set text to” block.

This is not supported by Thunkable.
You can Use a label if you want your text input to be Read only.
Alternativly you can do as @muneer and @domhnallohanlon suggested.

Hope that helps