views:

77

answers:

2

I want to be able to make an iphone and android app using php. I have looked at phonegap and appcelerator and it seems like only html and javascript can be used. These frameworks want to make it easy to make apps using web technologies and PHP i would argue is one of the biggest web technologies, but I'm not seeing much (if any) support. I am new, so I could be wrong on multiple levels. So please enlighten me and let me know if what I am trying to achieve is possible.

Thanks in advance.

A: 

Yes, HTML and PHP are seamless when used in a web setting. You can directly modify content in your HMTL with PHP and Javascript to plug into PhoneGap.

Although I have never seen the PhoneGap SDK, I'm sure you could fit PHP in there somewhere.

esqew
+4  A: 

Yes and no. There is no reason why you cannot have PHP running on your own server computer that returns HTML or XML that gets consumed by your mobile application, but to the best of my knowledge, there is currently no way to have PHP running on the mobile phone, itself (although even if you could, PHP is typically a server-side technology and not a client-side technology, so that would be unusual).

I should add that most mobile applications are merely thin clients for web services. You are best off first implementing the web service (using whatever language you find most appropriate), and then creating mobile phone application that simply provides a UI for invoking the service and displaying the results.

Michael Aaron Safyan
I was hoping that maybe phonegap or appcelerator will have some php wrappers, but I guess they don't. I could just have my whole app be an iframe and have everything on my server, but that won't be too elegant. Since I can only use javascript and html, can I get data from a mysql database using javascript?
amirrustam
You don't need an iframe. You can just build a mobile accessible app on your server and then use a webview. There are many tutorials on how to use webviews including this one. http://androidworkz.com/2010/06/01/how-to-make-an-application-that-opens-your-website/
androidworkz
lol, I was planning to put the iframe in webview, but this is more direct. Thanks michaell
amirrustam