Friday, 8 April 2016

Download file using default download functionality

Download file using default download functionality

Download from url
in this just send file url.


public void startDownload(Context context,String url) {


    String fullurl = url;
    String title = "title";
    String fileName = "title";
    try {

        String servicestring = Context.DOWNLOAD_SERVICE;
        DownloadManager downloadmanager;
        downloadmanager = (DownloadManager) context.getSystemService(servicestring);
        Uri uri = Uri.parse(fullurl);
        DownloadManager.Request request = new DownloadManager.Request(uri);
        request.setTitle(title);
        request.setDestinationInExternalPublicDir("/Download/MP3/",
                fileName + ".mp3");
        Long reference = downloadmanager.enqueue(request);

    } catch (Exception e) {

    }

}


Run/install/debug Android applications over Wi-Fi ?

Open Teminal/cmd --------------- Below steps is for Android 10 or lower Step 1 - Connect the device via USB and make sure debugging is work...