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.
Related
I am creating a Child Monitoring APP in android. I want to retrieve the call logs from one app to the other app. What are the APIs available for this? or What is the recommended method to achieve this?
yes, it is possible using android.
you need to use an aidl file which works as client and server app. you need to write your own logic for getting a log and then using an aidl file you can share it across the app
I have an Android app a Simple form consist of some fields, I also have a Web server using Google App Engine in PHP. I was confused by This, should i send the Data from my Android app directly to my webserver, display the data in web server using local and then later on update thus data in datastore or should i send the data from my android app directly to the datastore and display in my webserver? I'm new with this Android and with this Google App Engine/Datastore, I hardly can't find proper Tutorials on Google App Engine using php. I think only few uses this thing.
Any Suggestion well do.
The typical solution would be to provide an API for your app. I'm not familiar with PHP these days but there are bound to be plenty of REST frameworks that will take care of all the JSON conversion for you.
Your API (assuming it's PHP) can then take care of doing any necessary validation, authentication, performing queries, etc, against Datastore. This may help.
If you're familiar with Java (you're writing an Android app) or Python, you can look at Cloud Endpoints.
If you want a PHP library to access Datastore from GAE, check this out:
https://github.com/tomwalder/php-gds
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
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 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