Dois aplicativos que estão te tando dinheiro e verdade ! Entre com meu código para começar com dinheiro já, acha que é mentira ! Dá uma olhada a 👇👇☺️👌
Aplicativo 1
Kwai!https://s.kwai.app/s/had5bCi6
Aplicativo 2
https://vm.tiktok.com/ZMeqLXuYT/
Os 10 primeiros que entrar com o codigo, ganha um vÃdeo exclusivo !
-----///---------------///-----------------///-----------------///----
Primeiro adicione um bloco : progressbar1
Depois é simples vai nos componentes do WebView e adicione esse código 👇
progressbar1.setProgress(webview1.getProgress());
Vai ficar igual da foto !
Agora vamos aprender a fazer com que nossa WebView possa fazer download !
Vá no oncreat ficando igual da foto 👇
Código !
webview1.setDownloadListener(new DownloadListener() {
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
try {
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
String cookies = CookieManager.getInstance().getCookie(url);
request.addRequestHeader("cookie", cookies);
request.addRequestHeader("User-Agent", userAgent);
request.setDescription("Downloading file...");
request.setTitle(URLUtil.guessFileName(url, contentDisposition, mimetype));
request.allowScanningByMediaScanner(); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
java.io.File aatv = new java.io.File(Environment.getExternalStorageDirectory().getPath() + "/Download");
if(!aatv.exists()){if (!aatv.mkdirs()){ Log.e("TravellerLog ::","Problem creating Image folder");}}
request.setDestinationInExternalPublicDir("Download", URLUtil.guessFileName(url, contentDisposition, mimetype));
DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(request);
showMessage("Downloading File....");
//Notif if success
BroadcastReceiver onComplete = new BroadcastReceiver() {
public void onReceive(Context ctxt, Intent intent) {
showMessage("Download Completo!");
unregisterReceiver(this);
}};
registerReceiver(onComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
} catch (Exception e){
showMessage(e.toString());
}
}
});
Alguns cursos que me ajudaram durante meus aprendizados !
Curso Programação em Python básico intermédiario
http://bit.ly/curso_progracao_em_python_intermediario
Curso criação de jogos RPG : Super em conta
http://bit.ly/rpg_marker_curso_nocoes
Curso design de jogos !
http://bit.ly/design_jogos_intermediario
Todos os cursos tem certificado ao final !
Agora seu download já estará funcionando !
Um abraço e logo está o video disponÃvel !
0 Comentários