Notification from web app (Android) - javascript

I'm developing a web app that shows a counter, and when the counter comes down to 0 I want to notify the user(The counter is on a server, so there won't be a problem with reloading the page).
If the user is on a computer, I'm using a popup for the notification, but if the user is on an Android device, I would like the notification to be shown even if the browser isn't open.(I'm using AngularJS if that would be any help)
Is there a way to do this? I rather not build a special Android app.
Thanks.
//G

I'm afraid no, there is no way to do that. When any android application is not active is... not active, frozen. The browser is not a service, so as far as I know it won't process anything while in background. Even it's possible the OS close the browser if it needs more memory than is available.

Related

How to know if the browser is pinning by the android screen pin

I'm working on a web application that should always be visible on the tablet that opens.
To achieve this, what I have done is to use the 'Pin Screen' function of Android so that users who use the tablet do not leave the web application.
The problem that sometimes users leave in this way pressing the security keys.
For this reason I would like to know if there is any way from Javascript to know if the browser is pinning or not and thus be able to notify it on the server.

Close a browser tab opened by Android app

I have an issue where I'm asking my app to open a browser looking at my Server.
From that server page, The user can perform some stuff on an existing site, then redirects the user to a URL that the App catches and the App continues as normal.
The lifecycle looks like this:
App -> Web Site -> App
However, after the life cycle of the app and the app is closed, the webpage is still open in the browser (on the page where the redirect to the app occurred).
It's apparently difficult via javascript to close a tab which wasn't opened by javascript? (In my case, the tab was opened by the app, not by a different tab). Is there any way to get around this?
(I'm aware I could use a WebView, but WebViews are buggy, manufacturer specific, security holes that I want to avoid)
No, sorry. There is no standard Intent structure for this. While it is possible that some browsers offer something, I am not aware of any that do.
Bear in mind that there is no requirement that your ACTION_VIEW Intent open up a browser tab, as the user's chosen browser may not offer any sort of tab UI metaphor. check this reference old question

Can you detect if your web page is running inside your Windows Mobile native App?

How can you check that a web page is being served under a native app on Windows phone?
You cant use custom user agents, so to date we have done the following...
Check the user agent for Windows Phone, check it for WebBrowser which indicates its served from the WebBrowser windows control, and then try to call a method in our native app to guarantee we are in our app.
However, the latest browser updates to windows have removed WebBrowser from the user agent.
This means there would be delay when viewing the page on Mobile IE, as we would have to try to talk to our native app to see if it's there or not, and wait for a timeout to assume its not there.
So..
1) Is there anyway now to set custom user agents in windows Mobile - everything we have tried to date has failed.
2) Is there another way we can indicate to the page that its running in our app? Inject some JS at the start some how?
3) Any other way to somehow tell the web page what its running in? Cookies, local storage?
We need to know where its running before it has finished loading, so JS scripts can tell where they are running as they load up.
m

Cordova App restarting after inactivity

Good morning
I'm developing a cordova application for my internship.
The application tracks the position of the user and does some logic with it to generate data the user needs.
This all works fine but the application needs to run as long as the user has a button on the main screen enabled
but right now when the application is running and you enabled the button which makes the application track the data. Then when the screen is turned off the application gets turned off and doesnt track the users position anymore.
I presume the application is suspended but then when you open the application again it is like you opened the application for the first time. (button turned off)
Is there a way to keep the application active? i know in native android you can write a service which does this but i need something that works with cordova
thanks in advance for the help
regards
bavo

Need Mobile Safari to run a java script while my iPhone is in sleep-mode

Recently I submitted an iPhone app that was rejected because it uses the APNS to push messages that could contain marketing and advertising information. Because of this, I now need to create a web app instead of a native phone app.
My problem is that I need to poll the phone’s location in the background. When Safari is in sleep mode I need to somehow have a java script running in the background to monitor location changes. Has anyone been able to do this?

Categories

Resources