Hi Dears
is it possible JavascriptInterface calls a service sub!?
when main activity is paused javascript can not call a sub, thus i want javascript call a service sub
Thanks a lot.
it's worked but only for 5 minutes!
when page disappear javascript work for 5 minutes, after it not work until page appear again.
whata happend when it appear!?
how appear page on service after 5 minutes?
Not enough information to help you. B4XPages are never paused. If your app is in the background and there is no foreground service then the process will be killed at some point.
My application has a service in the background that retrieves information from the injected Java code in WebView.
But when the page is disappear, the javascript only sends information for 5 minutes and then stops working. But as soon as the page appears, it starts sending information again!!!
My question is what happens when the page appears again the javascript activity resumes!?
1. Make sure to have a foreground service.
2. Make sure to acquire a partial wake lock with PhoneWakeState. This will prevent the device from sleeping.
And don't assume that the OS will let your app run forever in the background.