2016년 11월 21일 월요일

App inventor and JavaScript. Example.


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 );  



--
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

-- 

댓글 없음:

댓글 쓰기