Cat Mad

unread,
Jan 9, 2019, 12:17:30 AM1/9/19
to MIT App Inventor Forum
Hello Taifun
I'm a newbie with app inventor. I tried to make a project but have som promblem about open image with webview
in my project i made some listpicker and when a element in list picked the webview will open the image follow the link i progamed. I also made a search textbox for searching that elements if user need to quich search. And when click the button "GO", the typed text will pass in link to open the following name file.

 This is my design, Webview i seted in invisible.

Untitled.jpg


My Block to setup webview and Search section


block1.png

My Block to setup some list picker


block 2.jpg

block 3.png

Can you help me why this project does't work? Is it something wrong about the follow link passing on webview?

i had inclued my aia file.

Ths for help.




CircuitManager.aia

TimAI2

unread,
Jan 9, 2019, 3:59:04 AM1/9/19
to MIT App Inventor Forum
Is there a reason for wanting to load your image into a webviewer, e.g. animated gif ?

Why not load straight to an image component ?

Taifun

unread,
Jan 9, 2019, 9:45:37 AM1/9/19
to MIT App Inventor Forum
what is the purpose of the WEB_on procedure?
you forgot a Webviewer.GoHome method after setting the home url...

your example will only work in development mode, see here what needs to be done to work also after building the app: https://puravidaapps.com/tutorials.php#html

During development, you have to use the development path to the embedded html document:

file:///mnt/sdcard/AppInventor/assets/<NAME OF YOUR HTML FILE>.html


Before packaging the app, use the production path.

file:///android_asset/<NAME OF YOUR HTML FILE>.html


The tools extension offers the method PathToAssets which always returns the correct path to the assets.       



Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

TimAI2

unread,
Jan 10, 2019, 4:11:00 PM1/10/19
to MIT App Inventor Forum
Please reply to the forum and not to private emails

  1. You can load images into the image component from a url to reduce mb on your app
  2. Here is an extension for zooming with image component (Thanks Juan Antonio): http://kio4.com/appinventor/299B_extension_zoom_imagen.htm

Cat Mad

unread,
Jan 13, 2019, 10:40:33 PM1/13/19
to MIT App Inventor Forum
Hello Taifun, ths for reply

block1.png

+ About this block, i also make procedure "WEB_on" for formating screen size off Webview full size to device Screen, when it visible to show on. And used for this block

bable.jpg

this block i open webview for show some image have the same name but have charactor "calbe" befor that names.

+ About menthod Webviewer.GoHome, can i change it to this bolck, is it alright?

s1.png

  + And final, can you pls tell me more detail about this:

"
your example will only work in development mode, see here what needs to be done to work also after building the app: https://puravidaapps.com/tutorials.php#html

During development, you have to use the development path to the embedded html document:

file:///mnt/sdcard/AppInventor/assets/<NAME OF YOUR HTML FILE>.html


Before packaging the app, use the production path.

file:///android_asset/<NAME OF YOUR HTML FILE>.html


The tools extension offers the method PathToAssets which always returns the correct path to the assets. "

+ Im still not get, what is development mode?
 where can i find that extension tool, my files are not HTML, it .JPG so can that tool work?
+ About the Production path, what is that? how to open that?
Sorry cause i'm a beginer in this Ai2. Ths for help.

Cat Mad

unread,
Jan 13, 2019, 10:50:19 PM1/13/19
to MIT App Inventor Forum
Yes, my reason is alot of images i need to show on any time i take a pick in list picker or search. If straight load on app, that images will take alot of Mb when i build project to .apk, so it overside the limit of Ai2 (5Mb each app i remembered). So i need to fin another way to show my all images, that's why i use webview, and also webview have build_in zoom for view image, that i need too.

Taifun

unread,
Jan 14, 2019, 5:06:30 PM1/14/19
to MIT App Inventor Forum
development mode is while using the companion app together with the aia file, production means using the apk file

you can find the tools extension here https://puravidaapps.com/tools.php
See the App Inventor Extensions document about how to use an App Inventor Extension.

see also 

How to overcome the App Inventor project limit of 10 MB

Cat Mad

unread,
Jan 18, 2019, 12:05:22 AM1/18/19
to MIT App Inventor Forum
Hello Taifun,
Ths for help, but the example you show that webviewer just woked for the loaded image stored in the assets of the app. My app need webviewer to show the image which have saved in SD card, because if load all my images stored in the assets of the app, it could be verry verry big MB when build apk app. One more time ths for yr help and could you pls help me any way to solve this problem?
Thank you verry much.

Taifun

unread,
Jan 18, 2019, 12:45:02 PM1/18/19
to MIT App Inventor Forum
My app need webviewer to show the image which have saved in SD card
try the GoToUrl method of the webviewer together with the path of your image, for example
file:///mnt/sdcard/myImage01.jpg

Taifun
Reply all
Reply to author
Forward
0 new messages