How to make a webservice and connect android application with it - java

I made an android game. Now i want to store game score of each user in a database.
I am not getting how i can do it, but as far as my findings i need to create a web service for it, where all the functionality for fetching and storing of data.
My questions are:
How to make a web service for fetching and inserting data in DB
how to connect android application to this web service
web service should be in java.

There are so many questions on connecting an Android application to a web service.
If you plan to implement your webservice in Java then I suggest you use the Spring Web Services.
EDIT
Java has two standards for web services: JAX-WS for SOAP web services and JAX-RS for REST web services. Each of these have several implementations. However, I would prefer using the Spring web services.
Also, try reading about Spring from over here.
Hope it helps
Cheers

Related

How to connect android application with my websit database?

I have already design a web site using Spring MVC. Now I want to develop an android application that able to get the client details of my web site and the interface is completely different from my web site and also has additional functions. The changes made through android application should be updated in my web site also. What is he best way to do it? Can I make my database common for both applications or I want to move into REST web services.

Call SOAP web services from a play framework (2.2.4) application

I am working on a web application developed using Play framework 2.2.4(Java) and now I need to call some SOAP web services from within my web application.
I am new to Play framework and web services and I am confused on how to do it.
So far I have only managed to used the WSDL for the SOAP services to generate the java classes using wsimport.
I came across the WS API of the play framework to asynchronously call the web services and I have the following doubts.
How can I call these SOAP services using the WS API of the play framework?
In play framework, is it necessary to use this WS API to make a web service client, or can it be done using other ways?
It would be really helpful if someone can share a small tutorial to do this.

How do i link android app with web app using REST/HTTP

I am new here. I would need some advice on this issue.
I have a well developed java web application deployed on openshift and connected with mySQL.
i am new in android development. Currently, i have to develop an native android application that talks to my openshift application for the data in mySQL. I understand that to do this, i have to create a RESTful web service on my web app and my android application would call the web service.
My questions would be
1. Where can i get started to develop a restful web service, is there any simple-to-understand resources to get me started? I understand that creating a restful web service from scratch would be tedious and having a framework will help in creating a web service better. Please advice me on this
Is there any sample projects/tutorial out there that guide me how to write a restful api to link between my web app and android app?
To create a restful web service, it is using json to parse the information over, is there any guide on this? I'm not very good at json. Would be good if there is an tutorial
Thank you for the guidance in advance! Feeling lost on how to get it started despite reading the getting started on android 1001 times!
If your code is in Java, I suggest you look into Spring MVC framework. Its one of the widely used frameworks for Java.
You could look into Volley examples here.
Volley is recommended for HTTP calls in Android.
To create JSON response to be sent by your server, you could look into Google's GSON library. To parse JSON web response into Java objects in your Android code, you could use any of the ORMs. GreenDAO is a stable open-source library for this purpose.

consuming SOAP web services over android

I have an java EE web server running struts 2, hibernate and spring frameworks. The web application is simple online file storage solution with encryption. Now I want to expose my methods via a SOAP web service so that I can use that in my android application. I have the WSDL for my web service. I followed a tutorial and come to know that we can use java wsimport tool to generate java classes from WSDL.
Can I use that java classes to use in my android application So that my application can communicate with the remote server?
I am using hibernate for database operation so there would be hibernate entity classes that are returned. I am thinking I can have simple POJO classes in android application instead of hibernate entity classes.
You can have a look at this, I dont think it will work out of the box. KSoap2-android project library might help you .
http://www.ibm.com/developerworks/webservices/library/ws-android/index.html

Application on Google App Engine with Web and RESTful interface

I'm learning to use the Google App Engine for a project.
I've created a sample web application with the java sdk, in which all the business logic is in the servlets.
Where should be right to put the business logic if I want also to expose the application functionalities through a RESTful web service (which I understood that is possible with additional framework as Restlet)?
There is any development framework that can help me in this?
Right place to put the business logic would certainly not be servlets. You should put logic in service, and data access classes. Be careful while choosing a framework on GAE as cold start may hurt badly. As for REST framework on GAE, RESTlet has gained some positive response.
Refer RESTful application on Google App Engine Java?
and Implementing REST Service (JSON) on Google AppEngine

Categories