Click here to Skip to main content
15,887,320 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..,

I am new to phonegap..

Right now i am developing simple android application of my own Interest.

what i'm doing here is that, i am storing date of birth of all of my friends manually.


The application should alert me Whenever it finds any birthday of my friends....

For that, i need to check my table whether any of my friends having birthday or not.. and i need to know here , How to Fire an Event at certain hour and only once a day???

Any ideas would be appreciated :)

Thanks in advance
Posted
Updated 26-Jun-13 3:09am
v2
Comments
Nelek 26-Jun-13 9:29am    
If you want to do your reminder, you should read the date&time of the phone, so if you already have it... compare the time with, let's say, if ((current_time >= 09:00) AND (today_updated==false)){call update(); today_updated==true;} or something similar, and compare another time with 23:55 so you can reset the "today_updated" flag.
Ramkumar K 27-Jun-13 2:32am    
Thank you Nelek...your idea is useful..
Nelek 27-Jun-13 13:06pm    
You are welcome :)

1 solution

I know nothing about phonegap, but as for javascript:

you can use the JS-Function

setTimeout(/javascript function/,milliseconds);

It executes the Function you pass after a specified time. For example

JavaScript
var birthday = /* a value you presumably somehow get from your phonegap framework thing*/
var now = Date.now();

setTimeout(reminder, birthday - now);  /*where reminder is another javascript function*/


Something this way
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900