×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    5

    Smile Hyperlink inside J2ME?

    Can we implement a clickable hyperlink in J2ME program, when the link is clicked, the phone browser will show up and go to that link?

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Hyperlink inside J2ME?

    Hi gouramike,

    and welcome to Forum Nokia Discussion Boards!

    About your question: to graphically represent a hyperlink in Java ME, you have several choices. You can use high-level UI, like CustomItems or even Lists, or switch to lower-level graphics, so Canvas based, and globally design your UI with low-level primitives. You can also take a look at available Java ME frameworks, since they usually come with several graphically customizable controls.

    Once you have graphically represented your hyperlink, you should use MIDlet platformRequest() method to physically open browser with the URL used as argument.

    Pit

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    5

    Re: Hyperlink inside J2ME?

    Thanks jappit

  4. #4
    Registered User
    Join Date
    Aug 2010
    Posts
    23

    Re: Hyperlink inside J2ME?

    Hi jappit,

    I wanted to ask, if i want to add a hyperlink that accesses another form not a url, do i also use the MIDlet platformRequest()?
    Thanks!

  5. #5
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    264

    Re: Hyperlink inside J2ME?

    why not use a stringitem then if u want to open a another form .. ? add a default command to the string item and on its click event opent the form you want to display...
    hope it helps..
    you can even change its look as a hyperlink ..
    Thanks & Regards
    Gaurav Gupta

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

    Re: Hyperlink inside J2ME?

    If you decide to work with the Canvas based GUI then you can draw the string and a line/image under it and on the up/down key movement change the color of the same if this get the selection.On the Left Soft Key or Fire Key Pressed open the form and from the back of the form set the canvas as displayable.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Hyperlink inside J2ME?

    Quote Originally Posted by ZeinaShehab View Post
    Hi jappit,

    I wanted to ask, if i want to add a hyperlink that accesses another form not a url, do i also use the MIDlet platformRequest()?
    Thanks!
    No need to use platformRequest() for this you may just need to use display.setCurrent(next form) .
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  8. #8
    Registered User
    Join Date
    Aug 2010
    Posts
    23

    Re: Hyperlink inside J2ME?

    thanks for your replies,
    but is it necessary to add a default command?

  9. #9
    Registered User
    Join Date
    Aug 2010
    Posts
    23

    Re: Hyperlink inside J2ME?

    Thanks, but is it necessary to add a default command?

  10. #10
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    264

    Re: Hyperlink inside J2ME?

    Quote Originally Posted by ZeinaShehab View Post
    Thanks, but is it necessary to add a default command?
    That is what i said in my previous prost . Use String Item and add default command to it. You can call the form you desire by using the following code.
    display.setCurrent(formname)
    in
    I will like to show how to do it.
    ///////////
    Command myCommand=new Command("Click command ");

    String settingToAppend;


    settings[i]=new StringItem(" ","Click me ",Item.HYPERLINK);

    settings[i].setDefaultCommand(myCommand);

    settings[i].setItemCommandListener(icl);

    ItemCommandListener icl;

    icl=new ItemCommandListener(){
    public void commandAction(Command c, Item item) {

    display.setCurrent(loadingForm);

    }
    };

    hope it helps...
    Thanks & Regards
    Gaurav Gupta

  11. #11
    Registered User
    Join Date
    Aug 2010
    Posts
    23

    Re: Hyperlink inside J2ME?

    Thanks, it worked!!
    but i didnt want to add a default command for the design's sake.
    now there is no problem with that.

    Best Regards!

Similar Threads

  1. Acessing voice channel using J2ME
    By diegomello in forum VoIP
    Replies: 1
    Last Post: 2008-10-21, 15:57
  2. Can J2ME be used for sending MMS Message ?
    By seno_ap in forum Mobile Java General
    Replies: 1
    Last Post: 2006-11-24, 14:36
  3. A2DP support in J2ME
    By ppiggy in forum Mobile Java General
    Replies: 0
    Last Post: 2006-09-18, 06:04
  4. ICE Technology released iPush J2ME Package for MIDP 2.0 API
    By rockw99 in forum News and Announcements
    Replies: 0
    Last Post: 2006-06-22, 10:21
  5. need urgent guidance on j2me
    By cogni_niru in forum Mobile Java General
    Replies: 1
    Last Post: 2005-11-13, 15:02

Posting Permissions

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