Skip to first unread message

PAE

unread,
Sep 23, 2014, 4:48:38 PM9/23/14
to mitappinv...@googlegroups.com
I managed to make calls from the webviewer with the setWebViewString block but I wonder if the html code is correct or can be improved.
Here is the html:

       <p><button type="button" name="911" onclick="callFunction(this)">Call 911</button></p>
       
<p><button type="button" name="999888777" onclick="callFunction(this)">Call TEST</button></p>

<script>
       
function callFunction(boton) {
        window
.AppInventor.setWebViewString('tel:' + boton.name);  
       
}
</script>


And the blocks from AppInventor:



Thank you very much .

Taifun

unread,
Sep 23, 2014, 6:02:47 PM9/23/14
to mitappinv...@googlegroups.com
why don't you use the PhoneCall component instead?

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

PAE

unread,
Sep 24, 2014, 1:13:32 PM9/24/14
to mitappinv...@googlegroups.com
Thanks Taifun for your answer. I have learned a lot of things from your tutorials. 
I do not use the component PhoneCall because my project requires that the application does not ask for permission to make phonecalls. And secondly my project uses .gifs images and text with format, so I decided to use html and js from the webviewer. I wonder if this is the proper way to use buttons from html and call functions in app inventor blocks or if there is other way to achieve it.

Taifun

unread,
Sep 24, 2014, 2:13:39 PM9/24/14
to mitappinv...@googlegroups.com
my project requires that the application does not ask for permission to make phonecalls.
if it works, it's fine, but I think you will have to add the phone call permission manually in the manifest using e.g. AppToMarket... did you already built the app and try to run the apk file?
Taifun

PAE

unread,
Sep 24, 2014, 2:45:51 PM9/24/14
to mitappinv...@googlegroups.com
Ok, thank you Taifun. Yes, it works. Should I set the permission although the button in the html only opens the android call application with the phone number? The user can decide whether or not to call because it does not make the phone call directly. 

Taifun

unread,
Sep 24, 2014, 3:35:21 PM9/24/14
to mitappinv...@googlegroups.com
if you do not need the permission, I would not set it
Taifun
btw. the phone call component can start a phone call directly

Burt Lewis

unread,
Jan 25, 2015, 5:53:59 PM1/25/15
to mitappinv...@googlegroups.com
Thank you for the response, I will give it a try. Thanks!
Reply all
Reply to author
Forward
0 new messages