Android Question Long time running app with webview speed/stuck problem

Tomas Petrus

Active Member
Licensed User
Longtime User
EDIT: Hi guys,
happy new year in advance : )
EDIT: Especialy to Erel : ))

We are developing new version of our taxi enviroment.

The driver app si B4A + webview. Recently I find out that when the aplication is runing for longer time (I left it running on the device trought the night and pick it up on the morning, so 10 hours or so)

The webview was so slow... animations on object refreshs, scrolling, everything was the oposite of smooth (cant find the right word : ))

Restart the app and boom everything work again without any problem fast and smooth.

After some more testing on one device the app got the device totaly stuck and I had to restart the device.

The driver app is mainly just showing webview, exchange some info trough webviewextras and using fusedGPS.

Actualizations of the data are done in webview trought AJAX each 20s.
What could be the problem ?

Thanks
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm not sure why you rely so much on WebView. Create a native app instead.
Use OkHttpUtils2 to download the data and update the layout.

WebView has a destroy method. You can call it with:
B4X:
Dim jo As JavaObject = WebView1
jo.RunMethod("destroy", Null)
You can try to call it every 30 minutes and create a new WebView instead.
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
Because:

The whole enviroment consist of
a) REST API (right now doing just some basic stuff, but will be doing much more in the future)
b) Dispatching web application
c)Driver app

Everything done in MVC C#
except driver app which is part B4A and part Webview
 
Last edited:
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
Also there are already hundreds of hours spend on it. even in driver app there is heavy logic in Webview

I can easily copy functions between all three parts.

Also because we are going live in few days and dont have time to rewrite whole app, when it should work..
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
OK thanks will try it, seems that it could help.

When I test web part in chrome for 10+ hours everything works fine.
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
Make perfect sense,
starting to hate google anyway : )

I will consider it for the next phase.
Right now I have to make the solution we have to work how it was supposse to.

The aim for the final solution I am considering right now is to have RESTfull API to handle most of the stuff (all the business logic).
Same looking Driver and Client apps runing on iOS and Android. Dispatching remain web app for obvious reasons. Everything with minimum redundancy.

We have limited resources. Right now in my country there is close to 0% unemployment, so some programmers left my team and finally I had to start programming again and built the solution by myself with my legacy knowledge decades old.

So I did my best : ) and I've learned a lot past 6 months.

I kinda like how the things have changed since my old school ASP shit to the stuff that is possible now.
I had consider Xamarin but it just doesn't feel right.

I am allways sure with my database structure for me its really easy to think it trough its kinda automatic and fast to make it right.

Whats killing me is to make the logic and UI for webapp this way for Android that way for iOS other way for API some other way etc.
Once it could be bearable but considering future developement and upgrades....
It's just so time consuming .....

And I really love to spend my free time with my kinds and not behind the PC screens debuging my own code on diferent fronts in diferent languages.

When u have some free time, I bet u don't : ))
Can u provide me with some links or directions to books to improve my learning curve ? and save me bunch of time, considering the solution I'm aiming for ?

Thanks : )
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top