0

I’ve been making android apps for like 4-5 days now. So i’m wondering if you know how I can make a web app? I have been looking through many tutorials, but none shows directly how I can make an app that displays the content from a website, and that I can decide what I want and don’t want to display. So I really just want to customize a website into an app and make my own layout. I know how the WebView and WebContent works and all that stuff, but I don’t know how I can do what I described here.

So what do I need to learn and know to make an app like that?

Espen
  • 9
  • 2

1 Answers1

0

You can do it by fill your xml layout with EdidText for the url and Buttons for Go, back, forward and so on, finally you need webview in this xml layout.

for the java code you can check the below sample.

public class SimpleBrowser extends Activity implements OnClickListener {


    WebView myBrowser;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.simplebrowser);

//here the code for initialize and set yourwebView Settings.
        myBrowser= (WebView) findViewById(R.id.wvBrowser);

//the below line to enable javascript if you want that
        myBrowser.getSettings().setJavaScriptEnabled(true);

//here another settings could be enabled for you your webview
        myBrowser.getSettings().setLoadWithOverviewMode(true);
        myBrowser.getSettings().setUseWideViewPort(true);

        try {
//here the default web page
            ourBrow.loadUrl("http://www.google.com");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

and for sure you need to implements your buttons using onClicklistener to be suitable for your idea.

https://www.youtube.com/watch?v=lkadcYQ6SuY&index=89&list=PL2F07DBCDCC01493A https://www.youtube.com/watch?v=PQ94MmEg0Qw&index=90&list=PL2F07DBCDCC01493A