Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Transfer data from domain to mobile

Options
  • 15-02-2013 2:31pm
    #1
    Registered Users Posts: 155 ✭✭


    I am looking at writing an javascript web app to reside on a mobile and to pull data from a domain. I own the domain so I have full control over it. I currently have a PHP application connecting to a MySQL database on it. What I am wondering is how to access this from the mobile.

    Should I be building a web service on the domain I am accessing to communicate with or should I just use an AJAX request to a page on the domain from the mobile app using JSONP?

    I have never used web services and am wondering if this is an appropriate situation or is it unnecessary?

    Any help or advice much appreciated

    Sean


Comments

  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    An easy way to start would be to create a PHP web page that grabs data from from your database, drops it into an array which is then encoded as JSON.

    e.g if the $resultLine array contains all your books:
    echo(json_encode(array('BookCatalogue'=>$resultLine)));
    


  • Registered Users Posts: 92 ✭✭jgh_


    JSON is fine. check out PhoneGap to develop apps using JavaScript and HTML5 if you don't require any native frameworks


  • Banned (with Prison Access) Posts: 1,332 ✭✭✭desaparecidos


    JavaScript in mobile apps does not follow the same domain rule so you can perform ajax requests just like you would if writing a webpage on your site.

    So you can use JSON, JSONP, plain text, XML, HTML views etc


Advertisement