Skip to first unread message

Juan Antonio

unread,
Nov 20, 2016, 10:04:42 AM11/20/16
to MIT App Inventor Forum
Hi friends, this is an example about App inventor and JavaScript.

1.- App inventor send datas to file pitagoras.htm. 3:4
2.- pitagoras.htm with JavaScript get datas and split cateto1= 3 and cateto2 = 4
3.- JavaScript calculates hypotenuse
4.- JS send hypotenuse to App inventor by
-  window.AppInventor.setWebViewString("Hipotenusa = " + hipotenusa);
and
-  document.write("<br /> Hipotenusa: <br />" + hipotenusa );  







p166_javascript_pitagoras.aia

Taifun

unread,
Nov 20, 2016, 10:08:30 AM11/20/16
to MIT App Inventor Forum
nice example! keep up the good work!
note: as you know, before building the app you have to use a different path...


Yes, you also can upload html files as assets into App Inventor! There is only one special thing to consider: 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

Taifun

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

Abraham Getzler

unread,
Nov 20, 2016, 2:57:33 PM11/20/16
to MIT App Inventor Forum

Clemzky

unread,
Nov 25, 2016, 7:05:06 AM11/25/16
to MIT App Inventor Forum
Nice!!! Kudos
Reply all
Reply to author
Forward
0 new messages