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
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
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
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,
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.
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
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
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,
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");
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