PHP CodeIgniter to PhoneGap android app - php

I have heard about PhoneGap that can convert Web based app into a mobile app. I was wondering if PhoneGap can "convert" php codeigniter web based app into a mobile one..? I've also heard about Titanium software that does something similar... I wouldn't want to rewrite whole app to make it usable on android devices.. Any advice would be appreciated
Thanks

Phonegap just make use of web tech, such as js, css, html. It 'convert' it to mobile apps. You can interact with server side which is use php, asp, jsp or other server side script use ajax.
hopely useful: http://www.indiageeks.in/phonegap-jquery-ajax-example-jsonjavascript-object-notation-response/

Related

Can PHP be used in Android app development?

I've got a book I bought online - O'Reilly's Building Android Apps with HTML, CSS and JavaScript. The idea is that you can use these 3 to create a website that can be converted to an Android app by using a Java conversion tool.
Hopefully someone will be familiar with this, and hopefully this is possible - if I have a website that is already created that also includes PHP, could this be used for the app?
I've created PHP sites before, and the one I'm specifically looking at is referencing a MySQL database, hence my need to use PHP for the app. The website is heavily based on PHP.
No you can't (Unless you created your own framework which runs a local php server inside of the device which can be accessed by a webview). Php is a server side language. Html and JavaScript are client side. These html app creation frameworks use the webview to run apps. Be careful as there are performance issues when running through webview as it is not a native app (projects like crosswalk help but still many issues). Popular frameworks include ionic (Angularjs), titanium (is mostly native but from my experience limiting), and appgyver (Angularjs).
Yes you can! If by "converting" the website to app you mean displaying the website in a chromeless view mode (without address bar).
If you wan't to use phonegap / cordova you can still use the existing PHP code as backend for the database (Maybe rewrite it into a Restful API).
If you want your app to run natively and without internet connection, then you are out of luck though.

Php in phone gap application

We have to develop an application with more plattform. We would use the framework PhoneGap. For our application we need services of backend, the question is: Does PhoneGap support PHP?
If it doesn't support PHP. In which way we can solve the problem?
The most important thing is: make call server
(Get and Post), parsing a json and other functions
that PHP gives.
Phonegap does not have a server. You need to call via Ajax to remote servers.
The backend can be in any language which supports HTTP calls, as PhoneGap is an independent client.
You can use PHP to write an API for use within your Javascript PhoneGap application.
I can recommend the Laravel framework to accomplish this.
Yes...you can use PHP or any PHP framework to give backend for mobile app made using phonegap/cordova....point is phonegap/cordova app will be on client mobile which won't understand PHP embedded in phonegap html files....so write an API amd place it on a server and then make AJAX calls to server to do database and other backed operations
Try to return JSON data from the PHP API.....it's a famous data structure and supported by many applications

android phonegap framework, best php framework for phonegap

it's the first time for me make android app with Phonegap +Mysql + PHP , so i hope you give me advice about what is the best php framework for phonegap ?
You need to understand that phonegap is a client side technology and PHP is server side. PhoneGap app only communicates with server for example with restful web services. From a client side, it does not matter what php technology you use, as long as you send data with "understandable way" (eg. JSON).
I think that question you would like to ask is: what is the best php framework for making web services.

making a php app a phonegap app

Is there a way of making this app: www.benjaminpotter.org/myarden
which uses php, mysql, html, css, javascript and jquery into a phonegap app?
Otherwise how would you make this an ipad app?
As far as I know, phonegap can not run PHP, cause it needs a server, it can use only HTML and JS which runs on the client.
You could make an empty iPad app with a Web Container for this URL, or make the provided site an WebApp (specific meta tags for the iOS).

I want to create a mobile website in addition to native apps using phonegap. Is it sensible to use the same codebase?

I want to have a mobile-friendly website, in addition to a native app for iphone/android using phonegap. I'm currently using PHP (specifically CodeIgniter but that's not as important) and jQuery for the mobile website.
I'm thinking that the website and the phonegap codebase can use the same PHP back-end for server requests but the front-end must be somewhat different since phonegap has proprietary javascript to access native functionality (camera, accelerometer, etc) that a browser couldn't access. For this reason, I think the front-end must be developed separately for the mobile site vs. for phonegap.
Does this make sense? Am I missing something that would allow me to use the same phonegap codebase as the mobile site?
Where I work, we developed our mobile website and Android App with the same codebase except for the views and UI. Everything on the web side is in pure JS and HTML. We have a sever side API that we request data from and then template it using Mustache.
We used Titanium for the Android App, but found that framework to have more cons than pros to use. So for the iPhone app upgrade we're using PhoneGap. It took us a few hours but the mobile site ported over exactly the way it works in browser, to the native iPhone app created by PhoneGap. In short, It's absolutely possible but you have to develop the site in JS, all the logic, to have it port over easily to PhoneGap.
Also, just a recommendation, you should try using Zepto.js instead of jQuery. It's aerogel weight, has the majority of jQuery functionality without all the IE bull and it uses the familiar $ symbol as a namespace. Much more suitable for mobile development.
Specifically, PhoneGap has plugins that you write. There's two sides to this, one JS file which will match the plugin that you write for the native Obj C or Android file. The plugins are modular, so you can plug them in for the native apps and out for the site.

Categories