×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    68

    Question Application Without UI in the background

    Hi,

    I need to developp an application (without UI), which run in the background of the mobile and do an action every x seconds.
    i need to use "Push Registry" o is there a way more easly ?

    Thanks you for your help.

  2. #2
    Regular Contributor
    Join Date
    Feb 2005
    Location
    Karachi, Pakistan
    Posts
    277

    Re: Application Without UI in the background

    Hi there,

    You can make a console application without any GUI. And can do anything you'd like to do while application is running in the background.

    Checkout the following link:
    http://wiki.forum.nokia.com/index.php/Gui_vs_Console

    And also check out this sample, which will tell you how you can make the BG process work check for events etc.
    http://wiki.forum.nokia.com/index.ph...e_%28Server%29

    Update: Sorry, my bad. I didn't noticed in which forum the question was posted.

    Hope it helps,

    // chall3ng3r //
    Last edited by chall3ng3r; 2008-08-27 at 11:46.
    Faisal Iqbal (skype: chall3ng3r)
    Flash Mobile Specialist | Orison Technologies
    _____________________________________
    blog: F·L·A·S·H·I·S·M
    swf2go: www.swf2go.com

  3. #3
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    68

    Re: Application Without UI in the background

    i want to do it in Java not in C++

    I don't want to catch event, i want only a timer which run in background.

    using display.setCurrent(null); is it good ?

  4. #4
    Registered User
    Join Date
    Jan 2008
    Location
    Pune
    Posts
    24

    Re: Application Without UI in the background

    Hi,
    You can run MIDlet in background or more precise without GUI, It was working in my Series 40 devices. But while running app in the background dosnt mean u can run other application in foreground, any other application will not execute( I have checked it on Series 40 but not sure abt S60). Actually this is based on multiprocessing . Since Symbian supports multiprocessing, it could work on Symbian device like S60 and higher end and some SonyE.

    anjan

  5. #5
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    68

    Re: Application Without UI in the background

    Quote Originally Posted by anjan_singha View Post
    Hi,
    You can run MIDlet in background or more precise without GUI, It was working in my Series 40 devices. But while running app in the background dosnt mean u can run other application in foreground, any other application will not execute( I have checked it on Series 40 but not sure abt S60). Actually this is based on multiprocessing . Since Symbian supports multiprocessing, it could work on Symbian device like S60 and higher end and some SonyE.

    anjan
    How did you that ? Do you have any sample ?

    Using Push Registry, can i set aan alaram to wake up my midlet every hours and close it ?

  6. #6
    Registered User
    Join Date
    Jan 2008
    Location
    Pune
    Posts
    24

    Re: Application Without UI in the background

    Hi gregb34,

    As I told you, you can run only one application at a time in series 40, it may be non GUI. You may try with display.setCurrent(null); by preparing very basic MIDlet.

    Regarding PushRegistry:
    this code may help you (I am not sure about Nokia series 40), try it on S60 and SE-->

    class Register extends Thread
    {
    public Register()
    {
    }
    public void run()
    {
    try {
    System.out.println("+");
    PushRegistry.registerConnection("autostart://:", "AutoStart", "*");
    } catch (ClassNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }
    }

    and call this thread from ur MIDlet by:

    new Register().start();

    you will get details on:
    http://developers.sun.com/mobility/m...icles/pushreg/

    hope it will help

  7. #7
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Tel-Aviv,Israel
    Posts
    100

    Re: Application Without UI in the background

    Y

  8. #8
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    68

    Re: Application Without UI in the background

    with Push Registry can i setup an alarm to make an action every x secondes ? because, i have see an alarm functionnality.

  9. #9
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Tel-Aviv,Israel
    Posts
    100

    Re: Application Without UI in the background

    Focus on This
    Code:
    /**
     *  Schedule this MIDlet's launch.
     *  @param deltatime the length of time in
     *  milliseconds before expiration.
     */
    private void scheduleMIDlet(long deltatime)
        throws ClassNotFoundException,
        	   ConnectionNotFoundException,
    	   SecurityException {
    
        String cn = this.getClass().getName();
        // Get the current time by calling Date.getTime()
        Date alarm = new Date();
        long t = PushRegistry.registerAlarm(cn,
             alarm.getTime()+deltatime);
    }

    Rest is in:

    http://developers.sun.com/mobility/m...icles/pushreg/
    Y

  10. #10
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    68

    Re: Application Without UI in the background

    Quote Originally Posted by ypele View Post
    Focus on This
    Code:
    /**
     *  Schedule this MIDlet's launch.
     *  @param deltatime the length of time in
     *  milliseconds before expiration.
     */
    private void scheduleMIDlet(long deltatime)
        throws ClassNotFoundException,
        	   ConnectionNotFoundException,
    	   SecurityException {
    
        String cn = this.getClass().getName();
        // Get the current time by calling Date.getTime()
        Date alarm = new Date();
        long t = PushRegistry.registerAlarm(cn,
             alarm.getTime()+deltatime);
    }

    Rest is in:

    http://developers.sun.com/mobility/m...icles/pushreg/
    In fact, i don't know where i need to put the code in the project. My Application is made only by one class which use Push Registry ?

  11. #11
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Tel-Aviv,Israel
    Posts
    100

    Thumbs up Re: Application Without UI in the background

    Hi,
    In Your J2ME Suit, Create two classes,
    One class - your main functionality,
    Second- your Push Reg Timer.
    (both can be in one file).
    The PR Class will operate your First class.. by setting :
    Code:
    PushRegistry.registerAlarm(FIRSTCLASS,alarm.getTime()+deltatime);
    Bare in mind - TO have Push Reg works - the classes must be in the same suit. - Same jar file. if its not on your plans to have it list this, then use SOCKET \ DATAGRAM connections and define TIMER & TASKER.
    Y

Similar Threads

  1. Replies: 0
    Last Post: 2008-04-24, 12:33
  2. How to start a application in background?
    By shunxing in forum Symbian
    Replies: 3
    Last Post: 2008-03-14, 10:03
  3. Background application
    By iulian_moldovan in forum Symbian
    Replies: 1
    Last Post: 2007-02-16, 22:44
  4. Background application
    By 1xuname1x in forum Mobile Java General
    Replies: 2
    Last Post: 2006-05-25, 18:18
  5. Application in background problem
    By kiranpuranik in forum Symbian
    Replies: 2
    Last Post: 2006-04-20, 07:56

Posting Permissions

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