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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Transfer data from domain to mobile

  • 15-02-2013 1:31pm
    #1
    Registered Users, Registered Users 2 Posts: 156 ✭✭


    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,643 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, Registered Users 2 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