Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript PhoneGap
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 Smile | :)
 
Thanks in advance
Posted 26-Jun-13 4:06am
Edited 26-Jun-13 4:09am
v2
Comments
Nelek at 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.
Ram1419 at 27-Jun-13 2:32am
   
Thank you Nelek...your idea is useful..
Nelek at 27-Jun-13 13:06pm
   
You are welcome :)

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
 
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
  Permalink  
v2

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

  Print Answers RSS
0 Kornfeld Eliyahu Peter 275
1 Maciej Los 204
2 Sergey Alexandrovich Kryukov 200
3 King Fisher 185
4 OriginalGriff 183
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 26 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100