×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    29

    Running Mobile application in J2ME WTK via OTA but not in Mobile

    hi,

    I'm using this midlet program.. Its working when run via OTA in J2ME WTK.. Every 3 seconds it display the "Welcome" Alert even we exit the application but not working in the mobile device.(N70 Series). I download the sample.jar and sample.jad in mobile through Bluetooth.Then i installed sample.jad. After installed the alert is displayed every 3 seconds. But after exit the application the alert is not displayed in mobile. Pls help me..



    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();
    // use a StrignBuffer to store the retrieved page contents
    private StringBuffer results;
    private Timer timer;
    private RunTimerTask tt;
    private long defaultDeltaTime = 6000;

    // define GUI components
    private Display myDisplay = null;
    private Form resultScreen;
    private StringItem resultField;

    public sample() {
    // initializing GUI display
    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 {
    // Set up the alert and force the MIDlet to exit.
    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() {
    // Discover if there are pending push inbound connections and
    // if so, dispatch a PushProcessor for each one.
    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);
    }
    }

    }
    Thanks,
    Jayam

  2. #2
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Running Mobile application in J2ME WTK via OTA but not in Mobile

    Hi,
    What is the Jar size.check whether it complies with N70 jar Specification
    Thanks
    soku

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

    Re: Running Mobile application in J2ME WTK via OTA but not in Mobile

    Quote Originally Posted by soku123 View Post
    Hi,
    What is the Jar size.check whether it complies with N70 jar Specification
    Thanks
    soku
    The Jar size is 3KB only.. N70 Jar Specification is Unlimited.. May i know What is difference b/w OTA Downloading and Bluetooth.. Both are same concept or not.. If no means, pls explaine..
    Thanks,
    Jayam

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Running Mobile application in J2ME WTK via OTA but not in Mobile

    Have you signed the application? It seems to me that you are probably getting a SecurityException on the phone when you try to register the alarm.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com

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

    Re: Running Mobile application in J2ME WTK via OTA but not in Mobile

    Quote Originally Posted by mikemoore View Post
    Have you signed the application? It seems to me that you are probably getting a SecurityException on the phone when you try to register the alarm.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com
    May I know how to create the signed Midlet? I created by using following steps:

    Utilites --> Sign Midlet Suite --> New Key pair

    I gave information in the key pair and set to my Jad file..

    After i run the jad in mobile it shows the Verify Cerification Error..
    Thanks,
    Jayam

  6. #6
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Running Mobile application in J2ME WTK via OTA but not in Mobile

    Your steps are correct, but you will need to purchase a certificate from Verisign or Thawte for it to work on a phone.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com

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

    Re: Running Mobile application in J2ME WTK via OTA but not in Mobile

    Quote Originally Posted by mikemoore View Post
    Have you signed the application? It seems to me that you are probably getting a SecurityException on the phone when you try to register the alarm.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com
    Hi,
    dont you think that this must be the case with OTA installation too.

    While you are installing the application,are you doing this with Jad or just using the jar.

    Do you think that starting the same thread multiple times can help you in any means.
    you had already discussed the same thing,here
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  8. #8
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    198

    Re: Running Mobile application in J2ME WTK via OTA but not in Mobile

    Quote Originally Posted by raj_J2ME View Post
    dont you think that this must be the case with OTA installation too.
    The poster says it works in WTK but not on the phone. The method of installation is irrelevant, his problem is that he has never been able to make it work on the phone.

    - Mike
    NAVTEQ Network for Developers
    The community for developing innovative location-based applications
    http://NN4D.com

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

    Re: Running Mobile application in J2ME WTK via OTA but not in Mobile

    PushRegistry.registerConnection("socket://:8084",midletClassName, defaultFilter);

    You know for sure you are using the right midletname (cause i see it's called public class sample extends MIDlet in the parsed code) and you are pushing the midlet on the right port by using some server ?

Similar Threads

  1. Problem in mobile tracker application
    By vikasdeshpande in forum Mobile Java General
    Replies: 3
    Last Post: 2009-03-17, 14:11
  2. A problem while running application on mobile
    By pom_cc in forum Mobile Java General
    Replies: 3
    Last Post: 2007-08-08, 18:25
  3. Mobile Podcasting - will it happen?
    By mobile monte in forum News and Announcements
    Replies: 0
    Last Post: 2006-09-22, 23:45
  4. Replies: 0
    Last Post: 2005-05-28, 10:20
  5. Start a J2ME application by OTA
    By hbfornies in forum Mobile Java General
    Replies: 1
    Last Post: 2003-09-23, 10:01

Posting Permissions

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