12. “Android wearables provide just the right
information at just the right time, allowing you
to be connected to the virtual world and
present in the real world.”
android.com/wear
34. createNotify()
public void createNotify(){
int notificationId = 001;
NotificationCompat.Builder notifBuilder =
new NotificationCompat.Builder(getApplicationContext());
notifBuilder.setSmallIcon(R.drawable.ic_launcher);
notifBuilder.setContentTitle("WearMusicPlayer");
notifBuilder.setContentText("It is time to listen");
Roma
DevFest 2014
38. public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
// Intent used for starting the MusicService
final Intent musicServiceIntent = new Intent(context,
MusicService.class);
musicServiceIntent.putExtra("command", action);
context.startService(musicServiceIntent);
}
Roma
DevFest 2014
NotificationReceiver.java