Android Open Source - Android-My-Audio-Player Main Activity






From Project

Back to project page Android-My-Audio-Player.

License

The source code is released under:

Apache License

If you think the Android project Android-My-Audio-Player listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.tassioauad.androidmyaudioplayer.simpleexample;
/*w w  w  . ja va  2s  .c o m*/
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;

import com.tassioauad.androidmyaudioplayer.R;
import com.tassioauad.myaudioplayer.AudioEntity;
import com.tassioauad.myaudioplayer.view.PlayerViewComponent;

import java.util.ArrayList;
import java.util.List;


public class MainActivity extends ActionBarActivity {

    private PlayerViewComponent player;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        player = (PlayerViewComponent) findViewById(R.id.player);

        List<AudioEntity> audioEntityList = new ArrayList<>();
        audioEntityList.add(new AudioEntity() {
            @Override
            public String getImageUrl() {
                return "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTenAaMaDZOQ8SOeyfwRkETYXqs4q2npb4RCCW2yu1SOWblKFy_";
            }

            @Override
            public String getTitle() {
                return "Tuesday at Mona's";
            }

            @Override
            public String getSubTitle() {
                return "It's my audio";
            }

            @Override
            public String getAudioUrl() {
                return "http://upload.wikimedia.org/wikipedia/commons/1/1d/Demo_chorus.ogg";
            }
        });
        audioEntityList.add(new AudioEntity() {
            @Override
            public String getImageUrl() {
                return "http://mediad.publicbroadcasting.net/p/kcur/files/201309/waitwaitnew.jpg";
            }

            @Override
            public String getTitle() {
                return "NPR Wait Wait";
            }

            @Override
            public String getSubTitle() {
                return "podcast episode n";
            }

            @Override
            public String getAudioUrl() {
                return "http://podcastdownload.npr.org/anon.npr-podcasts/podcast/344098539/372126500/npr_372126500.mp3";
            }
        });
        player.setAudioEntityList(audioEntityList);

        player.show();
    }

}




Java Source Code List

com.tassioauad.androidmyaudioplayer.ApplicationTest.java
com.tassioauad.androidmyaudioplayer.customplayer.MainActivity.java
com.tassioauad.androidmyaudioplayer.simpleexample.MainActivity.java
com.tassioauad.myaudioplayer.ApplicationTest.java
com.tassioauad.myaudioplayer.AudioEntity.java
com.tassioauad.myaudioplayer.AudioPlayerListener.java
com.tassioauad.myaudioplayer.AudioPlayer.java
com.tassioauad.myaudioplayer.view.PlayerViewComponent.java