×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    10

    Question Minimized Application

    Hi All,

    How to know my application is in minimized state, while the application is running in the background? Is there any inbuild function/API to know application is displying or not like in blackberry MAMidlet.getUiApplication().isForeground() function.

    Please can any one help me.

    Thanks in advance,

    Ram
    Last edited by Ram9790; 2010-04-23 at 13:22.

  2. #2
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Minimized Application

    if im no mistaken you could use Display.getCurrent() and see if it's your own midlet...

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Minimized Application

    Displayable objects have an isShown() method, which tells you if they're displayed.

    Try:

    Code:
    Display.getDisplay(myMidlet).getCurrent().isShown();
    No guarantees. Applications don't necessarily run in the background.

    Graham.

  4. #4
    Registered User
    Join Date
    Nov 2009
    Posts
    10

    Re: Minimized Application

    Thanks Graham.

    One more problem. In my application I just extends the Midlet Class and Import All methods. As per your code i have to pass the Midlet as the parameter. So i try to create an object for the Midlet it gives Security Exception.

    We need to sign the application for this problem? Please help how to create Midlet instances.

  5. #5
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Minimized Application

    well, you just can send "this" within the MIDlet itself :
    Display.getDisplay(this).getCurrent().isShown();
    You actually never make an instance of your midlet, the AMS (pplication management software ) does, you might want to have a look at the MDIlet lifecycle as a whole, for example here :
    http://developers.sun.com/mobility/l...idp/lifecycle/

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Minimized Application

    Quote Originally Posted by Ram9790 View Post
    We need to sign the application for this problem? Please help how to create Midlet instances.
    AS Tiger suggested that you can not create the MIDlet's object and hence the same exception was thrown.To get rid of that you can just pass the "this" in the constructor of the canvas you are creating.Hence no signing in required.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Nov 2009
    Posts
    10

    Question Re: Minimized Application

    Thanks Tiger. your code is working. One more problem tiger,

    My application was in minimized state, but still some thread is running in the background.If it is any dialog or popup screen called, my application automatically maximized, even I am in some other application. How I solve this problem?

  8. #8
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: Minimized Application

    My application was in minimized state, but still some thread is running in the background.If it is any dialog or popup screen called, my application automatically maximized, even I am in some other application. How I solve this problem?
    Check the state of your application if it is background dont show any popup dialog which can call this app in foreground and if you want to notify some activity try palying a small beep, so that user knows that some event in your app as switchs to it after finishing his work.

    In J2me, afaik we cant get to know if the device is used by some other program or is free, from our background app...


    thanks,
    ~Amitabh

  9. #9
    Registered User
    Join Date
    Nov 2009
    Posts
    10

    Question Re: Minimized Application

    Hi Amitabh,

    I will explain my problem in detail. I try to Auto Lock the application after some minutes using the schduler, At the schduled time I just check application is shown or not using isShown method. If it is not visible one dialog box will appear to ask device password. At this point my application is in minimized state, i am in some other application(consider am watching some video or reading some messages) once the dialog box is appear my application is opened automatically and other application is minimized or paused.

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: Minimized Application

    once the dialog box is appear my application is opened automatically and other application is minimized or paused.
    Yes this will happen, what do you want to do... after taking password you can again minimize your application?

    thanks,
    ~Amitabh

  11. #11
    Registered User
    Join Date
    Nov 2009
    Posts
    10

    Re: Minimized Application

    Quote Originally Posted by im2amit View Post
    Yes this will happen, what do you want to do... after taking password you can again minimize your application?

    That is not a best way as per my understanding. Because the user minimize our application and using some other application, without user initiation application will open it should be irritating the user right.

Similar Threads

  1. Can't capture keypress in background application
    By Jick in forum Symbian User Interface
    Replies: 4
    Last Post: 2010-04-07, 05:39
  2. Not able to install application in mobile.
    By SymbianTH in forum Symbian
    Replies: 2
    Last Post: 2009-10-08, 11:34
  3. Want to run a j2me application from symbian
    By joy.mca in forum Symbian
    Replies: 15
    Last Post: 2009-09-12, 12:32
  4. problem in Auto starting application in s60_2nd_fp3
    By gaurav.gupta in forum Symbian
    Replies: 14
    Last Post: 2009-04-30, 11:09
  5. Application without icon in application menu
    By iulian_moldovan in forum Symbian
    Replies: 3
    Last Post: 2006-12-14, 09:38

Posting Permissions

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