×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    10

    Bring widget foreground

    Hi everyone.Its my first day here. I hope to use some help....

    I created an alarm widget whereby after setting the time the widget will send to background.
    May I know how to automatically bring the widget foreground programatically that has been sent to background using

    function goToBackground()
    {
    widget.openApplication(0x102750F0);
    }

    The widget must auto open back(foreground) upon my function :setTimeout(60000).

    Thanks in advance

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Bring widget foreground

    Hi ghimyap,

    in order to bring a widget to foreground, you can use the very same approach you use to send it to background, so using the openApplication() method, but passing the widget's UID to this method, instead of the home/standby application's one.

    Since the widget does not automatically know its UID, you first have to retrieve that, and you can do it by using the AppManager API (available on WRT 1.1 runtime). By listing the installed applications, you can find your widget's data, and so also its UID.

    Please note also that on devices with BrowserNG version older than 7.1.17501, timers of background widgets are not triggered, so your approach will not work on these devices:
    http://wiki.forum.nokia.com/index.ph..._BrowserNG/7.1

    Hope this helps,
    Pit

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    10

    Re: Bring widget foreground

    Hi pit

    Thanks for your solution. Pls tell me more on how to launch/get to AppManagerAPI on WRT1.1.
    I am very new to all this program and software.

    Currently using Aptana Studio 2.0 to program my widget and run on SDK S60 Nokia Symbian OS, 5th edition emulator. So in this case will my setTimer() function still work ??


    Thanks Thanks Thanks

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Bring widget foreground

    Hi ghimyap,

    you should use the following AppManager API's methods:
    * GetList to get the list of installed apps, where you have to look for your widget
    * LaunchApp to launch your widget (here also widget.openApplication() would work)

    About the issue, as told on the Wiki page, background timers work on devices with browsers newer than 7.1.17501 version. Also note that, if the user has at least one homescreen widget, then background timers will not be fired at all.

    Pit

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    2

    Re: Bring widget foreground

    Hi,

    Quote Originally Posted by jappit View Post
    you should use the following AppManager API's methods:
    * GetList to get the list of installed apps, where you have to look for your widget
    * LaunchApp to launch your widget (here also widget.openApplication() would work)
    If the need is to only obtain the UID of some specific application, I'd recommend using the great Y-Tasks app from DrJukka (http://www.drjukka.com/YTasks.html) if possible. That app is a great tool and is able to tell much more about installed applications than just their UIDs.

    Br,

    HH

  6. #6
    Registered User
    Join Date
    Jan 2010
    Posts
    10

    Re: Bring widget foreground

    Hi Pit

    Can I have an example of the widget of the 2 methods in helping me to bring my widget foreground once again.
    I have tried but to no avail =(.

    Thanks thanks

  7. #7
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Bring widget foreground

    Hi ghimyap,

    you can find the code to list installed applications here:

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

    By using this code, you have to look for your widget by checking all the applications' names.

    Once you've found it, you can easily retrieve its UID and then use it in your widget. Also, you can store it as a preference, so avoiding the need to list the installed applications each time.

    Hope it helps,
    Pit

  8. #8
    Registered User
    Join Date
    Jan 2010
    Posts
    10

    Re: Bring widget foreground

    Hi Pit

    Thank you.
    Everything is working good with your example.
    Thanks a lot.

    ghimyap

Similar Threads

  1. Replies: 1
    Last Post: 2009-10-25, 13:06
  2. S60 eswt midlet: Bring it to foreground and background!
    By thejakumarsk in forum Mobile Java General
    Replies: 0
    Last Post: 2009-08-10, 12:20
  3. Replies: 6
    Last Post: 2006-11-30, 03:44
  4. how bring to app to foreground - help!
    By ameliedelaire in forum Symbian
    Replies: 8
    Last Post: 2006-05-17, 13:22
  5. Replies: 6
    Last Post: 2005-12-21, 09:13

Posting Permissions

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