facebook

Basic JSON example?

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #332255 Reply

    rbjoet
    Member

    Is there a basic example of posting a JSON request to a web server and then formatting the JSON response?

    #332272 Reply

    rbjoet
    Member

    No luck?

    #332282 Reply

    @rbjoet,

    I’ve escalated this question to dev team to give you the best advice. Could you explain a little more what is that you want to do?
    Does this example meet your expectations? MobiBike-News – RSS Reader Example

    #332284 Reply

    rbjoet
    Member

    @support-octavio wrote:

    @rbjoet,

    I’ve escalated this question to dev team to give you the best advice. Could you explain a little more what is that you want to do?
    Does this example meet your expectations? MobiBike-News – RSS Reader Example

    THANK YOU!

    I have a large beer web site with a JSON API that allows access to a lot of the same data users interact with through the web application.

    I want to be able to use the API with the mobile application in order to view records requested through and returned by the JSON API. So I need code that can

    a) take information submitted through a mobile/web form
    b) construct a JSON request
    c) accept the JSON data returned by our server
    d) format this data
    e) *bonus* store a bit of this data on the mobile device

    This is pretty much all I need to get something very simple out the door! Any examples/help would be much appreciated!

    This is a JSON example coming from my site through Yahoo Pipes/YQL:

    http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D%22http%3A%2F%2Fwww.ratebeer.com%2Fjson%2Fm1-beersearch.asp%3Fbn%3Dfran%22&format=json&callback=cbfunc

    This is the same JSON coming directly from my site
    http://www.ratebeer.com/json/m1-beersearch.asp?bn=fran

    My questions are mostly about how this is all structured within the MobiOne framework, where each part of the code goes and in what files, how they reference one another, and an example of how results are organized and displayed.

    Also, I don’t know what “Page architecture” means in the Properties menu but if this means I can write ASP code for the MobiOne-based app that will parse and display the remotely called JSON then that would work for me too.

    #332320 Reply

    Hi rbjoet,

    Thanks for your feedback, we are discussing your requirements and wil follow up tomorrow.

    #332326 Reply

    rbjoet
    Member

    Hi and thanks for your patience and your fine product.

    Through a bit of trial and error I have come up with a basic Javascript, AJAX, JSON, JQuery example that is requesting, retrieving and formatting the JSON-formatted response.

    I have a host of great new problems now but am further down the line.

    I noticed onChange is included in the interface designer but not onKeyUp. This doesn’t work for my auto-fill form design. Can I simply adjust the relevant rendered code in the ASP file? Will that cause problems later on with packaging the native mobile apps?

    I also noticed that HTML was not rendered using the suggested method on this page.
    http://www.genuitec.com/mobile/docs/javaScriptSnippets/javaScriptSnippets.html

    I found JQuery’s .html() method to work. It might be nice for some future developer to see the example on the above page.

    cheers!

    #332404 Reply

    support-michael
    Keymaster

    Hi

    >I noticed onChange is included in the interface designer but not onKeyUp. This doesn’t work for my auto-fill form design. Can I simply adjust the relevant rendered code in the ASP file? Will that cause problems later on with packaging the native mobile apps?

    You can modify the code as you choose. The .html and .css files are auto generated and may be overwritten (you can veto this) if you are not careful. Your <prj>_custom.js file is never overwritten (caveat: unless you delete the meta-data files .*.json in the <prj>_www/ dir.

    >I also noticed that HTML was not rendered using the suggested method on this page

    What is the issue and we can give it a closer look?

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Basic JSON example?

You must be logged in to post in the forum log in