Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Get music

Roman Kushnarenko edited this page Oct 29, 2014 · 2 revisions

Initialize callback listener:

OnPagesListener onPagesListener = new OnPagesListener() {			
	@Override
	public void onComplete(List<Page> music) {
		Log.i(TAG, "Number of music = " + music.size());
	}

	/* 
	 * You can override other methods here: 
	 * onThinking(), onFail(String reason), onException(Throwable throwable)
	 */		
};

Get music:

mSimpleFacebook.getMusic(onPagesListener);

Be specific and get what you need

By using this option, you define the properties you need, and you will get only them. Here, any property is possible to get.

Prepare the properties that you need:

Page.Properties properties = new Page.Properties.Builder()
	.add(Properties.ID)
	.add(Properties.NAME)
	.add(Properties.LINK)
	.build();

Get music:

mSimpleFacebook.getMusic(properties, onPagesListener);

Get music of other users

If user's music privacy is defined to public, then, you can access these music, or if person is using your app and also accepted the same permissions:

Get music:

mSimpleFacebook.getMusic(profileId, onPagesListener);

Same for properties:

mSimpleFacebook.getMusic(profileId, properties, onPagesListener);
Clone this wiki locally