Yes, the plan is to deliver it with the XML. Why opt out of XML?
- Will it not work?
- What are the alternatives?
Please note that this app would need to run both online and offline
Yes, the plan is to deliver it with the XML. Why opt out of XML?
The suggestion is to get rid of XML in favor of JSON and describe all items as JSON-structure.
Each structure must contain only it's own piece of data and a link to the next level of the object description in the form of an index in the next level array.
In the correct implementation, the data should be loaded from the network as they are needed. That is, at the beginning the user gets just a list of positions from the Internet. This list could easily be stored inside the application to be able to show it without an Internet connection. After selecting an object the additional information will be requested by this object, and also can be cached in localStorage. These data are then available offline. But bringing all of the content is not the best idea.
Ok, so ...
How would I convert the xml into JSON as JSON is completely new to me?
codeThis list could easily be stored inside the application to be able to show it without an Internet connection. After selecting an object the additional information will be requested by this object, and also can be cached in localStorage./code
This app will reside on the phone and will need to be able to rely on getting all data without internet connection needs. Can this be done in JSON?
Examples of how this is done.
Thanks.
Hi Leonardo,
Beautiful! Thanks. As I said before, I am working with very large files. So that's good news if it can work independent of the internet and will load fast by serializing. I'm going to read up on it and get the files converted.
On using JSON
I will get a smaller size of the data to test with first. Then:
In REST service should the Data Type be JSON or JSONP?
2, Should the Method be Get still?
Will the CDATA[[ used in XML need to be preserved in Json conversion or not?
On Accessing the Data
Will I still use Echo for this or how would the file be connected to the editor?
Will I just set up one big file and put all the necessary info in variable forms as you have it above? Or would I still be using 2 Rest services in Json file format?
When a name is clicked from names how would I extract the relevant data from full_base?
Any info?
[quote:]
In REST service should the Data Type be JSON or JSONP?
[/quote]
json
[quote:]
2, Should the Method be Get still?
[/quote]
Yes
[quote:]
Will the CDATA[[ used in XML need to be preserved in Json conversion or not?
[/quote]
Take out CDATA
[quote:]
Will I still use Echo for this or how would the file be connected to the editor?
[/quote]
Echo works just like any service. The only difference is that you get the same data each time you invoke it vs getting new data from live service.
[quote:]
Will I just set up one big file and put all the necessary info in variable forms as you have it above? Or would I still be using 2 Rest services in Json file format?
[/quote]
Could be either way.
[quote:]
When a name is clicked from names how would I extract the relevant data from full_base?
[/quote]
You could traverse the JSON, find the record and get the data.
Thanks, Max. I put the names in this format and then pasted it as Echo. The test is okay but Echo Response gave me again: Incorrect format. Please verify sample response data and try again.
My settings are:
Name: ServiceName
URL:
Method: Get
Data Type: json
Settings: None
Security Context: None
Use Appery Proxy
codevar myNames = [
{
name: "Name 1",
index: 0
},
{
name: "Name 2",
index: 1
},
]
/code
codeYou could traverse the JSON, find the record and get the data./code
I'm at a loss on how to do this with JSON
a) with one single file
b) with a separate rest service
Examples would be appreciated.
Echo has to be valid JSON. You can always check it here: http://jsonlint.com