Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I can replace default calendar of Android OS?

Is there any official or non-official API or a hack to replace default calendar (Georgian calendar) of Android OS with another calendar (my own Calendar)? You can see list of calendars around the world here if you are not familiar with them.

May I must override DateFormat or GregorianCalendar or Calendar.getInstance()?

(Added on an edit) And will it override use of Gregorian calendar totally, for example on Android lock-screen?

Thanks :)

like image 622
Ebrahim Byagowi Avatar asked Aug 23 '12 13:08

Ebrahim Byagowi


People also ask

How do I set a default calendar-app in Android (Jelly Bean)?

How do I set a default calendar-app in Android (Jelly Bean)? 1 Go to the phone settings. 2 select apps. 3 scroll to the right two screen, to the 'All' section. 4 scroll down until you can find calendar, click on it. 5 scroll down the page and click the 'Clear defaults' button.

How do I open a calendar on my Android phone?

Once you have cleared the default, Android will ask you which app you want to use next time something wants to open a calendar. To view your calendar on the phone, open the Google Calendar instead of the Samsung app. To sync your existing events with Google, you may need to export your Samsung Calendar, and import it to Google Calendar.

Why can't I See my Samsung calendar on my Android phone?

In this case, you'll want to clear the defaults for the Samsung Calendar app. Once you have cleared the default, Android will ask you which app you want to use next time something wants to open a calendar. To view your calendar on the phone, open the Google Calendar instead of the Samsung app.

How do I Sync my Samsung calendar with Google Calendar?

Once you have cleared the default, Android will ask you which app you want to use next time something wants to open a calendar. To sync your existing events with Google, you may need to export your Samsung Calendar, and import it to Google Calendar. See


1 Answers

Calendar.getInstance() is not the Android API. It is standard Java API. Calendar.getInstance() calls createCalendar() with default time zone and locale. There are factory methods getInstance() that accept time zone, locale and both. This is the way to affect the calendar created.

For example as far as I know sending Japanese locale cause creation instance of JapaneseImperialCalendar.

EDIT

There are a couple of predefined calendars: BuddistCalendar and Japanese calendar. And obviously default GregorianCalendar. You can add you own "extension" using Locale.setExtension(char key, String value). I have never done it but it should work. You should however dig into the code your self to find out the correct parameters. Good luck.

like image 114
AlexR Avatar answered Nov 13 '22 16:11

AlexR