AlarmManager setInexactRepeating, setWindow, setRepeating methods do not fire alarm when called from within loop for week days

try this code its working for Friday Alarm and similarly you can set for Saturday First you have to register your alarm Receiver and alarm time public static void SetAlarmForFriday(Context mContext) { try { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY); System.out.println(“Date ” + calendar.getTime()); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH) + 1; int … Read more

How to get national holidays of selected country

Problem solved by using Google Calendar API V3. The idea I found from this post. The holiday can get from default holiday calendar of google. The ID list of default holiday calendar can be found here, support to 40 country. A piece of code that handle permission and get holiday list:- com.google.api.services.calendar.Calendar client = null; … Read more

How to read and edit Android calendar events using the new Android 4.0 Ice Cream Sandwich API?

Here’s code that will let you add an event directly: import android.content.ContentResolver; import android.content.ContentValues; import android.net.Uri; import android.provider.CalendarContract; import java.util.Calendar; // Construct event details long startMillis = 0; long endMillis = 0; Calendar beginTime = Calendar.getInstance(); beginTime.set(2012, 9, 14, 7, 30); startMillis = beginTime.getTimeInMillis(); Calendar endTime = Calendar.getInstance(); endTime.set(2012, 9, 14, 8, 45); endMillis = … Read more

Change CalendarView style

In my project I defined the attribute “android:calendarViewStyle” in my theme. <style name=”Theme.Custom” parent=”@android:Theme”> <item name=”android:calendarViewStyle”>@style/Widget.CalendarView.Custom</item> </style> <style name=”Widget.CalendarView.Custom” parent=”android:Widget.CalendarView”> <item name=”android:focusedMonthDateColor”>@color/cs_textcolor</item> <item name=”android:weekNumberColor”>@color/red</item> <item name=”android:weekDayTextAppearance”>@style/TextAppearance.Medium</item> <item name=”android:dateTextAppearance”>@style/TextAppearance.Medium</item> </style> All styles possibilities are: @attr ref android.R.styleable#CalendarView_showWeekNumber @attr ref android.R.styleable#CalendarView_firstDayOfWeek @attr ref android.R.styleable#CalendarView_minDate @attr ref android.R.styleable#CalendarView_maxDate @attr ref android.R.styleable#CalendarView_shownWeekCount @attr ref android.R.styleable#CalendarView_selectedWeekBackgroundColor @attr ref android.R.styleable#CalendarView_focusedMonthDateColor @attr … Read more

Android CalendarView for Showing Events

The built in CalendarView widget doesn’t expose the ability to change the color of the calendar cells in month view. See the source. You might try the following approaches: Extend from CalendarView and implement onDraw yourself. You’ll have to reimplement all the existing drawing behavior, including these 4 methods: protected void onDraw(Canvas canvas) { drawBackground(canvas); … Read more