• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

WebView in Android

 
Greenhorn
Posts: 6
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,I'm a beginner in android development and I would appreciate anyone's help with my issue.
I have been trying to convert a progressive web app to android app,
I have tried doing so by using frameworks like cordova,phonegap,ionic,...but I couldn't handle server side code and got no results!
after I got familiar with WebView class in android,I used that class and pass my web app url to getUrl() method in it  and used other methods to handle scrollbar and back button.the app works properly but it takes some time to load data.
but the problem is: I have to add three tabs to the bottom of my layout and even when I have set the width and height of the webview to wrap_content,it fills all the parent layout's height and width
and overlaps with the tabs,which is not very user friendly.
Can anyone please tell me whether this is a good idea to use webview for converting web app to native app or I should try those frameworks again?
Is it possible to have all native features in an app which has used webview class?
 
Saloon Keeper
Posts: 5765
146
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can go a long way with webview, my preferred one being finestwebview on GitHub. With some custom code changes and some Javascript injection it is quite powerful. It'll always feel different than native apps, though. If you want a native look, native code is likely what you want. Cordova etc. were cool in their time, but only made sense if you were targeting multiple platforms. If you just want Android, go with native code (or something like React Native if iOS is also a target).


 
zeinab sheikhi
Greenhorn
Posts: 6
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your answer,that was helpful.
but I have some difficulties with webView
the speed of  data loading is really awful,I have searched for this problem in many sites,and did try all the possible answers  ,but I got no results!
it still takes too much time to load the web pages inside my app
 
Tim Moores
Saloon Keeper
Posts: 5765
146
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Webview is mostly the engine that's behind the Chrome browser - if Chrome is significantly faster than webview, that would be something to look into. If they're about the same, you might need to speed up your web site in general.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!