Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating an Android app using PHP

I'm going to create an Android app for the first time, and I wanted to do it in PHP, I've done some research and found the likes of PhoneGap, but I'm still quite short in the area, could someone give me a start?

What I'm going to be doing is a simple app for testing, a shop where you search for products, add them to your cart and check out, and the names of the products you ordered will be entered to a database.

Basically;

Search for products->add to cart->check out->info sent to database (all through PHP).

Where should I start?

like image 423
Voiceeeeee Avatar asked Jun 12 '15 13:06

Voiceeeeee


1 Answers

Cordova is mainly a JavaScript framework that exposes native device features as JavaScript functions. Think of a cordova application like a plain HTML & Javascript website running in a Webview within your mobile application. The PHP interpreter isn't available on a mobile device, which is why you cannot package PHP files into a cordova app and expect it to work.

You could however write your backend in PHP and use XMLHTTP calls (in JavaScript) to retrieve data and present it to the user.

Additionally you can use any JavaScript framework in combination with Cordova so if you are familiar with any of them (like jQuery, Knockout or Angular) that would be an advantage. I'd suggest starting with a Cordova tutorial, like for example this one: https://ccoenraets.github.io/cordova-tutorial/index.html

Another project that is getting alot of attention lately is the Ionic project, which is also based on Cordova. I'd think based on your requirements this would be a great framework to use: http://ionicframework.com/

like image 130
Hless Avatar answered Sep 23 '22 08:09

Hless