Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Socket Programming?

I need a little bit help regarding to android socket programming. I had made a server-client prototype using java socket programming. In server client scenario , I am sending commands from 1-10 and sever do some task according to command received from client. e.g. when server receives a command it sever will send a bufferedImage to the client. Its (java prototype) is working fine. In this scenario, both server and client a java desktop applications, Now I want to make android as a client. Can someone help me in this regard or suggest me good resources of android socket programming?

(Please note BufferedImage class is not supported by Android.)

like image 281
Mudassar Avatar asked May 06 '11 07:05

Mudassar


People also ask

Is socket programming still used?

Most current network programming is done either using sockets directly, or using various other layers on top of sockets.

Can we use socket IO in Android?

The first step is to install the Java Socket.IO client with Gradle. We must remember adding the internet permission to AndroidManifest. xml . Now we can use Socket.IO on Android!

Is socket A programming?

A socket is a communications connection point (endpoint) that you can name and address in a network. Socket programming shows how to use socket APIs to establish communication links between remote and local processes.

What is socket programming example?

int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); After the creation of the socket, the bind function binds the socket to the address and port number specified in addr(custom data structure). In the example code, we bind the server to the localhost, hence we use INADDR_ANY to specify the IP address.


1 Answers

There is no problem in porting your application. Android runs on Java, which very similar to desktop version. All you need is to migrate BufferedImage to simple byte array, and to use ImageIO on your server side.

like image 188
Vladimir Ivanov Avatar answered Sep 28 '22 03:09

Vladimir Ivanov