You Are Here:

Community: Developer Discussion Boards

#1 Old Cool Midlet hanging before & after invoking Platform request - 2009-03-14, 15:59

Join Date: Mar 2009
Posts: 10
Mr.Bond007
Offline
Registered User
Hi All,
In the Nokia N79 device i have installed & using a midlet which uses the Platformrequest().
To the platformrequest() a proper HTTP URL is passed. Sometimes the midlet gets hanged before
exactly making the platform request.

Even sometimes it invokes the browser & shows the content, now when i come back
to the Midlet the midlet is getting hanged.

This happens only in rare scenario. Please provide u'r inputs in solving
this issue.

Regards,
Sakthivel
Reply With Quote

#2 Old Re: Midlet hanging before & after invoking Platform request - 2009-03-14, 16:16

Join Date: Jun 2003
Posts: 4,325
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Offline
Forum Nokia Champion
What do you do immediately after the platformRequest() call?

What is on the screen at the time? (Form, List, Canvas, etc?)

Cheers,
Graham.
Reply With Quote

#3 Old Re: Midlet hanging before & after invoking Platform request - 2009-03-15, 05:45

Join Date: Dec 2008
Posts: 104
Unit1ed
Offline
Regular Contributor
I don't know exactly what you have in your code but you need to check what it returns. If it returns 'true' then your midlet must be closed after.
Code:
if (parent.platformRequest(URL)) {
   parent.destroyApp(true);
   parent.notifyDestroyed();
}
Reply With Quote

#4 Old Re: Midlet hanging before & after invoking Platform request - 2009-03-16, 05:11

Join Date: Mar 2008
Posts: 2,161
Location: The Capital of I N D I A
Send a message via Skype™ to raj_J2ME
raj_J2ME's Avatar
raj_J2ME
Offline
Forum Nokia Champion
Hi,
Do you have any thread running in that code....
Can you put the the code that you are using for the underlined task..


Thanks

R a j - The K e r n e l
Reply With Quote

#5 Old Re: Midlet hanging before & after invoking Platform request - 2009-03-16, 06:17

Join Date: Mar 2009
Posts: 10
Mr.Bond007
Offline
Registered User
Quote:
Originally Posted by raj_J2ME View Post
Hi,
Do you have any thread running in that code....
Can you put the the code that you are using for the underlined task..

Yes my code contains few threads. So you mean to say threads are the root
cause for this problem
Reply With Quote

#6 Old Re: Midlet hanging before & after invoking Platform request - 2009-03-16, 06:19

Join Date: Mar 2009
Posts: 10
Mr.Bond007
Offline
Registered User
Quote:
Originally Posted by Unit1ed View Post
I don't know exactly what you have in your code but you need to check what it returns. If it returns 'true' then your midlet must be closed after.
Code:
if (parent.platformRequest(URL)) {
   parent.destroyApp(true);
   parent.notifyDestroyed();
}

I tried to find that also..i am trying to print the status of the
platformrequest() but unfortunately before this statement itself the
midlet got hanged.
Reply With Quote

#7 Old Re: Midlet hanging before & after invoking Platform request - 2009-03-16, 06:20

Join Date: Mar 2009
Posts: 10
Mr.Bond007
Offline
Registered User
Quote:
Originally Posted by grahamhughes View Post
What do you do immediately after the platformRequest() call?

What is on the screen at the time? (Form, List, Canvas, etc?)

Cheers,
Graham.

I am using Canvas on the screen. i am not doing any specific
operations after platformrequest() call.
Reply With Quote

#8 Old Re: Midlet hanging before & after invoking Platform request - 2009-03-16, 06:24

Join Date: Mar 2008
Posts: 2,161
Location: The Capital of I N D I A
Send a message via Skype™ to raj_J2ME
raj_J2ME's Avatar
raj_J2ME
Offline
Forum Nokia Champion
Quote:
Originally Posted by Mr.Bond007 View Post
Yes my code contains few threads. So you mean to say threads are the root
cause for this problem
Please check by stopping the thread,and then call the plateformRequest()..


Thanks

R a j - The K e r n e l
Reply With Quote

#9 Old Re: Midlet hanging before & after invoking Platform request - 2009-04-21, 15:54

Join Date: Oct 2008
Posts: 3
niyioyelade
Offline
Registered User
I am having exactly the same problem with Bond007. Midlet hangs(the whole phone hangs actually) after closing the browser and returning to the midlet from which the platFormRequest which opened the browser was called. In my own case, I have no intention of shutting down the midlet after the platformRequest() call. I need the user to be able to return gracefully to the midlet after exiting the browser. Problem only occurs on E71 for certain URLs, it has worked okay on several other handsets and URLs.
The code is just a simple call MyMidlet.platformRequest(url); amongst other things. A canvas was on screen prior to this call and the same canvas is met on screen when user exits browser. What is this thing about stopping the thread? Do you mean the UI animation thread or the thread that makes the platformRequest call, how will this help?
Last edited by niyioyelade : 2009-04-21 at 17:04. Reason: Additional info
Reply With Quote

#10 Old Re: Midlet hanging before & after invoking Platform request - 2009-04-21, 16:13

Join Date: Jun 2003
Posts: 4,325
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Offline
Forum Nokia Champion
On some devices, you must exit the application after a call to platformRequest(). If platformRequest() returns true, then the request will not take effect until you exit. (As in the code posted by Unit1ed above.)

I suggest you build a minimal MIDlet, with just a Form, to Commands (one to trigger the platformRequest() and one to exit), and nothing else. No threads. Like:

PHP Code:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class 
TestRequest extends MIDlet implements CommandListener {

    private static final 
String URL "http://somewhere.com";
    
    private 
Form form;
    private 
Command makeRequest = new Command("Request"Command.OK1);
    private 
Command exit = new Command("Exit"Command.EXIT, 1);

    public 
void startApp() {
        if (
form == null) {
            
form = new Form("TestRequest");
            
form.addCommand(makeRequest);
            
form.addCommand(exit);
            
form.setCommandListener(this);
        }
        
Display.getDisplay(this).setCurrent(form);
    }

    public 
void pauseApp() {
        
// do nothing
    
}

    public 
void destroyApp(boolean uncond) {
        
// do nothing
    
}

    public 
void commandAction(Command cDisplayable d) {
        if (
== exit) {
            
destroyApp(false);
            
notifyDestroyed();
        } else {
            try {
                if (
platformRequest(URL)) {
                    
form.append("Must exit.\n");
                }
            } catch (
Exception e) {
                
form.append("ERR: " "\n");
            }
        }
    }

Can you reproduce the same problem with this code?

Graham.
Reply With Quote

#11 Old Re: Midlet hanging before & after invoking Platform request - 2009-04-21, 19:50

Join Date: Sep 2008
Posts: 1,195
Location: DELHI
Send a message via Yahoo to jitu_goldie
jitu_goldie's Avatar
jitu_goldie
Offline
Forum Nokia Champion
well i had tried with the small piece of code shown below. I havent face any problem like hanging of midlet. \my teting device is sony ericsson k790i. well might be some other issue. please put ur code here if quite possible..


Code:
import javax.microedition.io.ConnectionNotFoundException;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class testMidlet extends MIDlet implements CommandListener{
    Form form;
    Command ok;
    private Display d;
    public void startApp() {
        d = Display.getDisplay(this);
        form  = new Form("");
        ok = new Command("OK",Command.OK,1);
        form.addCommand(ok);
        form.setCommandListener(this);
        d.setCurrent(form);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void commandAction(Command c, Displayable d)
    {
        if(c == ok)
        {
            try {
                this.platformRequest("www.google.com");
            } catch (ConnectionNotFoundException ex) {
                form.append(""+ex.toString());
                ex.printStackTrace();
            }

            notifyDestroyed();
            destroyApp(true);
        }
    }

   
}


thanks,
jitu_goldie..

KEEP TRYING..
Reply With Quote

#12 Old Re: Midlet hanging before & after invoking Platform request - 2009-04-22, 07:51

Join Date: Jun 2008
Posts: 96
Send a message via AIM to sharvan1981
sharvan1981's Avatar
sharvan1981
Offline
Regular Contributor
Hi,
Hanging prob. should not come if u r calling platformRequest after closing the threads and destroy midlet. May be its your handset problem check same on other devise.
Reply With Quote

#13 Old Re: Midlet hanging before & after invoking Platform request - 2009-04-22, 12:12

Join Date: Apr 2007
Posts: 1,757
Tiger79's Avatar
Tiger79
Offline
Forum Nokia Champion
as far as I can understand he DOESN'T want to destroy his midlet ;) he wants to "gracefully return to it", whcih would be quite difficult if the midlet got destroyed ;)
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
invoking HTML pages from MIDlet kumar_m16 Mobile Java General 2 2008-04-24 14:26
Platform Request used for updating existing midletsuite? hlothman Mobile Java Networking & Messaging & Security 5 2007-01-22 21:41
Midlet vanishes after HTTP request rputhli Mobile Java General 0 2005-10-03 00:56
platform request on nokia 6600 scheung3 Mobile Java General 0 2004-10-14 00:56
Invoking WAP browser from midlet kljajo Mobile Java Networking & Messaging & Security 7 2004-07-14 04:03

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia