Create webservice in drupal - android

Can we create webservices in Drupal? Our web development team is creating a website in Drupal and they want to build an android application for the same and for that I need to use webservices to access the database.

Have a look at the services module
A standardized solution of integrating external applications with
Drupal. Service callbacks may be used with multiple interfaces like
REST, XMLRPC, JSON, JSON-RPC, SOAP, AMF, etc. This allows a Drupal
site to provide web services via multiple interfaces while using the
same callback code.
It's build for this reason. Drupalize.me android app is built on the services module, so too for many android applications.
Hope this helps... Muhammad.

Can we create webservices in Drupal?
Yes, You can Do it.
I had done it via JSON webservices.

Related

Communication between a web application and an android application

I have a web application built on java and an android application. Both are deployed on different servers. How can i send request from android application to web application? Also, how can i send corresponding response from the web application to android application?
use REST api's (in JSON format).
This can be done with the help of web API's . You have to create webApi's on your server and, You can use AsyncTask in your android application to communicate with those web Api's.

which type of web services can a Android App talk to?

I was reading that SOAP is really not for Android. Rather Android prefers REST web services. So my question is, are there any other kinds of restrictions ? For example, some web services are built with JAXB. Is that ok for Android apps ?
I other words, does it matter how the REST web service is built ?
What if the web service returns data in XML format, is that ok with Android ?
It does not matter what kind of Webservice you are communicating with.
You communicate using HTTP protocol. If you use SOAP then you can parse your xml at client side.
Also there are many SOAP clients already available so you dont have to do much work.
Check this - http://code.google.com/p/ksoap2-android/
There is no restriction with REST web services on Android. Yes android can handle xml. You can get detail knowledge and help by going through GAE (Google app Engine). Find the link below:
https://developers.google.com/appengine/docs/
Android does not provide a built in SOAP client, there are many third party libraries that can be used to call a SOAP web service with native android APIs.
Where as REST is so simple & can be used directly without any third party libraries.

Access Heroku database from Android application

I've built a Rails 4 web application with PostgreSQL database and hosted it on Heroku. The future plan for that database is to also be used by one Android application.
I am not completely sure how can I accomplish that. Do I need to build another REST application and host it on Heroku and somehow connect to the same database or there is another way?
How to connect with Android application to that database which is used by the web site? I know I can't connect directly.
Thank you for your guidance.
You don't need another app - just build an API for current one and then you can communicate from Android app to your web application (web app will connect to db and return data).
Have a look at Twitter API as example - you can access different resources and manage them via Twitter API
https://dev.twitter.com/docs/api/1.1
You can build something similar - create rails controllers that access your database and respond with structure you want - preferably JSON format of your models (or something custom if you need)
From Android app you can send request to your API and parse JSON responses - then process data your own way on Android app.
Don't forget about authentication between your Android app and web application - let only your Android app to use it.
I encourage you to browse internet for best practices 'How to create an API' :)

Web services for mobile necessity

I have a website and i need to make an app on android and iphone and the app has to communicate with the server,similar to facebook app.Do i need web services like SOAP for this.I read their documentation but how necessary are they and what is their main purpose? Can I do the same without using web services? my website is in codeigniter
If you need to implement web services for your app, I recommend taking a look at CodeIgniter Rest Server. This provides an easy way to implement REST web services, which are lighter weight, easier to work with, and more flexibile than SOAP.
Benefits of using a Web Service:
1 - Usability: You can develop Android and iOS apps, and both of them can use the same Web Service. Other smart phone platforms can also be developed later and use the same Web Service.
2 - Flexibility: For instance, you need to have a mechanism to talk with the database. You can implement the database transaction in your Web Service. (I have experience in using hibernate) You do not have to create a database configuration in every smart phone app. If you decide to change your database, then you just need to modify your database configuration in the Web Service - nothing changes on the client sides.
3 - Security: It is not a good mechanism to connect directly from a Mobile app to your database server. You need to have some kind of Authentication mechanism that can be provided by a Web Service.
Which kind of Web Service is better? I agree with #Justin that REST is a good approach since it is lighter, simpler to implement and more flexible.
SOAP can be a better approach when Security is the most important thing, for instance in certain enterprise scenarios. REST vs. SOAP
Are webservices necessary? Well the correct answer to your question is it depends on the app. Most apps that connect to a server to get some information use web services. However, no you don't need to write your own web services. Increasingly people are using platforms like agigee
http://apigee.com/about/products/usergrid/
So no you would not need to write your own api if you used usergrid, but you might want to if you wanted to keep the data all within your own infrastructure.

Web Services with Android - why no support for WSDL?

I'm creating a Client/Server application with Android (Client) and WCF (Web Service).
From reading quite alot of discussions, I'm under the impression that there is no tool available to create the web service client in android automatically from a WSDL file.
If this is the situation, what is the easiest approach for creating a communication infrastructure between the client and server, that can be updated easily in the future (plain GET, REST, use SOAP and manually parse responses)
Initially, I wanted to build the web service and have the client created automatically with the provided WSDL file.
Thanks
AFAIK, there is no tool for automatic client generation based on a WSDL.
Android doesn't come with any soap related library.
BTW you can look for ksoap2-Android libraries and see if it's suitable for you.
More infos about using ksoap with Android should be found here

Categories

Resources