3
I’m able to upload the URL to my device, using the Webview, but the page that loads is not adapted for mobile devices. I wonder if there is a way I can access the page, but eliminating some parts of HTML. Code below:
Mainactivity.java:
public class MainActivity extends ActionBarActivity {
Button btEntrar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final WebView myWebView = (WebView) findViewById(R.id.webView1);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new WebViewClient());
myWebView.loadUrl("SITE");
btEntrar = (Button) findViewById(R.id.btEntrar);
}
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (Uri.parse(url).getHost().equals("SITE DESEJADO")) {
// This is my web site, so do not override; let my WebView load the page
return false;
}
// Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
}
I want to leave only the login field, password and login button, and then move on normally.
Good! Also wanted to know.
– Marlon Paranhos
I think Voce can take the site with Curl and then save to an external file in the folder
temp
ae you carry withmyWebView.loadUrl("/tmp/siteConvertido.html");
– Olimon F.
Curl would not be a page exchange effect?
– Marlon Paranhos