Android My Audio Player 0.1v

Well…A few days ago, I was working in an app to listen podcasts and I needed an audio player. I decided to developed a small framework to do it and after open it. So, I openned my android audio player source:

https://github.com/tassioauad/Android-My-Audio-Player

That’s the version 0.1 and I’m working on a version 0.2 where we can set a custom layout to the player. The framework 0.1v user guide is here: https://github.com/tassioauad/Android-My-Audio-Player/wiki/%5BVersion-0.1%5DSmall-User-Guide

An example:

Full xml layout code: (activity_main.xml)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<com.tassioauad.library.view.PlayerViewComponent
android:id="@+id/player"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>

view raw
activity_main.xml
hosted with ❤ by GitHub

The full Activity code:

public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
PlayerViewComponent player = (PlayerViewComponent) findViewById(R.id.player);
AudioEntity audioEntity = 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";
}
}
List audioEntityList = new ArrayList();
audioEntityList.add(audioEntity);
player.setAudioEntityList(audioEntityList);
player.show()
}
}

view raw
MainActivity.java
hosted with ❤ by GitHub

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair /  Alterar )

Foto do Google

Você está comentando utilizando sua conta Google. Sair /  Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair /  Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair /  Alterar )

Conectando a %s