Mit App Inventor Missing Network Issue

Hello,
I am working on a simple app that is opening a simple page as full screen in my app
I was wondering to add a feature that if the page doesn't load for some reasons (the device internet is not working, servers are dead or for any 404 or other error) i want to make that the app simply closes
I already made my research on Google and especially on this forum but i haven't understood a lot
Let me know what can i do
Thanks
Luca

Do you mean a screen or a webviewer of a web page ?

Regardless, possibly use the Screen/Webviewer ErrorOccured block to handle the issue / help close the app (suggest a notifier to the user to advise of problem)

1 Like

Hi,
I am currently using a WebViewer

Yeah, i already tried with that but when i try to use it is simply doesn't work
I want to apply to any error. The problem is that if i try the APK on a real phone without internet access it just remains a white blank screen

Have you tried loading a local html file if desired page is not loaded?

e.g.

<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<head>
	<title>No Network</title>
</head>
<body>
	<p>Intended web page failed to load, there is currently no network</p>
</body>
</html>

Also there are extensions available that can detect a network connection.

1 Like

Fine, now for some reasons is showing sometime yes and sometime no but it is not a big problem
Thanks for the help

I also have 2 more info:

  1. How can i make that when a specific button is pressed, so the actual scene must be restored and restarted?
    2 How can i hide or remove the zoom tool at the right bottom? (see screenshot as example)
    Screenshot_20230104_223703

Thanks in advance

  1. Just Reload the webviewer. There is a block for this.

image

  1. If it is your own web page you are displaying, then you can set user scalability in a meta tag. See my previous html for an example. If not your own page, then you will probably have to switch to using the CustomWebview extension which provides blocks to disable zoom.

image

1 Like

Thanks for the guides

Only a thing
In the reply 1 i was meaning a scene that has no webviewer but has other elements
What can I do?

Thanks a lot for the help
Luca

You don't have a reload block for a screen :frowning: What you can do is simply add property/method blocks for your elements to your button click event, that set the appearance and content of the elements as they are when the screen initialises.

1 Like

Hello,

Got it! No problem
Thanks for all the help

Luca

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