4. Notification & Lock
Notifiaction
● Android only
● 2.3 , only show the app icon & text , not play/pause stop
LockScreen
● Android only
● 4.4 kitkat and later version & 4.3 jelly bean diff “icon”
● Required for android 4.1
Implement CastOptionsProvider
11. What if google play service not support ?
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
int resultCode = ChromeCast.with(getBaseContext()).isGooglePlayServicesAvailable();
if ((resultCode == ConnectionResult.SUCCESS)) {
// do some work
} else if (resultCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED) {
// need update
Dialog dialogPlayServiceError = apiAvailability.getErrorDialog(this, resultCode, REQUEST_GOOGLE_PLAY_SERVICES);
dialogPlayServiceError.show();
} else {
//not support
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case REQUEST_GOOGLE_PLAY_SERVICES:
// do some work
break;
default:
super.onActivityResult(requestCode, resultCode, data);
}
}