I am trying to implement web services within an app, and the response of the web serivce is in JSON. How is it possible to parse simple json without net_rim_json_org module of BBOS 6.0?
For pre-6 BB OS people use JSON ME lib.
Related
I am working on a method that needs to parse the JSON response. I looked around and people use JSON.decode() in the as3corelib. But I was wondering if there was another way to do this without having to install any other libraries like this (as3corelib). Like a native json method that comes with the actionscript libraries.
Take a look at the top level JSON class, available since Flash Player 11, AIR 3.0.
The JSON class lets applications import and export data using JavaScript Object Notation (JSON) format.
Why do you have a problem with using an external library?
There is no such thing as an installation required, you just download it.
I have a open data link below
http://data.ntpc.gov.tw/NTPC/od/data/api/IMC14?$format=xml
How to create worklight http adapter get json object? Then using json object let it to dojo mobile!
I have ever see a example using jquery link to open data api. But not ever see using dojo mobile link open data.
Yes. Read the Getting Started modules and try the code samples. Specifically I would recommend:
Adapter framework overview
HTTP adapter – Communicating with HTTP back-end systems
Invoking adapter procedures from client applications.
Also take a look at the documentation here. There's an example with Worklight + Dojo Mobile here.
The Web API Client Library NuGet Packag brings in JSON.NET and some handy extension methods for deserializing JSON like so:
response.Content.ReadAsAsync<IEnumerable<Product>>().Result
But this package is not compatible with Windows 8 App projects. How can I deserialize my JSON objects in the same generic way without this NuGet package?
What do you mean by saying "not compatible with Win 8"?
The Microsoft.AspNet.WebApi.Client has been developed to support Win8.
Install-Package Microsoft.AspNet.WebApi.Client
Install just this package, not entire Web API.
You can see the release notes here, in the blog post by Henrik Frystyk Nielsen - http://blogs.msdn.com/b/henrikn/archive/2012/08/15/asp-net-web-api-released-and-a-preview-of-what-s-next.aspx
The Microsoft ASP.NET Web API Client Libraries package adds support for formatting
content negotiation to System.Net.Http when writing Windows Store Apps.
It includes support for JSON, XML, form URL encoded data, as well as MIME multipart.
This package requires Visual Studio 2012 and Windows 8.
There are at least 2 JSON serializers available for Windows Store apps:
DataContractJsonSerializer is a part of .NET framework.
Json.NET is supported as well. You can add it into a Windows Store app project if you install just this package: Install-Package Newtonsoft.Json
What exactly are you refering to with "deserialize my JSON objects in the same generic way"?
I'm trying to setup an rpc server so that a blackberry mobile app can make calls to it. Thought of trying out json first.
I've setup a working server side impl using http://jsonrpcphp.org/ .
Couldn't find any direct libs for blackberry/j2me. android-json-rpc looked interesting, but the blackberry SDK complains
"The type java.net.URI cannot be resolved. It is indirectly referenced from required .class files" at this line
HttpPost request = new HttpPost(serviceUri);
I'm using v4.1 of apache http core and client to make android-json-rpc work.
Looks like the URI class isn't bundled with the j2me/blackberry standard lib.
Is there a quick and dirty way to get rpc working on blackberry ? I don't mind xml or any thing else for the encoding, http is the transport I'm interested in.
BlackBerry 6 has built-in the JSON parser and some better APIs for making HTTP requests. Prior to that, though, you have to compile the JSON parser into your app and use the Java ME HttpConnection class to make and get the HTTP requests. So it depends what version you're targeting.
If you are targeting to < BB OS 6.0 devices.
You can also use org.json.me lib in your app.
Here is the sample named Implementing JSON in your application. It's very simple to use.
Good luck
One major question is I can't simply use existed json library to put into my windows phone 7 applications.Is there any existed json library for wp7?
Another is how to request http and get response?
Try the Hammock Rest library on Codeplex alongside the excellent NewtonSoft JSON.NET library - also on codeplex.