vendredi 1 juillet 2016

How to get php site output in html in android webview?


Iam new to android.Iam trying to build an app which uses webview.when webview opens a php url is opening in webview,it contains input field of number ,when user gives input and hit the submit button data is appearing(the data page is also in php)how to get the data page in html? this is my code public class MainActivity extends AppCompatActivity { private WebView webview;

/**
 * ATTENTION: This was auto-generated to implement the App Indexing API.
 * See https://g.co/AppIndexing/AndroidStudio for more information.
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final WebView webview = (WebView) findViewById(R.id.webView);
    webview.setWebViewClient(new WebViewClient());
    webview.getSettings().setJavaScriptEnabled(true);

    webview.loadUrl("https://somesite.etc/index.php?service=something");

}

public class myWebClient extends WebViewClient
{
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String Url) {

        view.getUrl();
        view.loadUrl(toString());
        return false;
    }

}}


Aucun commentaire:

Enregistrer un commentaire