×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 35
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    29

    How to run the Mobile Application in mobile background even we exit the application

    How to create the mobile application with below functionality in J2EE:


    1. After installed the mobile application in mobile its runs automatically.

    2. It displays the alert with some message in every 10 seconds.

    3. Even we exit the application in mobile , the alert should display in every 10 seconds.

    Pls help me...

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

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    Quote Originally Posted by jayamnkl View Post
    How to create the mobile application with below functionality in J2EE:


    1. After installed the mobile application in mobile its runs automatically.

    2. It displays the alert with some message in every 10 seconds.

    3. Even we exit the application in mobile , the alert should display in every 10 seconds.

    Pls help me...
    1.direct implementation is not possible in Java ME.For the another alternatives you can browse the links as-
    http://discussion.forum.nokia.com/fo...ad.php?t=69056
    http://discussion.forum.nokia.com/fo...d.php?t=130787
    2.Once your application is active then you can easily display the alert repeatedly.
    3.Not possible in Java ME.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: How to run the Mobile Application in mobile background even we exit the applicat

    u cant run the application in background or foreground whatever after exiting the application. set ur current displayable null. or use pushregistry for run the application in background with the condition that application will not be exited..
    Last edited by jitu_goldie; 2009-04-14 at 07:25.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  4. #4
    Registered User
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    Vineet Billorey "The Great"

  5. #5
    Registered User
    Join Date
    Apr 2009
    Posts
    29

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    Ya,,I already developed the application using push registry concept.. And run the application via OTA in J2ME WTK.. Its working perfectly..

    1. After i put the JAD and JAR files in web server and download the jar in mobile browser it shows " Gateway received on invalid response from the upstream gateway" Error. How to solve it?


    This is JAD File
    ==================


    MIDlet-1: socket, socket.png, socket
    MIDlet-Jar-Size: 7373
    MIDlet-Jar-URL: http://myserver/site/socket.jar
    MIDlet-Name: socket
    MIDlet-Permissions: javax.microedition.io.Connector.socket
    MIDlet-Push-1: socket://:8084, socket, *
    MIDlet-Vendor: Unknown
    MIDlet-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0

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

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    Hi,
    This is the server side issue.
    you must be getting the response code..and response message
    what are these?
    which device you are working with?
    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
    Apr 2009
    Posts
    29

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    N70 Device....

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

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    Quote Originally Posted by jayamnkl View Post
    N70 Device....
    What about the rest of the information?
    Why dont you provide the complete information in a single post.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Registered User
    Join Date
    Jan 2009
    Posts
    6

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    I m not a developer, but i found the feature u requested in clickova application this even works in s40 mobiles. U may explore that application or contact those developers for its basic programming.
    Hope it may help u.

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

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    Hi brahmajivv,
    Can you share that related to which part of the post,it solved the issue?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  11. #11
    Registered User
    Join Date
    Apr 2009
    Posts
    29

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    hi frnds,

    This is my midlet coding. Its working when i run via OTA in J2ME WirelessTool kit. How to install that JAR and JAR files in Mobile(N70 Series)



    import javax.microedition.midlet.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import java.io.*;
    import java.util.*;
    public class sample extends MIDlet {




    String defaultFilter = "*";
    String midletClassName = this.getClass().getName();
    private StringBuffer results;
    private Timer timer;
    private RunTimerTask tt;
    private long defaultDeltaTime = 6000;


    private Display myDisplay = null;
    private Form resultScreen;
    private StringItem resultField;

    public sample() {

    results = new StringBuffer();
    myDisplay = Display.getDisplay(this);
    resultScreen = new Form("Page Content:");
    }

    public void startApp() {
    try {
    PushRegistry.registerConnection("socket://:8084",midletClassName, defaultFilter);
    }
    catch (Exception e)
    {
    //System.out.println("Error : "+e);
    }
    timer = new Timer();
    tt = new RunTimerTask();
    timer.schedule(tt,0, 3000);

    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    try {

    scheduleMIDlet(defaultDeltaTime);
    } catch(ClassNotFoundException e) {
    System.out.println("Exception during destroyApp()");
    e.printStackTrace();
    } catch(ConnectionNotFoundException e) {
    System.out.println("Exception during destroyApp()");
    e.printStackTrace();
    }
    }

    private boolean isPushActivated() {

    String[] connections = PushRegistry.listConnections(true);
    if (connections != null && connections.length > 0) {
    return(true);
    }
    return(false);
    }

    private void scheduleMIDlet(long et)
    throws ClassNotFoundException, ConnectionNotFoundException,
    SecurityException {
    Date alarm = new Date();
    String midletClassName = this.getClass().getName();
    long t = PushRegistry.registerAlarm(midletClassName, alarm.getTime()+et);
    }
    private class RunTimerTask extends TimerTask
    {
    public final void run()
    {

    Alert mTimedAlert = new Alert("", " Welcome", null, AlertType.INFO);
    myDisplay.setCurrent(mTimedAlert);
    mTimedAlert.setTimeout(2000);
    }
    }

    }



    This is JAD File
    ==================

    MIDlet-1: sample, sample.png, sample
    MIDlet-Jar-Size: 2770
    MIDlet-Jar-URL: http://myserver/site/sample.jar
    MIDlet-Name: sample
    MIDlet-Push-1: socket://:8084, sample, *
    MIDlet-Vendor: Unknown
    MIDlet-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0
    Last edited by jayamnkl; 2009-04-14 at 10:20.

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

    Thumbs up Re: How to run the Mobile Application in mobile background even we exit the applicat

    How to install that JAR and JAR files in Mobile
    Hi,
    Can you see that where are the both files...?
    if yes then there are a few way to send the and install the jar file on the device.
    1. OTA (Over the Air)
    You have to upload the .jad and .jar file to a server,create a wap or html page with a link to the .jad file

    At the phone you have to open the web browser, a load the page and follow the .jad link, the phone will begin to download and install the midlet.
    2.Explicit physical connection via USB cable
    3.Direct InfraRed (IR) connection
    4.Direct Bluetooth connection
    Please check that is this helpful for you?
    Last edited by raj_J2ME; 2009-04-14 at 10:26. Reason: add 1 line
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  13. #13
    Registered User
    Join Date
    Apr 2009
    Posts
    29

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    I installed the Jar directly through Bluetooth in mobile. The application is running.. But After exit the application the Alert is not displayed in the screen..


    So I'm trying to OTA Method..

    I put the jad and Jar in my web server.. When i download the JAD, the page cannot found error is displayed. When download the JAR , the Gateway Error is displayed.. Pls help me..
    Thanks,
    Jayam

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

    Thumbs up Re: How to run the Mobile Application in mobile background even we exit the applicat

    Hi,
    I guess that you are looking for the following functionality,
    3. Even we exit the application in mobile , the alert should display in every 10 seconds.
    I guess, with the single midlet you will not be able to do this with the current midlet that currently you are working with.Since once you exit the application(Means you kill the application)..then there is no scope for existing the application.

    Well,For this you can proceed like this-
    Take two midlets,and then
    1.Set the push registry at the time of the exiting the application..
    2.This will invoke the another second midlet,set above in the push registry..
    3.in the second midlet display the alert..
    This is the algorithm,
    Code:
        public void commandAction(Command cmd, Displayable d)
        {
            if (cmd == exitCmd)
            {
                PushRegistry.registerAlarm("Midlet-2-name",10000);
                midletObject.notifyDestroyed();
                midletObject.destroyApp();
            }
        }
    For displaying the alert after 10 seconds,your 2nd midelt will be like this,
    Code:
    /*
     * Midlet2.java
     *
     * Created on April 14, 2009, 3:19 PM
     */
    
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    
    /**
     *
     * @author  rajiv
     * @version
     */
    public class Midlet2 extends MIDlet
    {
        Alert alert = null;
        public void startApp()
        {
            alert = new Alert("Midlet-2 after invoked","Hello",null,AlertType.CONFIRMATION);
            alert.setTimeout(Alert.FOREVER);
            Display.getDisplay(this).setCurrent(alert);
        }
        
        public void pauseApp()
        {
        }
        
        public void destroyApp(boolean unconditional)
        {
        }
    }
    Hope that this will help you.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  15. #15
    Super Contributor
    Join Date
    Jan 2008
    Location
    Amravati, India
    Posts
    546

    Re: How to run the Mobile Application in mobile background even we exit the applicat

    Quote Originally Posted by jayamnkl View Post
    I installed the Jar directly through Bluetooth in mobile. The application is running.. But After exit the application the Alert is not displayed in the screen..


    So I'm trying to OTA Method..

    I put the jad and Jar in my web server.. When i download the JAD, the page cannot found error is displayed. When download the JAR , the Gateway Error is displayed.. Pls help me..
    I doesn't matter whether phone gets jar and jad files from web server via http or from a local device (PC or phone) via bluetooth. Just make sure you have transferred both jad and jar files in Inbox of the phone via bluetooth

Similar Threads

  1. there is any mobile configuration to run selevlet program from midlet that send sms
    By amr_hhh in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-04-26, 17:29
  2. Replies: 11
    Last Post: 2007-10-03, 19:46
  3. Replies: 0
    Last Post: 2007-07-15, 23:06
  4. N70 Reset bug
    By sebboB in forum General Development Questions
    Replies: 2
    Last Post: 2005-12-28, 23:09
  5. Can we convert a JAVA PC application to Mobile application ??
    By rehans_2k in forum Mobile Java General
    Replies: 1
    Last Post: 2002-07-01, 11:33

Posting Permissions

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