×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Bangalore,India
    Posts
    129

    XML file in j2me application

    Hi,

    Is it possible to access xml file directly from java class in j2me application without using servlets.

    one traditional way which i know is append xml strings in java class and parsing.


    FYI - I am using eclipse.

    Regards,
    Kusuma

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: XML file in j2me application

    Hello Kusuma,

    you might want to check this resource on Forum Nokia Java Developer's Library:

    Java Developer's Library 3.5 > Developer's Guides > Networking > Web Services

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

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

    Re: XML file in j2me application

    Quote Originally Posted by kusumat View Post
    Hi,

    Is it possible to access xml file directly from java class in j2me application without using servlets.
    Servlets are only related if and only if the XML file is on some URL on the server and you wanna that XML.IN this case you can use the servlet or any other server side technology which will return you the XML as soon as you hit that URL.

    If you dont wanna use servletI in your case) that means you are not planning to use the server side implementation for the XML handling and hence you can either put the XML on the file system of the device or you even can save the xml in the RMS.Please note that the size of the RMS is much limited and depends upon the device.
    You can use either of the two which suited to your need.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: XML file in j2me application

    Hi Kusuma,

    Can you give little more clarity about what is your problem ? If you tell clearly then it will be easier to to give the solution.

  5. #5
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Bangalore,India
    Posts
    129

    Re: XML file in j2me application

    Hi Bhanu,


    I have a j2me app which retrieves xml data using httpconnection.

    But i dont want to use http instead i want to get it from an xml file exist in my application only.

    And the parsing would same as aml data parsing recieved from server.

    Regards,
    kusuma

  6. #6
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Bangalore,India
    Posts
    129

    Re: XML file in j2me application

    Hi raj_J2ME ,

    The way you suggested is comprehensive but my requirement is not accessing xml data from device data but from like file exists in application along with .java files in the different package file.

    Regards,
    Kusuma

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

    Re: XML file in j2me application

    Repeat the post-3 of this discussion.
    Why .java files?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  8. #8
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: XML file in j2me application

    Hi Kusuma,

    Read the xml file as the an inputstream and construct the string with that input stream, If you have any XML parsers then you can directly give the input stream to the XML parser that parser will handle.

    InputStream in = this.getResourceAsStream("/file.xml");

  9. #9
    Registered User
    Join Date
    Dec 2012
    Posts
    1

    Re: XML file in j2me application

    Hi to all of you..
    I am developing an j2me application and I already finished, but can somebody tell me how to store the data that I write in application in a xml file or other format.. can somebody find me a class
    with the code there like an example.. hope I will have any answer
    all the best!

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: XML file in j2me application

    Quote Originally Posted by lonstard View Post
    Hi to all of you..
    I am developing an j2me application and I already finished, but can somebody tell me how to store the data that I write in application in a xml file or other format.. can somebody find me a class
    with the code there like an example.. hope I will have any answer
    all the best!
    j2me provides RecordStore - in which you can store each line of your application data as a separate row - for more details refer to API doc for RecordStore
    Example - http://www.developer.nokia.com/Commu...re_Data_in_RMS

    For writing data to file - you need tp use FileConnection API (JSR-75) and you need user's permissions for the same - hence using RMS is better option.
    Example - http://www.developer.nokia.com/Commu...ile_in_Java_ME
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. How to load local XML file in Flash Lite that is embedded in a WRT Widget?
    By kvirtanen in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2010-04-06, 10:14
  2. Problems with MBM and MBG file
    By rsiudak in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 5
    Last Post: 2010-02-19, 02:23
  3. How to view File Content from the J2ME application?
    By neeraja.nokia in forum Mobile Java General
    Replies: 4
    Last Post: 2009-05-30, 23:13
  4. Regarding BMCONV
    By sanah007 in forum Symbian
    Replies: 2
    Last Post: 2009-05-26, 12:47
  5. How can the WAP browser communicate to J2ME application?
    By hbfornies in forum Mobile Java General
    Replies: 20
    Last Post: 2007-03-02, 16:32

Posting Permissions

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