• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How can I customize my WebView that loads a webpage

The7even

Lurker
Nov 18, 2013
7
1
I'm not sure if the question is clear at all but here is what I want to do..


I am loading a webpage using WebView.. my code looks like this..




Code:
public void open() {
 myWebViewV = new WebView(this);          
setContentView(myWebViewV); 
         myWebViewV.setWebViewClient(new  WebViewClient() {
 @Override             
public boolean  shouldOverrideUrlLoading(WebView view, String url){ 
                 view.loadUrl(url); 
                return true; 
            }           }); 

myWebViewV.loadUrl("http://www.mywebsite.org"); 
     }


what this simple code does is load the website that I want to view.. fine..

But this site also has things like "Reply", "Register", "Login" and etc..

I'm trying to change it so that the user has to click the buttons that I create for him/her that will do basically the same thing.

Is this possible?

I asked on stackoverflow and only received two answers, one of them wasn't very clear.

do I HAVE to actually know javascript too?

I was wondering if I can just use java to do this and hoping one of the android classes handles such things.
 
Honestly, minutes!

Its very fast and loose, syntax is similar to Java / C++ / PHP etc. Variables are loose like most scripts, e.g. PHP, Lua, etc.

Most use is just accessing the HTML / CSS DOMs

But in reality I think (if you're writing the webpages) then you'll just use callbacks to call a Java function, so most of your stuff will be in Java as you want!
 
Upvote 0
Thank you.

I have no interest in really doing much with it.. but I do want to be able to add my own look to the website I'm loading in webview and want to add my own buttons and such that'll be performing the same functionality as the websites default.. didn't think i'd ever need js for that.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones