gasparuff
gasparuff

Reputation: 2295

Import .ics file on Android SDK and add to Calendar

I'm writing an App which requires the user to be able to download a .ics file from a Server and add all the containing events to his local Calendar. Unfortunately I can't find any tutorials or topics on this. If somebody has a clue, please let me know.

Thanks in advance.

Upvotes: 2

Views: 783

Answers (1)

gasparuff
gasparuff

Reputation: 2295

So I finally found a solution for my problem. Just open the link to your calendar file in a webview and make sure the headers are set like this (you may have to change this on your server, where the calendar file comes from):

<?php
header("Content-Type: text/x-vCalendar");
header("Content-Disposition: attachment; filename=calendar.vcs");
?>

Upvotes: 1

Related Questions