android clients - java server implemenation - java

I am building a android clients - single server application, and want to use JSON objects for communication. Will have some simple database on the server. what would be a good scheme for server side implementation. Here are my options:
Socket programming - then can I still use HttpClient on the android client?
HttpServer - I heard it is not working well with android, and how do you do multithreading on server side?
any other recommendation would be helpful. thanks

There is some interesting discussion over at this SO question that may provide some useful info: How to call a SOAP web service on Android

Related

Java web server to process Android client request

Since I'm a newbie to Java web server, I don't know where to begin to create a server in Java to reply from Android devices request( A WEB SERVER NOT AN ACTUAL SITE).
Which technology should I use and which document should i read?. I have searched on the Internet about Java but i found out many technologies and i don't know which one i can use.
Spring MVC,JSF,JSP,Struts,Servlet..............
Hope this question clear enough for you to reply. Thank you
It doesn't matter what be process android devices requests on server side. In this case main idea is http communication - client sends request, server process this request and sends response to client, and you can use any technology on server side - java, php etc.
If you prefer java I can suggest you try servlets, it is simplest technology of those you mentioned above.

cross language api for this client server communication model

my question is following up from this question:
Simple Protocol Concept in Java for this setup
The idea is exactly the same i.e client will send request and server respond with some information:
However i want a well known protocol implemtation such that the server/client can be implemented in any programming langguage. So that client Running java can communicate over TCP/IP sockets to remote app written in C e.g.
for this reason, can you recommend any well known opensource implementation?
Just few tips:
Rest interface: http://en.wikipedia.org/wiki/Representational_state_transfer
Corba: http://en.wikipedia.org/wiki/Common_Object_Request_Broker_Architecture
Apache Thrift: http://thrift.apache.org/
Google Protocol Buffers: https://developers.google.com/protocol-buffers/
your own implementation over tcp...
it depend on your architecture and your requirement, you can use TCP protocol directly, Http is another choice, if your server deployed on a http server, i recommend using web service. i hope my answer will give you some ideas.

Proxy Server in java

I am new to java.I need to develop a proxy server for IBC 2011 conference.I have some Questions regrading the Proxy server.
1.I am going to develop the proxy server using java.
Suppose A(sending the information) to B(receive the message) through the proxy server.
Here A is sending the information through HTTP serves(application running in A is a wed application) how can i receive the information send by A in proxy server and how can I forward it to the B which is also a HTTP serves.
2.What r the Things I have to now before I start developing the proxy server.
3.How can i get the information from the HTTP protocol.
4.How can i check frequently for the any message is there in line to forward to B from A or B to A.
Can any one helpme.Thanks in advance.
Use one of these instead http://proxies.xhaus.com/java/. Rolling your own proxy implementation will be much harder than you think once you've taken all the intricacies of HTTP into account.
there are many libraries which can you use.
for the A and B they can running hessian server(for listening) + client(for sending)
and for the proxy server you can use JMS + hessian server + client same as for A and B.
In this way you can send java objects.
But hessian is only on suggestion you can use RMI or spring remoting or maybe web services.
By far which a have working hessian is the fastest and very easy to develop.
from 1 to 4 you ask how to design a application which is out of the scope and you need to do it by you self :).
I did something similar in my course project.
As far as i am concerned, the core knowledge u need to learn about java for this a proxy server is socket programming.
you can setup two sockets: one communicates between your proxy server and the web browser, the other communicates between your proxy server and the target server.
Also, you will need some knowledge about thread in Java, open one thread for each connection will be a efficient way.
And I assume that you already have the knowledge about those computer networking stuffs like http, tcp.etc.

writing desktop application for connecting with server

I'm working on a server client base "Desktop Application". And what I want to do is this,
Client application sending some request code to server through internet(oh yes, these connections must be secured). and when server application gets this code it will again do some work and gather some data.
And then server application will return those data again to the client application.
As I am new in this, I need to know, what kind of tools to use?
Is eclipse good for that?
Where can I find good examples for writing client?
Where can I find examples for connecting client with server side?
I'd recomend checking out apache httpclient it really helps when dealing with web APIs.

Implementing a IM platform in Java

If creating an IM platform in Java, which would be a better way to implement communications between the clients and server?
I was thinking either RMI or just a socket connection...
Advice please,
Thanks
I would use straight socket connection, using a well known protocol such as XMPP. You can use a library (like smack) to avoid implementing the whole protocol yourself.
The main advantage of XMPP over RMI or your self-made protocol is that is a well established protocol used for exactly that purpose: IM.
Some chat services already using XMPP include Google Chat (GTALK) and Facebook.
I already did this using Smack API, using XMPP protocol.
CometD has been specifically designed for use cases such as Chatrooms. Differently from other protocols, it works over HTTP port 80, which means (nearly) no hassles with Firewalls.
Listen to a recent podcast with Greg Wilkins about the project, which goes into some details of issues with implementing Chatrooms and how it gets handled by CometD.
I believe there is a Java client for CometD if you need to have client on both sides of conversation (normally frontend is JavaScript).

Categories

Resources