×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    Issue regarding date and time

    hi friends,

    1]
    I need to calculate the expiry date of an application i.e
    when the application is opened for the first time ,I will note down the date and time using TTime class : [ time.Hometime() ]

    2] Then every time when I open the application I wil get the current date and time using TTime class then calculate the difference between dates of 2 TTime objects and then decide
    whether the product has expired or no.

    3]
    But the issue here is, TTime class returns me the date time set by the user in the clock application of the phone.
    In this user can always set the date before the expiry date and the application wil never expire.

    So, what i want to ask is, can I get the [System Date and time] and not the one set by the user. Is there any way??

    Thanks,
    himanshu k

  2. #2
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: Issue regarding date and time

    You can make your application to hear for system time changes and take the necessary actions...

    http://wiki.forum.nokia.com/index.ph...em_Time_Change

  3. #3
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Issue regarding date and time

    yes that is a problem, only solution i can see if there is any way we can get the "Device Life Time".

  4. #4
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    Re: Issue regarding date and time

    hi deepchand86,

    Thanks for your reply.

    See, but according to the example given,my application should always be running in the background to get the system time change notifications

    Do i need to develop a small exe which wil,always run in background to get notifications

    Thanks,
    himanshu k.

  5. #5
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: Issue regarding date and time

    Ya you cud run a console app in background for this process alone ...

  6. #6
    Nokia Developer Moderator
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: Issue regarding date and time

    Quote Originally Posted by skumar_rao View Post
    yes that is a problem, only solution i can see if there is any way we can get the "Device Life Time".
    Do you know how to get it?

  7. #7
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Issue regarding date and time

    Quote Originally Posted by A.A.M. View Post
    Do you know how to get it?
    No, i have not came across any APIs, I am Wishing if we have a API to get that.

    Quote Originally Posted by deepchand86 View Post
    Ya you cud run a console app in background for this process alone ...
    don't you think it is little over killing

  8. #8
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: Issue regarding date and time

    don't you think it is little over killing
    yes it's overkilling...But can't help it unless we go for another security mechanishms like server authentication, etc..

  9. #9
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    Re: Issue regarding date and time

    hi deepchand86,

    Thanks for your suggestion and reply.
    See I haven't worked on any background application before as putting a console exe in background. but wil technically try to sort it out.

    Just clearing the logic of what I wil do, any issues please suggest:

    1] When I wil open my application for first time only, the background console exe wil start running in background.

    2] This console exe, will implement an active object, and i will cal the RTimer onject in the following way :

    a) after initialization and construction :
    iTimer.After(iStatus, interval);
    SetActive();

    here interval will be the time interval in micro seconds for say 7 days.
    after 7 days RunL() will be called indicating that my time has expired.

    b)
    RunL()
    {

    }

    That is the way i wil implement.

    c) One issue that may arise is if i close my phone (power off) what happens to the background application. please clarify???

    Any suggestions in this. I hope this can be done???

    Thanks,
    himanshu k.

  10. #10
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Issue regarding date and time

    1. you have to put your monitor application as a start-on-Boot application.
    2. monitor only when date and time changed.

  11. #11
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: Issue regarding date and time

    You shud make the console app as a Boot-up appln...i.e it will execute when the phone is switched on...
    You cud store the Timings in a file and make use of it in Start-up...


    http://wiki.forum.nokia.com/index.ph...Management_API

  12. #12
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    Re: Issue regarding date and time

    hi friends,

    Thanks for your reply.

    Currently my GUI application is a boot up application. It behaves differently when manually started and when started from boot-up.

    When 1st time my application is opened,I will write the date-time to the file,
    Suppose, it is say 1st Feb 2009, then my expiry will be 15 Feb 2009.
    But what,if the user manually changed the date from clock application prior to 15 Feb,
    then in that case my application will never expire.

    But, I am not able to make it out how store the Timings in a file at boot up will solve my problem. at boot up i wil get the hometime() which wil be wrong if the user has changed.

    In the same thread reply no 9,I hav suggested some code, will it not work or i mean that it is technically not possible?????

    please suggest!!!!
    Thanks again for your time,
    himanshu k.
    Last edited by himsymbian; 2009-01-21 at 08:49.

  13. #13
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Issue regarding date and time

    you should be checking the valid time only on Application start up. And Monitor For Date and Time change, if user changes date and time just try compensate your expiry time with changed time.

    means if you installed on 1st of FEB and on 10th FEB user reset his device time to 2nd FEB but as you are monitoring you know that only 5 days left for expiry. so you can reduce the expiry date to 7th of FEB. So Effectively your application will be active for 15 days only.

  14. #14
    Regular Contributor
    Join Date
    Apr 2005
    Posts
    274

    Re: Issue regarding date and time

    hi skumar,

    Really thanks for your time and reply.
    Just Let me make clear what my application is, so that i can be clarified about your solution. please bare with me!!

    1]
    I have developed a 3rd edition fep:
    or that:
    a) I am having a Setup application which just activates my custom fep.

    b) My fep is a background application for every text input editor(predictive text),so when any text input editor opens my fep is running.(if activated in setup).

    c) My Setup application starts at boot-up also,to ask user regarding activation of my fep again.

    These are the three different ways my application can start up.

    2] Initially my setup will be opened,when opened for 1st time,I will write the date-time to the file,this will happen only once.

    3] As you say, [you should be checking the valid time only on Application start up] and
    [Monitor For Date and Time change]

    i.e when you say monitor for Date and time change should i refer to reply 2 of this thread [http://wiki.forum.nokia.com/index.ph...m_Time_Change]

    Every time when I start my application [in one of the three ways above] I should implement the Active Object as mentioned in [Notification of System Time Change]
    and check for TTime change.

    What I want to ask you is, suppose I open my application around 11.00 am then closed it. then user changes the date at 1.00 pm, and when again I,open the application at 3.00 pm
    will my active object acknowledge the change? or i have to run in background all the time.

    Thanks again,
    Just wanna be clear about yur solution.
    Any thing I am not able to explain or not gettable please say.

    Thanks,
    himanshu k.

  15. #15
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Issue regarding date and time

    you must monitor the date and time change in a separate application that will run always.

Similar Threads

  1. Date & Time Editor in Form Resource.
    By Kavit Patel in forum Symbian
    Replies: 2
    Last Post: 2008-03-03, 06:26
  2. Date And Time Editor issue
    By girishvmx in forum Symbian User Interface
    Replies: 8
    Last Post: 2008-01-30, 08:43
  3. Date And Time Editor issue
    By Deepa msc in forum Symbian
    Replies: 3
    Last Post: 2008-01-30, 02:30
  4. Replies: 0
    Last Post: 2008-01-03, 17:58
  5. 6670 asks for date time on startup
    By collinar in forum General Development Questions
    Replies: 0
    Last Post: 2005-09-28, 16:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •