Jquery mobile php site and phonegap - php

I was trying to convert my website which ceated using jquery and its contain a few PHP page into Android application by using phonegap online converting tool, the app work on navigation but the PHP page will not work accordingly, so is there any way to work around?

You can't run php scripts on a mobile phone, you can convert all php scripts to html pages or you could load the whole website inside the webview.
place window.location = 'example.com' inside your deviceLoad event and make sure you whitelisted your website in your config.xml
What to place inside the config.xml can be found here.
https://build.phonegap.com/docs/config-xml
However, you need an internet connection to run the app, while the html pages doesn't require internet.

Related

Using PHP coding in Sharepoint 2013

I have loads of PHP-written pages that I'd like to host in Sharepoint without having to re-write them all in aspx.
Is it possible to use PHP coding on a Sharepoint aspx page?
If not, can you link a Sharepoint page to display a page written in PHP?
As far as I know SharePoint will not be able to directly delivery the php pages. However you can add script editor web part on SharePoint pages and show your php pages in iframe.

PhoneGap app that utilizes CodeIgniter and MySQL?

I have created web application where I used CodeIgniter for secure form, also I have connect with remote MySQL database.
Now I want create mobile app in PhoneGap. I never used it before so I need to ask about a few things.
Can I create in PhoneGap php folder and there make PHP file to connect with my database?
How to secure form in my mobile app? Can I use CodeIgniter? If yes: how? Just paste CodeIgniter files to phonegap www folder?
I hear something about AngularJS. Can I use it for secure form? maybe CodeIgniter is not necessary?
Sorry for noob questions ;)
What you have created is called a Web App.
What you you would like to create with PhoneGap is a Hybrid App.?
PhoneGap/Cordova framework contains a Browser and has plugins that can be added to access Native features which can be accessed through JavaScript.
Native features of the phone like Contacts, Calendar, GeoLocation, Accelormeter etc. Which is not possible when you use a Mobile Browser. Hence the name Hybrid App
(Using the term Browser for simplicity sake. A more appropriate term is Webview container.)
So any web application that uses HTML5, CSS3 and JavaScript will work with PhoneGap/Cordova.
PhoneGap allows you to create Hybrid Apps for all the platforms Android/IOS (Iphone)/Windows/BlackBerry.
Now comming to your questions.
Q1)
You do not need to create any folder.
You just need to point the startup (index.html) file to your Webserver address.
Q2)
As informed earlier your Hybrid app is a like a Browser(with additional features) so the same codeigniter code for securing the form will work.
I hear something about AngularJS. Can I use it for secure form? maybe Codeigniter is not necessary?
Codeigniter is a Serverside scripting tool which is used for processing server side request.
AngularJS is a client side JavaScript framework which is used mostly to create a SPA ( Singe Page Application) web application.
SPA web application relies heavily on AJAX
EDIT 1:
In the index.html file which will be located in the assets\www directory you need to add the following code in the head tag.
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// Now safe to use the Codova API
window.location="http://your.website"; }
</script>
You also need to tell Cordova that it is safe to load your website in the config.xml properties (you can remove the subdomains part if you don't have any)
<access origin="http://your.website" subdomains="true"/>

Using PHP in Android Webview

I created an app using PHP and it runs fine using the HTTP address in the Webview object.
When using locally, the PHP script does not work (putting all files in assets).
Is there a way for PHP pages to be loaded locally but to define the actual PHP part to be used at the webserver?
To clarify, all HTML content of the .php page will be used locally but when needed PHP code it will connect the webserver.
Thanks!
If you use a php content you should have Internet connection because php codes work on server side not local devices(some apk's install mysql+php in your android device but if you want to publish your apk this way wont work in all devices on local.)
Also if you want to make an offline project why dont you use javascript "To clarify, all HTML content of the .php page will be used locally"
Here you can download phpforandroid.apk to work on the local Click Here

Is there any way to use a Joomla site into an app using PhoneGap?

I am new in PhoneGap,
I have a Joomla Site, I want to create a PhoneGap App using that Joomla site. so is this possible ? if yes than how can i implement it ?.
You can use. But you have to create web services for request and responses. Because Phonegap will not run PHP script. So you can create webservices to access Joomla functionality via JSON responses from your joomla. You can get the JSON data via jQuery in your phonegap app.
and someone said PGBuild will convert webpage into phonegap app. You can try it also.
I have succeeded creating an application as follows:
Design your Joomla page so it's responsive and renders correctly on your mobile;
Download the whole thing with wget
Edit all urls and make them point to the right (local-remote) locations.
I saved all css, images, js locally so the page would load even offline; then changed all the links so they point to the remote host;
All forms should point to the remote host;
Most modules and components were changed so after the initial display (local) they will load the updated info in the frame.
Popups won't be available, so you'll need heavy workarounds for facebook integration etc.
Also, if you plan to use any phonegap features, they will only be available if you load the library inside your downloaded page; this will force you to change all calls to ajax (no document.location.href calls are possible since you'll lose the phonegap javascript).
The first time you load the page from the server it will take forever to load. Ensure you have proper caching set up otherwise you'll just lose your customers.
My advice is to start with an ajax project at the very beginning, it will save you lots of headaches.
Keep in mind, if you plan to use iframes, forget it. They work lousily on iphones, and debugging is nearly impossible. Simply take your time to plan a real phone app in javascript & using Ajax for the calls.
You don't need any webservices in Joomla for loading content, simply use:
&tmpl=component
when you need the content of a module.
Additionally, for blogs and lists, Joomla makes RSS feeds available so you shouldn't need too much coding to achieve this.
I have limited myself to ajaxifying the modules, which makes caching more efficient on the server and the interfaces appear more dynamic.

Webview in android able to run php

I am working on a Android Application that has web view where i need to load html, jquery and js and php also. Now i am able to load html jquery css javascript , But my problem is i am unable to load php in web view in offline is there any way to execute php in web view
Please Help Me Thanks In Advance
You almost certainly don't want to run PHP on your Android. But in case you do, then you would want http://code.google.com/p/php-for-android/. Better link: http://phpforandroid.net/
PHP is a server side language. It cannot run inside the browser. It helps you to build the dynamic web pages.
You can call any web page in the webview when you are online. it doesn't matter what is the server side language.
When you are offline, you cannot send request to any server. so no question of executing any page.
You can do it easyly with AndroPhp, just search it in Google play and install.
Its like WampServer for Php+Mysql. You should run it than just create your PHP project under www/ folder and call it from Android webview 127.0.0.1:80/yourproject
This way you you have local server on your Android, you shouldnt code in Java for Android all you can code in PHP. Maybe it is not a elegant way to code for Android but works !!

Categories