Username09123

MainActivity

Apr 22nd, 2020
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1.  
  2. String userAgent = Util.getUserAgent(getApplicationContext(), getApplicationInfo().name);
  3.         ExoDatabaseProvider databaseProvider = new ExoDatabaseProvider(this);
  4.        SimpleCache downloadCache = new SimpleCache(
  5.                Environment.getExternalStorageDirectory(),
  6.                 new NoOpCacheEvictor(),
  7.                 databaseProvider);
  8.         dataSourceFactory = new DefaultHttpDataSourceFactory(userAgent);
  9.       DownloadManager  downloadManager = new DownloadManager(
  10.                 this,
  11.                 databaseProvider,
  12.                 downloadCache,
  13.                 dataSourceFactory);
  14.         byte[] appData = new byte[10];
  15.         DownloadRequest downloadRequest = new DownloadRequest(
  16.                 "contentId",
  17.                 DownloadRequest.TYPE_PROGRESSIVE,
  18.                 Uri.parse("https://mp3melodii.ru/files_site_02/001/standartnyj_signal_sms_iphone.mp3"),
  19.                 /* streamKeys= */Collections.<StreamKey>emptyList(), null,appData);
  20.         DownloadService.sendAddDownload(
  21.                 this,  ExoDownload.class, downloadRequest, false);
Advertisement
Add Comment
Please, Sign In to add comment