Reputation: 185
I am trying to make app for android using cordova. I am having trouble finding some meaningful guide or code to help me as an example on how to use cordova to run a php (codeigniter) project. Could someone please guide me through the process or send me an example code on how to make the connection. I read somewhere that all I had to do was copy my project in the www folder in the cordova project, but no details were added on what to do with the index.html file, how to use it to point to the main page of my site, or whatever it is I have to do to my project to make it acceptable to cordova. Please someone help me with info or a simple php site accessed with cordova, anything a bit more understandable.
Thanx in advance.
Upvotes: 1
Views: 3908
Reputation: 370
There is a SQLite plugin for phonegap you can access with javascript and use as backend and of course no need for php. https://build.phonegap.com/plugins/731
And no, you can't use php or mysql whithin Phonegap but there are full functional Webserver-apps for Android out there you can install and access them through your Phonegap app.
Further you can provide download link for your app-users for a webserver that fits to your app to get it working.
Thats the only way to get a local app with php and mysql backend working afaik.
Upvotes: 0
Reputation: 2759
You can set on your config.xml
<widget id="com.example.hello" version="0.0.1">
<name>HelloWorld</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<access origin="*" />
<preference name="Fullscreen" value="true" />
<preference name="WebViewBounce" value="true" />
</widget>
TO
<widget id="com.example.hello" version="0.0.1">
<name>HelloWorld</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="http://[codeignter url]/index.php" />
<access origin="*" />
<preference name="Fullscreen" value="true" />
<preference name="WebViewBounce" value="true" />
</widget>
And remember to import te javascript of cordova to your host.
Upvotes: 1