You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using the DAV5x android app for many years to sync my appointments from nextcloud to my phone.
Now I want to retrieve the appointments via a java/kotlin project. The retrieval works, but I can't get them in a format that I can use, or where I can select specific data.
E.g. the start time, appointment names & if repeated, how often.
Since I'm a Kotlin beginner, it's possible that I'm doing something wrong, since I only program java at work.
Thanks for your support :)
This is my code:
val authHandler =BasicDigestAuthHandler(
domain =null, // Optional, to only authenticate against hosts with this domain.
username ="username", password ="password"
)
val okHttpClient =OkHttpClient.Builder().followRedirects(false).authenticator(authHandler).addNetworkInterceptor(authHandler)
.build()
val calLocation ="url".toHttpUrl()
val davCalender =DavCalendar(okHttpClient, calLocation)
val list = arrayListOf<Response>()
davCalender.calendarQuery(
"VEVENT", GregorianCalendar(2023, 7, 20).time, GregorianCalendar(2023, 7, 21).time
) { response, relation ->
list.add(response)
}
val cal =DavCalendarval liste = mutableListOf<HttpUrl>()
for (event in list) {
liste.add(event.href)
}
val termine = mutableListOf<Response>()
davCalender.multiget(liste, null, null) { response, relation ->
termine.add(response)
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have been using the DAV5x android app for many years to sync my appointments from nextcloud to my phone.
Now I want to retrieve the appointments via a java/kotlin project. The retrieval works, but I can't get them in a format that I can use, or where I can select specific data.
E.g. the start time, appointment names & if repeated, how often.
Since I'm a Kotlin beginner, it's possible that I'm doing something wrong, since I only program java at work.
Thanks for your support :)
This is my code:
Beta Was this translation helpful? Give feedback.
All reactions