app/src/main/java/fi/finwe/orion360/sdk/pro/examples/minimal/MinimalImageDownloadPlayer.java
public void downloadAndPlay(String imageUrl) {

        // Save the file to external media, if it is currently mounted.
        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
            mImagePath = PRIVATE_EXTERNAL_FILES_PATH;
        } else {
            mImagePath = PRIVATE_INTERNAL_FILES_PATH;
        }

        // Create a name for the image file.
        String name = imageUrl.substring(imageUrl.lastIndexOf('/') + 1);
        mImagePath += name;

        // Create a progress bar to be shown while downloading the file.
        ProgressDialog progress = new ProgressDialog(this);
        progress.setTitle(getString(R.string.player_file_download_title));
        progress.setMessage(String.format(getString(R.string.player_file_download_message), name));
        progress.setMax(100);
        progress.setIndeterminate(false);
        progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);

        // Create a background task for downloading the file (will take a moment).
        new DownloadFileTask(progress).execute(new UrlFilePair(imageUrl, mImagePath));
    }
/**
     * Downloads an image file over the network to the local file system, then plays it.
     *
     * @param imageUrl The URL to the image to be downloaded and played.
     */
Downloads an image file over the network to the local file system, then plays it.
@param imageUrl The URL to the image to be downloaded and played.
Downloads an image file over the network to the local file system then plays it . @param imageUrl The URL to the image to be downloaded and played .
public void downloadAndPlay(String imageUrl) {
        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
            mImagePath = PRIVATE_EXTERNAL_FILES_PATH;
        } else {
            mImagePath = PRIVATE_INTERNAL_FILES_PATH;
        }
        String name = imageUrl.substring(imageUrl.lastIndexOf('/') + 1);
        mImagePath += name;
        ProgressDialog progress = new ProgressDialog(this);
        progress.setTitle(getString(R.string.player_file_download_title));
        progress.setMessage(String.format(getString(R.string.player_file_download_message), name));
        progress.setMax(100);
        progress.setIndeterminate(false);
        progress.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        new DownloadFileTask(progress).execute(new UrlFilePair(imageUrl, mImagePath));
    }
public void downloadAndPlay ( String imageUrl ) { if ( Environment . getExternalStorageState ( ) . equals ( Environment . MEDIA_MOUNTED ) ) { mImagePath = PRIVATE_EXTERNAL_FILES_PATH ; } else { mImagePath = PRIVATE_INTERNAL_FILES_PATH ; } String name = imageUrl . substring ( imageUrl . lastIndexOf ( '/' ) + 1 ) ; mImagePath += name ; ProgressDialog progress = new ProgressDialog ( this ) ; progress . setTitle ( getString ( R . string . player_file_download_title ) ) ; progress . setMessage ( String . format ( getString ( R . string . player_file_download_message ) , name ) ) ; progress . setMax ( 100 ) ; progress . setIndeterminate ( false ) ; progress . setProgressStyle ( ProgressDialog . STYLE_HORIZONTAL ) ; new DownloadFileTask ( progress ) . execute ( new UrlFilePair ( imageUrl , mImagePath ) ) ; }
Downloads an image file over the network to the local file system, then plays it.
Downloads an image file over the network to the local file system then plays it .
// Save the file to external media, if it is currently mounted. // Create a name for the image file. // Create a progress bar to be shown while downloading the file. // Create a background task for downloading the file (will take a moment).