All Questions
2,372
questions
167
votes
13
answers
225k
views
How to add calendar events in Android?
I'm just getting up to speed on Android, and today in a project meeting someone said that Android has no native calendar app so users just use whatever calendar app they like.
Is this true, and if so ...
119
votes
12
answers
168k
views
Month name as a string
I'm trying to return the name of the month as a String, for instance "May", "September", "November".
I tried:
int month = c.get(Calendar.MONTH);
However, this returns integers (5, 9, 11, ...
73
votes
32
answers
190k
views
Check if a given time lies between two times regardless of date
I have timespans:
String time1 = 01:00:00
String time2 = 05:00:00
I want to check if time1 and time2 both lies between 20:11:13 and 14:49:00.
Actually, 01:00:00 is greater than 20:11:13 and less ...
71
votes
3
answers
50k
views
How to save and retrieve Date in SharedPreferences
I need to save a few dates in SharedPreferences in android and retrieve it. I am building reminder app using AlarmManager and I need to save list of future dates. It must be able to retrieve as ...
69
votes
2
answers
58k
views
Difference between Calendar.HOUR and Calendar.HOUR_OF_DAY?
What is the difference between Calendar.HOUR and Calendar.HOUR_OF_DAY ?
When to use Calendar.HOUR and Calendar.HOUR_OF_DAY ?
I am confused sometime Calendar.HOUR this works fine and othertime Calendar....
61
votes
21
answers
69k
views
How to convert time to " time ago " in android
My server. It return time :
"2016-01-24T16:00:00.000Z"
I want
1 : convert to String.
2 : I want it show " time ago " when load it from server.
Please. Help me!
50
votes
19
answers
69k
views
Android Days between two dates
I want to compare two dates for my Android application, but I got a really weird issue.
For example:
If I set the back in the past date to 127 days ago:
this.dateEvent = System.currentTimeMillis() -...
47
votes
9
answers
80k
views
Getting Year, Month and Date in Android
I am trying to get today's Year, Month and Date using following code;
Calendar calendar = Calendar.getInstance();
int thisYear = calendar.get(Calendar.YEAR);
Log.d(TAG, "# thisYear : " + thisYear);
...
45
votes
2
answers
21k
views
java.lang.IllegalArgumentException: Bad class: class java.util.GregorianCalendar
I received this exception while using GregorianCalendar
java.lang.IllegalArgumentException: Bad class: class java.util.GregorianCalendar
Who know how to fix,
Please help me.
p/s : I used the ...
43
votes
6
answers
69k
views
Formatting a calendar date
I just want the date to show up like so:
Saturday, May 26, 2012 at 10:42 PM
Here's my code so far:
Calendar calendar = Calendar.getInstance();
String theDate = calendar.get(Calendar.MONTH) + " " + ...
41
votes
12
answers
67k
views
How to get number of days between two calendar instance?
I want to find the difference between two Calendar objects in number of days if there is date change like If clock ticked from 23:59-0:00 there should be a day difference.
i wrote this
public ...
41
votes
2
answers
21k
views
webcal:// support on Android not working - is there a supported calendar feed alternative [closed]
We offer our clients the ability to subscribe to an iCalendar/VCalendar feed on their devices using a webcal:// link
We have a nice simple button that says "subscribe to this calendar", they click on ...
40
votes
6
answers
86k
views
Android Calendar get current day of week as string [duplicate]
i tried to get a string with the name of the actual weekday this way:
Calendar c = Calendar.getInstance();
int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
if (c.get(...
36
votes
16
answers
61k
views
Android how to get tomorrow's date
In my android application. I need to display tomorrow's date, for example today is 5th March so I need to display as 6 March. I know the code for getting today's date, month and year.
date ...
36
votes
3
answers
108k
views
How to set a reminder in Android?
I am trying to build a calendar app for Android. I am struck in the middle. I have managed to retrieve the information such as time and task from the user.
I don't know how to add this into android ...