Webview Problems

I have a task to make a calculator (scientific calculator)
So I had planned to connect a website by using mathda.


As you can see I have used the webview component


With the proper blocks

But when I tried to connect with AI Companion it seems that I cannot click any of the calculator buttons.

I am only able to click these

So how do I fix this?

FYI. I am still a beginner, I tried many things and redo all of it. Suddenly it works on my iPhone but when I tried by using other phone (Android) and other iPhone. It doesn't work

For me, on Android it doesn't work either, probably the website is seeing the webviewer as a mobile browser. I used the webviewextra extension and it worked OK, but this won't help on your iPhone devices.

Can you explain how to use the webviewextra extension?

See section 2.1:

https://ai2.appinventor.mit.edu/reference/other/extensions.html

Once imported, you need to drag the extension out onto the designer window

Then set up the blocks

image

Do I need to put a button? or do you have another method rather than add another button?

You do not have to put a button, you can move the gotourl block up under the webviewextra set block in ScreenInitialise.

Thanks I solved the problem

I want to add a webview that links to an AI website. The website is called Mathos AI. I am still a beginner so I put a simple blocks over webview component. But now I am facing a problem
" application error: a client side exception has occurred "

This is the designer page and the blocks(very simple)


Again, use the webviewextra extension

Is your approach okay with whoever assigned you that task?

By scraping a web calculator, you are missing the opportunity to learn the internals of such a calculator.

1 Like

Well tbh, They taught us basic approaches. But then again what they task me to do is way out of the study. I tried to learn from all of the sources, and I found nothing. I can only make a basic calculator,. Not even with an advanced math equation. If anyone out there want to mentor me, I would gladly appreciate it.

This sample project is a refurbished copy of an old project by akshay at
https://groups.google.com/g/mitappinventortest/c/0oVTthDFChY/m/GmIBOEH_EQAJ
from
the 4th link in

Exp_eval.aia (6.3 KB)

Sample run:
Sample run with minus and trig
(Notice the leading '-' and trig function)

Designer:

Blocks:

The refurbishment consisted of upgrading the file access to the html asset file to make it independent of the Companion.

The html and js files are in the .aia assets, unchanged from the original post.

You can make this your own by adding nested Vertical and Horizontal Arrangements full of buttons labelled with the various text fragments that would make an expression, like sin(

Keep a global input_token_stack variable, initially empty list.

In a generic button click event, check the .Text of the button and see if it is in your list of tokens. If so, add the text to input_token_stack and refresh your input textbox with JOIN Using Separator '' of input_token_stack . If the Delete button or the Back button is clicked, remove the last item from input_token_stack and refresh the display from it. (This is a luxury. You could also settle for clipping the end of the input Text.)

Add a special case for the Back button to exit the app if the input stack is empty.