Data transfer problem in application


Last Updated:

  1. AndDevloper

    AndDevloper New Member This Topic's Starter

    Joined:
    Apr 20, 2010
    Messages:
    3
    Likes Received:
    0
    Hi Everybody,
    I started learning android just a couple of weeks ago, so I am very new to it. I required some help regarding this application that I want to build.
    My application is one that requires a data transfer between a client and a server. The client is running on android and the client sends some data at a very frequent rate to the remote server, which then compiles/understands the data so obtained. How can this be implemented very efficiently in android. What kind of classes/resources will be required?

    My second question is that does Android have the capability to run on a tablet as of now? If so, how will that happen? Could you please explain a little?

    I'll be really grateful if someone could help me out here. I am finding this a little tough and could do with some help here.
    Thanks in advance.
     

    Advertisement
  2. fabiocberg

    fabiocberg Active Member

    Joined:
    Apr 7, 2010
    Messages:
    27
    Likes Received:
    1
    I've already done a client/server where the client was running on android.
    To connect and send data to the server I used the this code:

    Socket socket = new Socket();
    SocketAddress addr = new InetSocketAddress("200.185.55.52", 9000);
    socket.connect(addr);
    OutputStream os = socket.getOutputStream();
    DataOutputStream dos = new DataOutputStream(os);

    You can use 'dos' to write all data that you want to.
    Don't forget to close the streams and the socket when you finish to write the data by calling dos.close() and socket.close().
     
    AndDevloper likes this.
  3. AndDevloper

    AndDevloper New Member This Topic's Starter

    Joined:
    Apr 20, 2010
    Messages:
    3
    Likes Received:
    0
    Thanks Fabio,
    That helped a lot. My other question was can we run android on a tablet as of now? I mean can we load the whole OS on a tablet using some mechanism?
     
  4. fabiocberg

    fabiocberg Active Member

    Joined:
    Apr 7, 2010
    Messages:
    27
    Likes Received:
    1
  5. fabiocberg

    fabiocberg Active Member

    Joined:
    Apr 7, 2010
    Messages:
    27
    Likes Received:
    1

Share This Page

Loading...