Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String userAgent = Util.getUserAgent(getApplicationContext(), getApplicationInfo().name);
- ExoDatabaseProvider databaseProvider = new ExoDatabaseProvider(this);
- SimpleCache downloadCache = new SimpleCache(
- Environment.getExternalStorageDirectory(),
- new NoOpCacheEvictor(),
- databaseProvider);
- dataSourceFactory = new DefaultHttpDataSourceFactory(userAgent);
- DownloadManager downloadManager = new DownloadManager(
- this,
- databaseProvider,
- downloadCache,
- dataSourceFactory);
- byte[] appData = new byte[10];
- DownloadRequest downloadRequest = new DownloadRequest(
- "contentId",
- DownloadRequest.TYPE_PROGRESSIVE,
- Uri.parse("https://mp3melodii.ru/files_site_02/001/standartnyj_signal_sms_iphone.mp3"),
- /* streamKeys= */Collections.<StreamKey>emptyList(), null,appData);
- DownloadService.sendAddDownload(
- this, ExoDownload.class, downloadRequest, false);
Advertisement
Add Comment
Please, Sign In to add comment