×

Discussion Board

Results 1 to 2 of 2

Thread: Java and J2ME

  1. #1
    Super Contributor
    Join Date
    Mar 2003
    Posts
    2,426

    Java and J2ME

    I am a student and my project is regarding an online application. i would like to know, can Java link to J2ME? Because I was trying to use wireless device to send data over the Internet to a Java application, and vice versa. I may be use Java 1.3 Jbuilder while i haven't yet decide. The database server that i choose is SQL Server 2000.

    My project is an online appointment for specialist. Where user enter all their details for an enquiry and the system (using Java2)will process the date and time to the user. When the appoitment had made, the system will extract some important data and send to the specialist and save into the wireless device.

    Besides that, my project also include, entering quotation contents using the application that is developing into the wireless device(using J2ME). And then the data should send to the server over Internet. From that the server data are send to the Java application which is write to develop one formal quotation from the data obtain from the wireless device (which had enter by the specialist firstly).

    Thanks!

    Posted by Heather Ice, heatherise@yahoo.com
    on January 10, 2002 at 06:02

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Posts
    2,426

    RE: Java and J2ME

    Posted by Kim Daniel Arthur, kim.daniel.arthur@itet.no
    on January 10, 2002 at 07:05



    you could post your data to a serverside script or servlet using URL variables as follows:

    String url = http://server/example.asp?variable1=text&variable2=text;
    (use for example TextField on a Form and TextField.getString() to retrieve the string of the TextField and add it to your URL)

    us the midlets Connector.open(url) to retrive data from the selected URL.

    The url will be processed by your serverside script. Insert / retrieve variables from your SQL dbase. and print them out as your response.

    retrieve this response in your midlet (its is easy as it really just is the webpage your are opening).

    I find it best to split the returned string into an array for ease of use:

    public String[] split(String str,char x)
    {
    Vector v=new Vector();
    String str1=new String();
    for(int i=0;i<str.length();i++)
    {
    if(str.charAt(i)==x)
    {
    v.addElement(str1);
    str1=new String();
    }
    else
    {
    str1+=str.charAt(i);
    }
    }
    v.addElement(str1);
    String array[];
    array=new String[v.size()];
    for(int i=0;i<array.length;i++)
    {
    array[i]=new String((String)v.elementAt(i));
    }
    return array;
    }

    hope this helps a little. (if this is what you were looking for)

Posting Permissions

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