Web Development Thread, Need some pointers in Coding and Web Development; I am starting a new project which is going to be a website based on PHP. I'm quite handy with ...
9th June 2010, 10:32 AM #1
Need some pointers
I am starting a new project which is going to be a website based on PHP. I'm quite handy with PHP/MySQL/HTML etc, but need some advice on something completely new to me.
The website will grab information from the database and display it in a browser - simples. But once the website is completed I will continue the project by developing an Android app. What is the best way to produce this website so that the same queries etc can easily be ported to Android?
I've heard that XML is the way to do this, but I really don't know how/where to start. Can anybody point me in the direction of creating a website that can be easily ported to Android afterwards?
9th June 2010, 01:17 PM #2
Erm are you talking about making a mobile friendly web page or an actual app?
Android uses java as its base language which means you have to learn that first (which is not too bad tbh)
9th June 2010, 01:25 PM #3
I would probably look at implementing a REST-based service for the Android/remote part. Code your internal/database interaction as classes and functions, and then have the website and the REST interface use these as needed.
Use something like Flourish or CodeIgniter to help you; why re-invent the wheel?
I saw a great presentation by PHP guru Loran Jane Mitchell a few months ago - PHP And Web Services: Perfect Partners
9th June 2010, 01:33 PM #4
It's a case of making an actual app, rather than a web page designed for mobile devices. I've looked at SOAP and REST and it looks like I'm to do some extra reading to understand fully....
9th June 2010, 01:58 PM #5
I've seen other suggestions that for small number of queries is to just to http get/post calls to "dark" php pages on your server and then scrape the resulting output.
But not tried it yet
9th June 2010, 02:06 PM #6
Is the problem that you don't know how to produce a "web service", or that you don't know how to go about writing an Android app, or a mixture of the two? Do the queries to the database need to be secure? If not , the simplest thing possible is to simply write a PHP page that outputs the result of a query as XML instead of HTML. It can still take parameters like a normal PHP page, so all you have to do is visit a URL such as "http://app.com/doQuery?name=fred&colour=blue" and get a bunch of XML in return. According to this post:
Originally Posted by Hightower
How to call web service with Android - Stack Overflow
JSON might be a more suitible format to return your results in, though.
By theeldergeek in forum Hardware
Last Post: 12th March 2010, 01:22 PM
By plexer in forum Educational Software
Last Post: 1st March 2010, 11:22 PM
By cromertech in forum Windows Server 2008
Last Post: 16th October 2008, 09:43 AM
Last Post: 13th October 2008, 11:36 AM
Last Post: 20th January 2007, 09:34 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)