android-music-player
Android background music service
Do it without service https://web.archive.org/web/20181116173307/http://www.rbgrn.net/content/307-light-racer-20-days-61-64-completion If you are so serious about doing it with services using mediaplayer Intent svc=new Intent(this, BackgroundSoundService.class); startService(svc); public class BackgroundSoundService extends Service { private static final String TAG = null; MediaPlayer player; public IBinder onBind(Intent arg0) { return null; } @Override public void onCreate() { super.onCreate(); player = MediaPlayer.create(this, R.raw.idil); … Read more
Android – MediaPlayer Buffer Size in ICS 4.0
Would it be possible to see the code where you’re start()ing the MediaPlayer? Are you using the STREAM_MUSIC audio stream type? player.setAudioStreamType(AudioManager.STREAM_MUSIC); Have you also experimented between player.prepareAsync(); and player.prepare();? There was a similar issue last year I remember, where the solution was to: start, pause and then onPrepared to start(): player.setAudioStreamType(AudioManager.STREAM_MUSIC); player.setDataSource(src); player.prepare(); player.start(); … Read more
READ_EXTERNAL_STORAGE permission for Android
You have two solutions for your problem. The quick one is to lower targetApi to 22 (build.gradle file). Second is to use new and wonderful ask-for-permission model: if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { // Should we show an explanation? if (shouldShowRequestPermissionRationale( Manifest.permission.READ_EXTERNAL_STORAGE)) { // Explain to the user why we need to read the contacts } … Read more