frameworks for separate web app and database server - php

I'm having a hard time on choosing which platform will I be using in creating a separate web app and database. What could be the possible and more easier to use in creating a separate web app and database? I'm thinking of using PHP for the web app and the database server will be python. Is it gonna be convenient? Or should I use only the php for web app and connect it to the separated database server?

Related

Share database between app and web

I'm involved into an app that have to retrieve queries from an existing database. This db have to be implemented in php in a remote server, and will be the place where the admin will have to insert content into the shared db, but I don't know how to implement that correctly or what is the best solution.
I'm thinking about make a sqlite database with php and connect directly the app to the db, but I haven't found yet the best way to do that.
What do you think? Thank guys.
FYI, without any server communication (Web services) you can't use the website database in android application.
If you want to manage the communication between the website and the android app means you need a centralized server (probably my sql dab) which having the data of your web/mobile applications. So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them
I'm thinking about make a sqlite database with php and connect
directly the app to the db, but I haven't found yet the best way to do
that.
This is not the right approach to connect mobile applications with the database. Instead you should create a middleware(REST/SOAP webservice) which runs on server. This middleware will in turn connect with the database and your mobile app whether it is android, iOS or windows app can communicate with this middleware.

Migrating PHP web app to iOS

So I've built a web app in PHP that relies heavily on a MySQL database. Now (for user convenience purposes) I'm trying to create the exact same app, just as an iPhone app. Granted, I have no knowledge of Objective-C (just starting to learn it), I wanted to know how to go about this. I know that I'll have to use some kind of intermediary to get Objective-C to connect to the SQL database.
So essentially my questions are: If I've already created the web app as aforementioned, could I use the same DB and tables for the iOS app version as I did for the PHP web version? Also, is there anyway to migrate any code I've created in PHP to iOS (I realize that they are two completely different languages), but I'm just curious as to whether or not I'll have to build the iOS app from 'complete' scratch.
Your best bet is to write an PHP service to talk to your database.
This way you can share this API between your app or iOS app or any other type of client app.
The service will be responsible to receive request query the database and send responses in JSON format for example.
So to make things easier, you should not query the database directly from your apps, use a common web service.
You can use your MySQL database for any purpose because it is just data. The code that will show them will be different though. If you have no knowledge about Objective-C you should consider the web-app approach.
Here are a few helper links.
https://developer.apple.com/library/safari/referencelibrary/gettingstarted/gs_iphonewebapp/_index.html
http://gigaom.com/2010/02/12/how-to-create-an-iphone-web-app/

Connecting MySql with Android without using PHP

I want to connect a MySql DB with my android application.
However, I DON'T want to/CAN'T use PHP for doing this.
Almost all solution for MySql connection with android on internet uses PHP.
I read somewhere that, If one don't want to use PHP then web service should be used.
But I'm not able to find any tutorial/sample example for the same.
Any help appreciated.
It seems you're mixing up some things.
A web service is simply some code on the internet (web) which allows you to receive and send information to a server, where it is saved per example in a database.
PHP is just a language, in which you can write a web service.
You can use a vast array of languages to create a web service ( read: expose your database) to other devices. Among others, you can easily do this in Java, .NET, Python ...
If you're looking for a way to connect to an external database without any web service / API in between, i'll have to disappoint you with the news that this is not supported by Android.
Most examples of a simple web service / a bunch of scripts contain PHP since this is probably the easiest and can be used on pretty much any server.
A webservice, is as it's called, a service, meaning that you have one side consuming it (the android client). if all you want is a persistent storage, you could use SQLite which is an SQL compliant solution which exists within android.
If it's possible to SSH to a server via Android, you could use that to connect to mysql, because the only other solution involves having mysql binaries installed locally on your android machine, and that's not possible AS FAR AS I KNOW, on Android.
One major reason for using a webservice (e.g. written in PHP) to connect to a remote DB is that you don't want to store the database login credentials inside your app. Because otherwise it'll be easy to extract your login for that database and access and edit it in a way you might not have planned (eg. delete stuff).
Its Possible to connect mysql database .
I have done with out using php file . I have used an spring configuration file to establish an connection to the database and dao to access the data from the database.
Create an Web Application that access the Server through the Spring Framework and an Servlet .
Create an Android Client Application tat make an get / post request to the Servlet , process the results in the servlet and return the response to the Android Client Application (json format ) Process the json format reponse in the Android Client Side and use it to your application

How to develop a desktop application or exe file for the web app developed in PHP,so that the customer can access it when there is no internet

We have a web-application(Loyalty platform for restaurants) developed in PHP. But most of these merchants dont have internet connection all the time. So, is there way to convert only merchant module into a desktop application so that merchant works stand alone and it syncs to web application whenever there is an internet connection.
Yes it is possible ,but not like a wizard job.
If you know only PHP than you can use Titanium ,and deploy Desktop App's.
You can use a local database ,an XML ,jSON or SQLite and on the first connection with internet you can clear the local database and update the Remote one.
I am working on a similar project and in my case I am following the below aproach.
Web Application is PHP and MySQL
Desktop Application is .net Application using SQL Lite
Windows Service checks for internet connection and syncs db in the background
In my case, my users can go offline for days or weeks and data was critical for me and I felt HTML 5 offline content was not the best option for this.
No. Designing a desktop PHP app is very different from designing a web PHP app and will require major amounts of rearchitecting.
Now having said that, it is possible to deploy a web server to the client's machine and have it run a web PHP app there. It will still require some rearchitecting to get the sync working though.
Develop a desktop application in .net or Java what ever you are familiar with and use some database like SQLite to save the data locally. When ever the user goes to online you need to connect to your online database and sync the data.
If there is possibility that same data can be updated by different users, then you have to plan on handling the conflicting scenarios like if a data record is updated at both end which data should be used. If there is no possibility to concurrent update then simply you will have to upload your data when user goes online.

Google App engine with external app?

Is it possible to use the Google App Engine with datastore only and keep your application on an external traditional server?
I'm interested in the GAE for Business SQL service coming soon but I only want to use GAE for the database. I would like to keep the php application on a traditional server for a variety of reasons.
Is this possible?
Yes it is possible and GAE is fairly used in this specific scenario; think about the hundreds of Iphone/Android applications that use GAE as back-end.
A simple common design would have:
A Web API to communicate with GAE datastore since you can't connect directly to it from your php application. Have a look to restlet for a cool RESTful Java web framework that supports GAE or the new Appengine-rest-server Python project .
A security check to validate that the requests are coming from the php application (HMAC / SSL).

Categories