I want create in java alarm clock app and when alarm it's turned on I want connect to video (specific url) on you tube (video must be start automatically). How I can do it at all or it's impossible?
Thanks for the answers :)
I want create in java alarm clock app and when alarm it's turned on I want connect to video (specific url) on you tube (video must be start automatically). How I can do it at all or it's impossible?
Thanks for the answers :)
Give this a try - it's untested, but should launch a YouTube video using whatever browser is installed on a user's device.
public static void setYouTubeAlarm(String videoId, long alarmTime) {
final Intent launchYoutube = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.youtube.com/watch?v=" + videoId));
final PendingIntent pi = PendingIntent.getActivity(context, 0, launchYouTube, 0);
final AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
am.setExact(AlarmManager.RTC_WAKEUP, time, pi);
}