douzhechi2435 2012-07-11 18:13
浏览 33
已采纳

Android可以下载任何类型的日历活动吗? 如果是这样,文件结构是什么?

I have been hunting for ages trying to determine what format of calendar invite/event an Android device can download and incorporate into the system calendar - however I have not been able to locate anything!

By default the device does not support iCal or vCal - and the formats for both of these are well defined and easy to create. For example, this PHP script works perfectly for an iPad or an iPhone - so when you visit the page, the device invites you to add it to your calendar:

<?
$ical = "BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:" . md5(uniqid(mt_rand(), true)) . "@yourhost.test
DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR";

header("Content-type: application/force-download");
header('Content-Disposition: attachment; filename=calendar.ics');
echo $ical;
exit;
?>

I'm trying to create something similar for Android, but am unable to find any guidance on what file it will happily download natively, without some third party apps!

Any ideas or help appreciated!

Thanks, Kaiesh

  • 写回答

1条回答 默认 最新

  • duanci1858 2012-10-30 18:17
    关注

    Kudos to Santiago Rebella: Add Calendar event to Android from web .vcs download

    <?php
    header("Content-Type: text/x-vCalendar");
    header("Content-Disposition: attachment; filename=london2012.vcs");
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有没有整苹果智能分拣线上图像数据
  • ¥20 有没有人会这个东西的
  • ¥15 cfx考虑调整“enforce system memory limit”参数的设置
  • ¥30 航迹分离,航迹增强,误差分析
  • ¥15 Chrome Manifest扩展引用Ajax-hook库拦截请求失败
  • ¥15 用Ros中的Topic通讯方式控制小乌龟的速度,走矩形;编写订阅器代码
  • ¥15 LLM accuracy检测
  • ¥15 pycharm添加远程解释器报错
  • ¥15 如何让子窗口鼠标滚动独立,不要传递消息给主窗口
  • ¥15 如何能达到用ping0.cc检测成这样?如图