Jquery Global Event handler for hybrid mobile application - jquery-mobile

I have a hybrid mobile web application. The condition is user will be logged out if there is no activity (screen - touch, click, navigation etc) in app for 10 minutes.
The possible option is to register all available jquery mobile events on page id and record the last event timestamp. And logout user if no event is catched till 10 minutes.
But apart from this option is there any another better apporach to handle this scenario. If yes can it be done just by using the Jquery Mobile or does it need native plugins?
-Hanumant

Related

Delphi Intraweb: Is there a way to open an url in a new tab without the popup behavior?

In an Intraweb (VCL for the web) mobile web application I need to redirect the user to a java webapp. I specify that is a java webapp to stress the fact that it is a completely different thing compared to the intraweb webapp.
I would like to achieve the following behaviour:
the user clicks on a button
the java app opens in the browser and uses it, in particular he uses the mobile keboard to type data
the user taps the phone back button
the intraweb application opens in the browser
In Intraweb as far as I know there are two ways to redirect the user:
Method 1) with WebApplication.GoToUrl(javaAppUrl)
in this way the history is lost so when the user taps on back he is not able to go back to the intraweb application
Method 2) with WebApplication.NewWindow(javaAppUrl)
in this way all seems to work in particular the back button works, but when I try to use the mobile keyboard to type something in the java app the keyboard appears for a moment and then it immediately disappears, I guess this is because somehow NewWindow "Creates a new popup window when executed in the browser context".
NewWindow has also some override methods with different parameters list but no one allows to remove the "popup behavior".
Could you please suggest a way to achieve opening a new webapp in a mobile browser:
keeping the browser history
being able to use the mobile keyboard in the just opened app
?
I use Delphi 10 Seattle, Intraweb 14.2.7 and cgdevtools for the mobile part (cgdevtools anyway plays no role in this issue).
Thank you.
I implemented a workaround by passing in the URL the webapp URL so that in the java URL I display a button that closes the session and redirects the user to the intrawebapp
javaAppUrl:= javaAppUrl + '&BACK_URL=' + WebApplication.FullApplicationURL(WebApplication.Request);
WebApplication.GoToUrl(javaAppUrl);
in this way I have the benefit of GoToUrl (so mobile keyboard works) and I manage to have a back feature with a custom button.
By the way this is still a workaround, I need this since I must release the application, but it is not the perfect solution yet.

iOS - Is there a way to inform users when mobile data is disabled for any specific app?

I know that the internal iOS API informs the user if the mobile data is disabled for an application and that, it can be changed in settings but is there a way to modify this pop up or trigger it to pop up more/less often?

HTML5 gps inside a WebView

Was curious about something the other day and could not find an answer.. With a native iOS app, if you load a page in a WebView that uses the gps functionality of HTML5, is the user prompted the same way they would be if viewing it in a browser?
(Yes, I know you could use native API if it's already a native app, but curious nonetheless and have no way to perform a test)
Yes you will see the same alert, it's a system alert.
However, other than triggered by a native app, the users choice will not be persistent and the alert will be shown on every visit.

Check for active users in rails if the users stays in one page and dont click through the app

I am trying to build an rails app and trying to see what users are online. I know how to implement the method to show online users if the user clicks through my app, but lets assume that my app is only 1 page, so there are no links to be clicked. How would I track the users online without the user having to click anywhere? Also i if the user has been idle for 15 min i will need to update the status to idle instead of online and if the user closes the browser or navigates to another page the status goes to offline.
Any help would be appreciated. Thanks
Presumably they interact in some way with the page (ajax perhaps?) so you'll need to detect those interactions and use them to determine if the user is idle or not. You could use javascript's onbeforeunload to determine when they have left the page.
I'd suggest to make AJAX pings to your server side like:
$.get( '/user_activity/ping' );
You can do it automatically using JS Timers or explicitly when the user interacts with the page some how.

Tracking HTML5 Web App installs on iOS devices

We recently launched an HTML5 Web App (using JQuery Mobile), which has a slide down box encouraging users to bookmark the Web App on their home screens. Users can do this from Safari by clicking Bookmark and then "Add to Home Screen". Any thoughts on how we might be able to track the number of "installs". I don't believe we can add any tracking to the native iOS bookmarking behavior from within the HTML5 Web app.
Thanks
I'm not sure you can get an event whenever the user installs the web app on their homescreen. However, you can know if the user is in 'full screen' / 'web app' mode by checking the window.navigator.standalone property in Javascript. So you might be able to do a call to your statistics provider and provide them the standalone property as well.
You can at least detect whether the app is launched from the homescreen or via browser via the window.navigator.standalone flag. You could use it in combination with cookies or localstorage to ensure you count unique installs in your backend.
You can also try to store the result of window.navigator.standalone into Google Analytics

Resources