I am trying to develop an android application that will use the same MySQL database as an existing PHP website.
I have the php codes for every operation done by the web site, for example the php code of making an advanced search.
My problem is that I don't know how to implement this operations on my app.
I assume that I should use webservices, but I don't know which type.
I appreciate yourhelp guys...
PEACE.
Its Easy , You should use Ksoap2 library to implement webservices for android. Check this example creat a login page in android
Related
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.
I would like to build an iOS app using Dreamweaver and PhoneGap. I am familiar with Dreamweaver. However, when it comes to talking to a database PhoneGap doesn't allow PHP, which is how you'd otherwise connect to a server side database in Dreamweaver.
I'd like to see an example of a simple user login or similar form that can communicate with a database without PHP.
Examples? Hints? Thank you so much for taking a look at my question.
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/
I developed a web application based on PHP, now I built an android application too.
I know I can use SQLite for storing information, but I want to connect android database to my webhost database so that the information can be accessible by two applications.
Is it possible? If yes, how?
There is no direct way to access database outside device, you need to write some web services which will return data in json (better option) or xml format and then you can parse it and use information.
You could use PHP script in order to accomplish that.
http://www.basic4ppc.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/
Although Full implementation requires lot of code and instead of reinventing the wheel its better u checkout smart implementation given in the links below which will help u out.
The following Tutorial #01 and Tutorial #02 might help you out.
1- Connect Android to Remote Database
2- Using Json (API) to parse data from and into android to server
3- Parse Request and Process
4- Save Information in Local Android Sqllite database.
I am developing an android app. We also have a website developed using PHP/MYSQL and hosted on a server. I want my app to communicate with the server to access the MYSQL database. PHP files are written in codeIgniter Framework. Where can I get the webservices to invoke from my app ?
I don't understand how to make my app and the server communicate. Pls help me.
Thanks in advance!
The easiest way in my opinion is to use JSON, take look at this simple example: http://www.helloandroid.com/tutorials/connecting-mysql-database
It's really easy :
You can create a Controller (let's call it "Webservices").
In this controller write a method that do excatly what you want and output the data (in JSON format for example)
Then call the URL (http://www.mywebsite/webservices/method) from your Android app, you'll get the data JSON encoded.
Finally parse the data in your Android app.