-1

I am using webView in my application and also using Firebase as a database, I have implemented the database for images and text in Firebase database for real time retrieval but the problem I am facing now is that I want to load a URL in Firebase database and gets shown on webView in my app, I cant make it work and have researched many questions and blogs but did not found anything useful to me, please help

I am using Android Studio and Firebase

Rohit B
  • 155
  • 21

1 Answers1

0

If I understand correctly, you want to load an image in your webview which its URL is stored in a database? Well why don't you use a ImageView? I've always used Picasso with ImageViews and never had any problems. Here is an example: http://square.github.io/picasso/ I hope it helped you out.

  • no sir, i want to load a web page in my webView, dont know how to do it with firebase – Rohit B Jul 30 '17 at 18:49
  • If you to load an existing webpage in your WebView just use: https://stackoverflow.com/a/38505589/5724149 – Sébastien de craene Jul 30 '17 at 21:12
  • Yes sir but that will put static URL, what i want is to put URL on database and then get it from it to webView so that if i have to change the URL i can – Rohit B Jul 31 '17 at 06:44
  • Do you want to store the URL that you loaded inside your webview to be saved inside the database? – Sébastien de craene Jul 31 '17 at 10:02
  • Yes sir, and also i want that if i want to change it, i can do it from database so that new webpage is shown at the place of previous – Rohit B Jul 31 '17 at 20:44
  • The storing is not the hardest part? Just getting the url from the webview by using `String webUrl = webView.getUrl();`, You have to create a listener that checks the database every x (mili)seconds, but that causes a lot of traffic, so it isn't ideal. – Sébastien de craene Aug 01 '17 at 08:21