Can someone explain me how I would be able to imitate the default browser when trying to download .apk from the net?
So far I have this:
WebView webview;
@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
webview.setWebViewClient(new HelloWebViewClient());
WebSettings webSettings = webview.getSettings();
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(false);
webview.setDownloadListener(new DownloadListener() {
public void onDownloadStart(final String url, String userAgent,
String contentDisposition, String mimetype,
long contentLength) {
Toast.makeText(testapp.this, url, Toast.LENGTH_LONG);
}
});
webview.loadUrl("http://dacp.jsharkey.org/TunesRemote-r2.apk");
}
I've already added the permission to use the internet. Are there any other permissions that I need to add? Am I doing the DownloadListener incorrectly?
Thank you in advance!