i need to develop an application for device management i am beginner in android and java. i want the client to send request for patch to the server and the server sends the requested and i also want to use web service to it. i wish to know how to lay connection between the individual android clients and the server. pls do send me some sample coding or tutorial???
i do not prefer doing it with php server Android PHP server
Since you don't want PHP and you specifically say you are using Android and Java, why not implement a servlet to host the patches. Then use HttpClient on the android side to send a request over to the servlet and have it respond with the patch.
More on servlets:
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
And some simple code for HttpClient:
http://w3mentor.com/learn/java/android-development/android-http-services/example-of-http-get-request-using-httpclient-in-android/
Related
i'm trying to connect android app to django web server that both android device and django web server are using a same internet connection(both connected to same AP) and sending data that in my case it's Json file.
django web server should take the Json file and change the data stored in database(in my case MySQL and django runs on python3).
is there any way to Not use rest API?or using something like Socket programming in django?
remember i just want to send Json file in WLAN network.
Thanks you.
You can use Sockets, but i think HTTP request are much more simple to work with, as django is WSGI based, and it doesn't support Sockets out of the box, you will need to use something like Channels to handle sockets.
I want to read and update data from server (using Apache) to my Android App.
I`m new at the Apache part.can anyone give me a guide for this kind of operation? I already download "XAMPP", and my main goal is to read a JSON into my App, but I believe I can manage also with php .
I know that this is general question but I don't understand at this subject.
Thanks.
the most basic way is to make sure your web server is listening on an open port(usually 80). in your android app send a request to your webserver (url request). on your server hava a script that echos or prints JSON data...
Apache is a web server. You need to connect to it using HTTP. There is an HttpClient and other ways to get http server data, as long as you have a network connection.
I am working on a project built using Spring, Struts 2 and Hibernate and I need to build a web service for an Android Application . I've started to read about web services I understood the difference between SOAP and REST . But I still have problems in how should I proceed to deploy my web Service .
there a lot of technical concepts that I still don't understand .
Would you please help me with your instructions ?
SOAP means creating a SOAP XML message and sending it to the service via HTTP.
REST is more of a style than a standard. You use the HTTP verbs (GET, PUT, POST, and DELETE) and map URLs to manipulate data on the server side.
In either case you'd use a Java EE app server or Tomcat or Jetty to deploy a WAR file containing your service. Then your Android client will create HTTP requests and send them along.
You'll want that service to listen on port 80 for HTTP or 443 for HTTPS. No worries about firewalls that way.
iam making a location based app in android in which iam communicating with a server and giving some data to server now in android ican communicate with a php using DefaultHttpClient ,HttpPost/HttpGet and Http Response class in this simple way ican take and give data to web server and another way is to make a Rest webservice my question is which is the preferable way to communicate.
I'm writing a web-service for Android. The client side will be coded in JAVA and we are planning on using ReST. But, the server supports SOAP, JMS( Java Messaging Service) and Remote Method Invocation (only these). I just want to know if it is possible to return response for a ReST based client from this server.
As far as I know, ReST is not a protocol like SOAP, but I just want to be sure that it can be done before I get started.
Any link to video/tutorial/code will also do.
Thanks in advance.
REST is really just an elegant way to use HTTP for resource access.
HTTP is the protocol.
So if you can process HTTP requests on that server, it's doable.
In a Java EE environment a servlet container is perfect: you can create a WAR based on the Jersey framework.