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");
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路