的Andr​​oid在稍后的时间通知用户 [英] Android notify the user at a later time

查看:129
本文介绍了的Andr​​oid在稍后的时间通知用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建的Andr​​oid中,用户在未来选择某一天,然后在应用中,当那一天到来时,他将得到一个通知(我知道,这可通过日历或者笔记而是做于我而言并不重要)。

I want to create an application in android in which the user selects a certain day in the future and then, when that day arrives he will get a notification (I know that this can be done through the Calendar or the notes but that doesn't matter in my case).

我有两个问题concerting的previous:

I have two problems concerting the previous:

一个。我应该如何贯彻落实通知?我在其他地方了解事件添加到用户的谷歌日历 - 但这不是标准。我应该执行,检查,看看是否能日子已经到来一项服务并添加notificatin?

a. How should I implement the notification ? I read elsewhere about adding events to the Google Calendar of the user - but that is not standard. Should I implement a service that checks to see if that day has arrived and add the notificatin ?

乙。正如我写的,我关心的只有一天,而不是时间。这会为我以下的问题:我应该什么时候才能通知用户不要打扰他?当应用程序只知道通知之日(而不是时间),那么它如何确定在那一天什么时候居然通知用户?如果用户是什么睡了吗?是否有可能增加一个沉默的通知,使用户不会被人打扰?

b. As I wrote, I care about day only, and not time. This generates the following problem for me: When should I notify the user in order to not bother him ? When the application knows only the day of the notification (and not the time) then how can it determine at what time in that day to actually notify the user ? What if the user is asleep ? Is it possible to add a "silent" notification so that the user won't be bothered ?

TIA,
Serafeim

TIA, Serafeim

推荐答案

这两个问题是由状态栏通知解决了

Both problems are solved by a 'status bar notification'

<一个href=\"http://developer.android.com/guide/topics/ui/notifiers/notifications.html\">http://developer.android.com/guide/topics/ui/notifiers/notifications.html

您可以将声音添加到该提醒用户。

You can add a sound to this to alert the user.

如果用户为睡着了,即在手机上沉默,我相信该通知不会发出声音。

If the user is 'asleep' i.e. the phone is on silent I believe the notification won't make a sound.

的通知并不需要一天的时间,你可以通知在一天的最开始,用户将看到它时,他们首先检查有没有电话的那一天,所以时间是无关紧要的。

A notification does not need a time of day as you can 'notify' at the very start of the day and the user will see it when they first check there phone that day, so time is irrelevant.

您将有运行来检查数据的话​​,那么启动该通知的服务。它可能有一些特定的事件,将启动您的服务的话,这将检查日期事件侦听器,如果是的话发表您的通知!

You will have a service that runs to check the data yes, then start this notification. It may be possible to have an event listener for some given event that would start your service that would then check the date, and if so post your notification!

我可以写这类的教程,这听起来很有趣!

I may write a tutorial on this, it sounds fun!

修改

下面是我答应教程:

<一个href=\"http://blog.blundell-apps.com/notification-for-a-user-chosen-time/\">http://blog.blundell-apps.com/notification-for-a-user-chosen-time/

享受!

这篇关于的Andr​​oid在稍后的时间通知用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆