×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    150

    Arrow Using platformRequest method avoiding prompting for user acceptance!!!

    Hi people.

    I'm here again with more questions about J2ME and MIDP applications and I hope to solve my problems with our help!

    Nowadays I'm working in an application which opens the Web Browser and makes
    Voice calls automatically. Of course, both issues don't happen at the same time!

    After reading some information about the MIDlet.platformRequest() method I've realized that this method always prompts for the user acceptance in spite of I have a 3rd Party Trusted MIDlet!

    I've read that Thread
    http://discussion.forum.nokia.com/fo...489#post178489
    but nobody answers that guy!
    Noting that I've tested to include those permissions in .JAD file and during the MIDlet's installation the "Java Server doesn't finish the operation" because an error appears and stops the process!

    Do you know how to avoid that the MIDlet prompts for the user acceptance every time platformRequest() is executed?
    I've read that it is depending of the MIDP specification!

    Do you know if in the future that issue will be possible with new APIs, MIDP 3.0 for example?

    Thanks in advance! I admit all type of ideas and suggestions!

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Using platformRequest method avoiding prompting for user acceptance!!!

    Note that on Series 40 phones the midlet has to be closed in order the browser to start. In this case it is natural that that user is asked for a confirmation.

    In some cases the operators require that kind of behavior (confirmations) for platformRequest method calls.

    Hartti

  3. #3
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: Using platformRequest method avoiding prompting for user acceptance!!!

    hi Summer,

    some additional info for Hartti's post:
    http://forum.nokia.com/Technical_Lib..._method_in.htm
    http://forum.nokia.com/Technical_Lib...Nokia_6280.htm

    according to specs:
    Many of the ways this method will be used could have a financial impact to the user (e.g. transferring data through a wireless network, or initiating a voice call). Therefore the platform MUST ask the user to explicitly acknowlege each request before the action is taken. Implementation freedoms are possible so that a pleasant user experience is retained. For example, some platforms may put up a dialog for each request asking the user for permission, while other platforms may launch the appropriate application and populate the URL or phone number fields, but not take the action until the user explicitly clicks the load or dial buttons.
    so its up to manufacturers and ofcourse - as Hartii pointed - to what carriers want,
    after reading docs I doubt if "automatic" call is possible at all in MIPD 2.0,
    maybe with JSR-253 if implemented in future:
    http://discussion.forum.nokia.com/fo...ad.php?t=86116

    lets think like being on "desktop" device - I've put restrictions via DEP (Win XP) and Norton AV for apps/scripts which want to launch web browser - now I always have control about each popup - not only those nasty ones that comes from already opened browser instances - I'm sure I would put them if my laptop could initiate phone conversation as well,


    regards,
    Peter

  4. #4
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    150

    Thumbs up Re: Using platformRequest method avoiding prompting for user acceptance!!!

    Thanks for our replies Hartii and peterblazejewicz!

    Your contribution to this forum is very important and I hope you to continue in this way until now!

    It's a pity not to have JSR-253 API available in last Nokia phones (N7X and N9X ) although in the future I think all Java mobile phones may have this one to facilitate developers the programming of their applications and to increase the services and possibilities of J2ME applications!

    Thanks a lot !

  5. #5
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    86

    Re: Using platformRequest method avoiding prompting for user acceptance!!!

    hi
    i am also trying to open the browser from my application using platformrequest and access the net using proxyserver.
    my pgm is working fine in emulator.
    but not in Nokia 6630 and N70 mobiles.
    Is it possible to use the platform request in 60 series mobile?
    my pbm is the connection between the browser and my application is getting established,but the request from the browser is not going to the proxy.

    can anyone help me in this?

    thanks a lot

  6. #6
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: Using platformRequest method avoiding prompting for user acceptance!!!

    hi motta,

    i haven't heard about platformRequest just failing on S60 (or at least never found similiar issue in tech notes),
    simple code tested on 3250 (s603rdEd):
    Code:
    package tests;
    
    import javax.microedition.io.ConnectionNotFoundException;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.MIDlet;
    
    public class LaunchBBCMidlet extends MIDlet implements CommandListener,
            ItemCommandListener{
        
        public LaunchBBCMidlet(){
            mainForm = new Form("Launch browser");
            exitCommand = new Command("Quit", Command.EXIT, 1);
            mainForm.addCommand(exitCommand);
            mainForm.setCommandListener(this);
            openUrlCommand = new Command("Open", Command.ITEM, 1);
            launchButton = new StringItem(null, "Goto BBC Mobile", Item.HYPERLINK);
            launchButton.setLayout(Item.LAYOUT_NEWLINE_AFTER);
            launchButton.setDefaultCommand(openUrlCommand);
            launchButton.setItemCommandListener(this);
            mainForm.append(launchButton);
        }
        public void startApp() {
            Display.getDisplay(this).setCurrent(mainForm);
        }
        
        public void pauseApp() {
        }
        
        public void destroyApp(boolean unconditional) {
        }
        
        public void commandAction(Command command, Displayable displayable) {
            System.out.println(command);
            if(command == exitCommand){
                doExit();
            }
        }
        
        public void commandAction(Command command, Item item) {
            System.out.println(command);
            if(command == openUrlCommand){
                launchBrowser();
            }
        }
        
        private void launchBrowser(){
            String url = "http://www.bbc.co.uk/mobile/";
            try {
                if(platformRequest(url) == true){
                    doExit();
                } else{
                    mainForm.append("web page launched\n");
                }
            } catch (ConnectionNotFoundException ex) {
                ex.printStackTrace();
            }
        }
        
        private void doExit(){
            mainForm = null;
            Display.getDisplay(this).setCurrent(null);
            destroyApp(false);
            notifyDestroyed();
        }
        
        private StringItem launchButton;
        private Command exitCommand;
        private Command openUrlCommand;
        private Form mainForm;
    }
    maybe that is related to an url you are using?
    is that url working while entered in native browser?

    regards,
    Peter

Posting Permissions

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