Ask @Smokeantwortet:

Für was hättest du diesen Sommer gerne Zeit?

//Calledwhenapplicationisstarted.
functionOnStart()
{
//Createalayoutwithobjectsverticallycentered.
lay=app.CreateLayout("linear","VCenter,FillXY");
//Createanimage.
img=app.CreateImage("/Sys/Img/Droid1.png",0.3);
lay.AddChild(img);
//Createa'Media'button.
btn=app.CreateButton("GetMedia",0.3,0.1);
btn.SetMargins(0,0.05,0,0);
lay.AddChild(btn);
btn.SetOnTouch(btnMedia_OnTouch);
//Createa'Artists'button.
btn=app.CreateButton("GetArtists",0.3,0.1);
btn.SetMargins(0,0.05,0,0);
lay.AddChild(btn);
btn.SetOnTouch(btnArtists_OnTouch);
//Createa'Albums'button.
btn=app.CreateButton("GetAlbums",0.3,0.1);
btn.SetMargins(0,0.05,0,0);
lay.AddChild(btn);
btn.SetOnTouch(btnAlbums_OnTouch);
//Addlayouttoapp.
app.AddLayout(lay);
//Createmediaplayer.
player=app.CreateMediaPlayer();
player.SetOnReady(player_OnReady);
//Createmediastoreandsetcallbacks.
media=app.CreateMediaStore();
media.SetOnMediaResult(media_OnMediaResult);
media.SetOnArtistsResult(media_OnArtistsResult);
media.SetOnAlbumsResult(media_OnAlbumsResult);
}
//Calledwhenusertouchesourbutton.
functionbtnMedia_OnTouch()
{
//Usage:-Query(select,sort,options)
//Somesamplequeries:-
//media.Query("title='CodeMonkey'","");
//media.Query("titlelike'%'","");
//media.Query("titlelike'%fire%'","","external");
//media.Query("","album");
//media.Query("titlelike'%fire%'","album");
app.ShowProgress("Searching...");
media.QueryMedia("","artist,album","external");
}
//Showmediaqueryresults.
functionmedia_OnMediaResult(result)
{
s="";
for(vari=0;i0)
player.SetFile(result[0].uri);
}
//Calledwhenusertouches'Artists'button.
functionbtnArtists_OnTouch()
{
//Format:Query(select,sort,options)
app.ShowProgress("...");
media.QueryArtists("","","external");
}
//Showartistsqueryresults.
functionmedia_OnArtistsResult(result)
{
s="";
for(vari=0;i

View more