title: Design and logic for client/server networking games
body: <p>I am creating a simple android game that deals with multiplayer and connecting to server. This is what I want to achieve for my game. </p>
  
  <p>Client sends keystroke movement to server.</p>
  
  <p>Server accepts input, update the state and calculates and returns new position to client</p>
  
  <p>Client gets new position and update the screen.</p>
  
  <p>I already have some code written and so my one of my threads sends keystroke to server, waits for the new position, then update the screen. The thing is there is lag between the player's movement. I think it has to do with latency. I also tried two thread, one  for sending/receiving data from server and another is updating the screen. But it didnt' solve my latency problem.</p>
  
  <p>Can anyone suggest a good design for networking game?</p>
  
  <p>Do I need to do early prediction?</p>
  
  <p>Do I need separate thread for fetching data and rendering screen?</p>
  
  <p>P.S.This is my first time creating a network game so i have no idea what im doing.</p>