×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    11

    Talking flashlite timer problem

    Hello,

    I've been experimenting porting a timer app to flashlite. I noticed that when the device powers off the screen (backlight) it also shuts down/ suspends the flashlite app. For something like a timer this doesn't work well. I realize you could force it to keep the backlight on and thus never go into standby. However, this isn't great battery-wise. I've seen some apps out there that have found a workaround for this, and they seem to be using flashlite as the interface. I presume you need to use python or one of the other dev languages to get it working?

    So in summery, I need a way to keep my flashlite app counting even when the display / device is set to keyboard lock/display off. Such that even if it's in standby / suspend mode it will still sound the alarm.

    Any help / direction greatly appreciated!

    Cheers,
    mobiman

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    11

    Re: flashlite timer problem

    Hmm, nearly 20 views with no replies? That might be a bad sign. I'm still optimistic!

  3. #3
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Re: flashlite timer problem

    Let me write the discussion in points :
    1- Flash Lite pause itself once it goes to background and once the backlight is off and the phone is locked than Flash Lite app is just paused and u cannot initiate any function call from Flash Lite Content.
    2- To complete this task , u have to write down a local server in any native language Python or Symbian C++, than ur flash content just give a call to that server once and the server itself keep running in the background and initiate an alarm on the given time.
    2- If u r a pure flash lite programmer and doesnt have much understanding of other languages, than u can go for Timer Plugin in Kuneri Lite. More info about Kuneri Lite is on the homepage and FAQ page of its site.
    3- As kuneri lite is not free if u use its plugins, therefore, u may want to build ur own server. If u have good knowledge of Pys60 than u can add this function by urself in this Python Local Server. For more details on, how to extend flash lite using other languages,please, search this dibo. We discussed this issue many times.

    Best Regards,
    SajiSoft

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Brazil
    Posts
    111

    Smile Re: flashlite timer problem

    You can use this class that I've adapted. It calculates only minutes, seconds e miliseconds. You can do the rest,

    class Clock{
    var time:Number = 0;
    var watchID:Number;
    var p:Number;
    var ctime:Number;

    var ntime:Number;

    var milliseconds;
    var seconds;
    var minutes;

    function start(){
    clearInterval(this.watchID);
    this.p = getTimer();
    this.ctime = this.time;
    var timer = function (stopwatch:Clock) {
    stopwatch.time = stopwatch.ctime+getTimer()-stopwatch.p;
    };
    this.watchID = setInterval(timer, 1, this);
    }

    function stop(){
    clearInterval(this.watchID);
    }

    function reset(){
    clearInterval(this.watchID);
    this.time = 0;
    }

    function toString():String{
    ntime = this.time;
    minutes = ((ntime/60000) >> 0);
    ntime-=minutes*60000;
    seconds = ((ntime*0.001) >> 0);
    ntime-=seconds*1000;
    milliseconds = ntime;
    if(minutes<10)minutes = '0'+minutes;
    if(seconds<10)seconds = '0'+seconds;
    if(milliseconds < 10){
    milliseconds = '00'+milliseconds;
    }else if(milliseconds < 100){
    milliseconds = '0'+milliseconds;
    }
    return minutes+':'+seconds+':'+milliseconds;
    }
    }

    Regards
    Atila Correia
    SCJP, SCWCD, SCJA and MCP C#
    Game Developer and 3D Modeller
    www.atilacorreia.com
    www.linkedin.com/in/atilacorreia

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    11

    Thumbs up Re: flashlite timer problem

    Thanks you very much for the guidance everyone. I guess I'll be learning some python. So just to clarify, I will run a python server to extend the functionality of the flash lite app such that: the python script will keep track of the timing and even when the phone goes on standby (backlight goes off) the python server will continue to run. At which point it will sound the alarm OR is the python server able to tell the flash to 'wake up' so it can handle the alarm functionality? or is it correct to say once the device goes into standby the flash lite app suspends and it cannot be 'woken up' unless the device it self comes out of stand by.

    Also, does this complicate a flash widget such that the user will need to install python on their device and also have the python script running? Ideally, I'd like to share this widget on the ovistore with the community. I really like the idea of using the WRT widgets and the zip package. Though I'm finding some issues with flash lite and that as well.

    Sorry if I'm over-complicating. Thanks in advance!

    Since power management is a large issue surrounding all mobile technologies this is a great discussion to hash out.

    Cheers,

    -mobiman
    Last edited by mobimanohya; 2010-05-18 at 03:39. Reason: added more info

  6. #6
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: flashlite timer problem

    At which point it will sound the alarm OR is the python server able to tell the flash to 'wake up' so it can handle the alarm functionality?
    First case will work fine and second case may have certain issues to deal with.
    Also, does this complicate a flash widget such that the user will need to install python on their device and also have the python script running?
    Obviously, the end-user have to install python to make ur server work. If u dont want to take a head ache of python runtimes than u have to code in Symbian C++ which is not easy for beginners .
    Ideally, I'd like to share this widget on the ovistore with the community. I really like the idea of using the WRT widgets and the zip package.
    Widgets are realy cool but due to the performance issues of a swf embedded in a widget , people choose sis packaging. Moreover, if u r thinking to write down a local server than it is good to use sis packaging coz u cant distribute a sis embed into a WRT ,however, the opposite to it i.e a WRT embeds into a SIS is possible.
    Since power management is a large issue surrounding all mobile technologies this is a great discussion to hash out.
    Right!. If u just want to make an alarm application than it is good to use Python or Symbian C++ instead of Flash + Python coz hybrid applications are powerful in work but a lil bit costly for the battery.

    Best Regards,
    SajiSoft

  7. #7
    Registered User
    Join Date
    May 2010
    Posts
    11

    Talking Re: flashlite timer problem

    Sajisoft thank you very much for your continued help and for addressing each question!

    I'll have to take a look at the C++ Sis creation mehtod - hopefully I can wrap my head around it. Is there any introduction tutorials you can recommend? Or is such a thing possible ?

    It would be awesome to see the widgets use the flash lite stand alone player, since this is the ideal container to deploy the flash lite content. Basically, it just streamlines accessing flash lite content on the device (instead of having to browse to it). Now that I think about it, eventually I'm sure we'll be able to put a shortcut to any file on our mobile phones, just like we do on our desktops! I mean maybe I would like to have a link to a txt file with things I always forget in it. Surely, a smart phone should do this. No pun intended

    One quick question. If I do look into learning C++ for symbian, is it still possible to use flash lite as the front end for applications? This is really limited to a timing application or anything where going in standby is an issue. So for this one app I don't know if I can justify the time investment on how to get it to work with C++. sigh.

    Again, thanks for the awesome and prompt guidance!

    Kind regards,

    -mobiman
    Last edited by mobimanohya; 2010-05-18 at 04:54. Reason: another add

  8. #8
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: flashlite timer problem

    I'll have to take a look at the C++ Sis creation mehtod - hopefully I can wrap my head around it. Is there any introduction tutorials you can recommend? Or is such a thing possible ?
    SIS creation for Flash Lite using Carbide C++ (Symbian C++ IDE) is as easy as ABC after reading this article :
    Create_Flash_Applications_with_Carbide.c++
    BUT the real question is it easy to create a local server using Symbian C++ to extend Flash Lite? I think u dont have to go for it unless u get fundamentals of Symbian C++ .For Getting Stated with Symbian C++ , go here :
    Getting_Started with Symbian C++
    Moreover, once u get basics than u can try this open-source local server for flash lite :
    Janus Symbian
    One quick question. If I do look into learning C++ for symbian, is it still possible to use flash lite as the front end for applications? This is really limited to a timing application or anything where going in standby is an issue..
    Yes it is possible to use Flash Lite as front end and Symbian C++ at back end. & u can get access to many features of symbian OS via Symbian C++ <-> Flash lite.
    I don't know if I can justify the time investment on how to get it to work with C++.
    Well! I think it needs time and patience to learn Symbian C++ coz in the beginning u may get 100 of errors like missing libraries , invalid syntax etc but it really depends upon ur interest and how much time u give to Symbian c++.

    BTW, if u look around than u came to know that sooner or later Nokia replace Symbian C++ with QT . But right now QT also needs runtimes to be installed like Python and QT also needs the help of Symbian C++ apis in accessing some features. So, take a look at Symbian C++ and decide urself what ur nature allows u to do .

    Wish U Luck and Patience for your work .

    Best Regards,
    SajiSoft

  9. #9
    Registered User
    Join Date
    May 2010
    Posts
    11

    Re: flashlite timer problem

    Lots of info here SajiSoft. Thank you. I'm going to take some time and look through some of this stuff. It is a bit intimidating and I'll need to figure out if C++ is worth the effort. Maybe it is time I up my programming game. Thank you for the warm welcome to forum nokia. I can see why you're a champion! .

    Cheers!
    -mobiman

  10. #10
    Registered User
    Join Date
    Jan 2007
    Location
    bucharest
    Posts
    222

    Re: flashlite timer problem

    it's simple...

    try use the phones time...

    ok, you start the timmer... and take a look at phone's time...

    make the count down, and verify if you are in sync with the phone's watch... when your sync is out let's say 1sec, you update your timmer (that is if your timmer has some ongoing animation in the hole second)

    it is complicated because you have to make time operations... like 5min minus 10min is 55min and so on...

    use this
    Code:
    ...
    mydate=new Date();
    timeH=mydate.getHours();
    timeM=mydate.getMinutes();
    timeS=mydate.getSeconds();
    ...
    Quote Originally Posted by mobimanohya View Post
    Hello,

    I've been experimenting porting a timer app to flashlite. I noticed that when the device powers off the screen (backlight) it also shuts down/ suspends the flashlite app. For something like a timer this doesn't work well. I realize you could force it to keep the backlight on and thus never go into standby. However, this isn't great battery-wise. I've seen some apps out there that have found a workaround for this, and they seem to be using flashlite as the interface. I presume you need to use python or one of the other dev languages to get it working?

    So in summery, I need a way to keep my flashlite app counting even when the display / device is set to keyboard lock/display off. Such that even if it's in standby / suspend mode it will still sound the alarm.

    Any help / direction greatly appreciated!

    Cheers,
    mobiman
    Last edited by shpe11; 2010-05-18 at 13:34. Reason: added some code...
    http://m.shpe.ro
    http://work.shpe.ro
    http://purchase.shpe.ro/iPics

  11. #11
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: flashlite timer problem

    Hi shpe11,
    I respect the way u help others, but please, read the issue again. He wants to set an alarm using timer in flash lite which even rings when flash lite content is in background or phone is locked. Timer class in Flash Lite cannot achieve this task at all because flash lite content just get a pause when it goes to background.

    Best Regards,
    SajiSoft

  12. #12
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Re: flashlite timer problem

    Is it possible to create the timer app only as a WRT using JavaScript and not use flashlite? Will the same issue occur to the WRT?

  13. #13
    Nokia Developer Champion
    Join Date
    Feb 2005
    Location
    Karachi, Pakistan
    Posts
    277

    Re: flashlite timer problem

    In regards to Flash Lite + Python based solution for dealing with timer running in background.

    1. It's possible, I have done this. Look in SWF2Go wiki for working sample application to get you started
    2. The hard part is making a simple installable for the end-user with everything packaged as SIS. This is also possible with SWF2Go.
    3. SWF2Go allows you to package PyS60 runtime or your custom Symbian C++ / Qt server SIS files into one single installer.

    SWF2Go 2.6 is now available as trial version, with no limitations in features. You can download it for free from www.swf2go.com

    Best regards,

    // chall3ng3r //
    Faisal Iqbal (skype: chall3ng3r)
    Flash Mobile Specialist | Orison Technologies
    _____________________________________
    blog: F·L·A·S·H·I·S·M
    swf2go: www.swf2go.com

Similar Threads

  1. Replies: 2
    Last Post: 2010-03-08, 08:03
  2. Zooming problem in FlashLite 2.1 with AS 2.0
    By vaan_dino in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2010-01-15, 22:53
  3. Timer problem... itz urgent.....
    By Priya23 in forum Symbian
    Replies: 2
    Last Post: 2009-08-22, 20:54
  4. Timer problem???
    By arun09 in forum Symbian
    Replies: 4
    Last Post: 2009-08-05, 16:39
  5. Timer problem in device
    By Zilppuri in forum Symbian
    Replies: 1
    Last Post: 2009-03-02, 18:46

Posting Permissions

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