XMTVInstall

/**
* Build dialog which will redirect user to google play store
* @param context
* @param Title – “Information”
* @param Message – Message to notify user
* @param url – XMTV Market url
*/
public static void XMTVInstall(final Context context, String Title, String Message, final String url){
new AlertDialog.Builder(context)
.setTitle(Title)
.setMessage(Message)
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
intent.setData(Uri.parse(url));
context.startActivity(intent);
}
})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// do nothing
}
})
.setIcon(android.R.drawable.ic_dialog_info)
.show();
}

/**
* Berore play media
*/
if (!isXMTVPlayerAvailable(context)){
String url = “market://details?id=com.xmtvplayer.watch.live.streams”;
String message “to play this stream you need XMTV, pressing OK you will be redirected to market”;
String Title = “Information”;
XMTVInstall(context, Title, message, url);
}

IPTV | Smart TV | Mobile Theatre Software | Media Player for Android(tm)