I am writing an app that works a bit like 'do not disturb' but with a timer.
So I want to set the phone onto 'silent mode' for a while and then switch it back to the original volume.
I also want to keep the app running (i.e. keep screen on) for the duration of the timer.
But I want to do all this from an HTML5 / Javascript app.
Is this possible with the javascript api? Or any html5/js toolkit?
It should be possible to do with Javascript in a WebView. With WebView.addJavascriptInterface() you can insert a object from your Android code which you can call to from your Javascript code that is running in the WebView.
Related
So currently I am developing an application that I'd of hoped to work on Windows, Xbox, etc.
I am trying to developer a wrapper for a javascript library that plays music. This library does not exist in any other form, and only provides the music as encrypted files. It handles playing the audio, pausing, fetching, etc. To change anything you call js methods.
So I am currently using a hidden UWP webview, with custom js/html to play and pause the audio coming from the js library. I was fiddling around with it and noticed if I minimized it, the audio is stopped from the webview. I cannot set a media source for a backgroundtask as I cannot get the actual source of the audio. That is all handled by the js library.
I am hoping to find a way to use UWP, along with this webview "hack". Am I trying to accomplish the impossible?
I want to dial number using javascript.
I have used following code
document.location.href = "tel:15555551212"
It brings me to dial screen of mobile application. But I want to make a call directly.
I have also used "callto" but it is not working.
This is not possible, unless:
the Web browser holds the CALL_PHONE permission (so that the user knows at install time that this app might place phone calls), and
the Web browser exposes some means to have you place a phone call directly, perhaps via some DOM extension or magic snippet of JavaScript
Few, if any, browsers will meet these criteria.
A hybrid application (e.g., PhoneGap) could do this, given the proper permission and some API to enable it (e.g., PhoneGap plugin, if it is not part of the standard PhoneGap API).
You will probably need to use apache cordova to get access to native device APIs, including the one you can dial with. Link to the respective plugin
This is obviosuly only possible on mobile devices, and this plugin can only operate on iOS and Android. For more information about cordova, see this Link.
Is it possible to simulate call procedure in an iOS App using any script.
Launch Phone App
Pres Key Pad
Dial Numbers
Press End call
Gone through the following link.
IPhone Automation
I am looking for commands similar to adb commands.
Like the following command
adb shell am start -a android.intent.action.CALL tel:123456789
I tried using the following code to dial the call from the App
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://123456789"]];
Now I get different view, Is it possible to access the elements in this view from Javascript ? I would like to end the call after 5 seconds by simulating the End button
touch using some script. Is it feasible ?
Is there any API to accept and reject calls within the App?
I searched for this earlier but did not find any API.
I want to try it as an internal app and I don't want to submit in the AppStore and I am looking for non jail broken devices.
No, there is no API to interact with any of the phone features on an iPhone, other than openURL:
I don't know if I googled it correctly but I could not find the answer for my question.
I'd like to know if it's possible to code a html5 with javascript (maybe jquery mobile for the UI) and css without using "native compilers/builders" like sencha touch or phonegap and store the page locally (using file:// protocol).
E.g: Let's say that I want to build a simple HTML5 calculator. I don't want any server-side processing, I just want some html buttons to call javascript functions to perform client side only operations. If I make such page, let's call it calc.html and download it to the mobile (via usb/http download), can I open this calc.html with the internal browser and use the calculator? Or do I have to compile/build this calc.html into a Webview (for Android) or something like it to get it done?
Would this work for Android, IPhone, Windows Phone and others with localStorage/sessionStorage?
You want an Offline Web Application.
This article seems to explains step by step how to do this.
http://diveintohtml5.info/offline.html
Creating a website like this, will allow you to bookmark it and have a shortcut icon in the phone's dashboard that will allow you to load your page in the browser for those cases where you don't have a data connection. In the case where the phone has a data connection, it will load the manifest to check if there are any new files to update the application. I don't think there is a way to make it truly offline though.
I have a web application (chat room) in html + javascript that basically sends requests to the server every 5 seconds to check for new messages.
It already works on mobile but there are 2 main problems:
it does not beep (it works on pc) with new messages
when the browser is put on background, the javascript obviously stops being executed, therefore the connection to the server is lost and the client disconnected.
i was thinking of using phonegap not only to make it cross-platform but also to fix those problems stated above. would they be resolved with the use of phonegap?
thank you in advance.
phoneGap doesn't support custom push notification. it basically open a browser and expose you some native support via API.
in order to do some native actions like push notifications and/or sound playing i suggest you check out some of the plugins options available or even write your own for that.
Playing sounds can be done easily using the Media API. As for having the JavaScript run in the background it really depends on the OS. On Android the JS will continue to run if you leave the app via the home button but the back button kills the app so you would stop the JS. It is probably better to write a service that always runs in that case.
Alternatively you'd look at a push type solution to notify you of new messages.