Sencha PHP Mysql - php

Looking around my understanding, Sencha is purely JS based.
I am wondering if there is any way for me to use content from PHP + MySql driven website?

In short: yes, through XMLHttpRequests to your server. Sencha Touch is a Javascript framework that runs on your frontend, since it's mobile probably on the phone your'e targeting. PHP (& MySQL) runs on a backend, your server. Your phone app would then access the website where the PHP-app runs and fetch/store data, probably through a RESTful API.

You could try using Zend_Rest_Server on PHP side and Ext.RestProxy in order to integrate SenchaTouch with PHP.

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.

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?
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/

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

Create mobile application (iOS, Android, WP)

If got a task to create a mobile application for iOS, Android and WP. This application needs to access a mySQL database which is already in use by the website running php.
What I found in the meantime, is that I have to create a php webservice and use this webservice to access the data in the mySQL database.
Since I did not found any clear advice which way is the best to do it (JSON, XML, REST, etc) - I just wanted to ask you, is there a kind of best practice which technologies should be used for the php webservice?
Additional it would be great for me if someone knows a good tutorial for the recommended technology.
Thanks a lot.
I am arriving a bit late but here is my answer : I believe that the easier way currently available is a PhoneGap application (with Sencha Touch or jQuery Mobile as a javascript framework) talking to the server through a simple PHP webservice. PhoneGap allows you to build an Android, iOS and WP app with the same codebase.
We use that technology in my company and it works great.

Moving php apps to Android and iPhone

I am a php developer with a few web apps like a project management app and a forum i'd like to move to Android and iPhone.
I've heard of developers using Sencha Touch and PhoneGap to develop native apps and I know they support HTML5, CSS and Javascript, but how abot PHP? And is are there any other APIs/frameworks I should consider that better support local server scripting?
Speaking about webapp, maybe you can avoid building an app by having a mobile enabled version of your website compliant with all the client browsers.
Have a look at jquerymobile, it is compliant with mostly all the mobile browsers and you will be able to reuse your code.
To answer correctly, you can call your webservices using ajax to fetch json/xml/etc data from Phonegap because it is using jQuerymobile ;-)
Have a look at this discussion here on Stackoverflow :
Passing formdata from Phonegap to PHP with JSON
Hope this helps
PHP is a server-side scripting language and your .php files have to be stored on the server side. You can access them asynchronously with Ajax, so no, you can not include php files (with reasonable time and effort) in your app.
The only smart way to go here is native iOS apps, forget PHP, Android and the rest of that crap. By the way I'm not trying to be an iOS snob here but am just reflecting on a few realities. One is that iOS apps can actually make money though a web replacement app might not. The second issue is that going native demands a reboot on your part, that is best done on one platform until you get up to speed. The third issue is that users now a days expect well performing apps that don't have a lot of web cruft in them. Fourth the Android marketplace is screwed, you are far more likely to establish that critical user base on iOS as you can target a handful of platforms running the latest generation of iOS, android is by comparison a pathetic mess of old versions of android running on all sorts of hardware.
On iOS look a BlueAlien as an example of a better than web method of accessing Reddit.

Categories