嗨 Ryan 
,我也在我的 android 应用程序中实现了类似的东西,令人惊讶的是,我的PostgreSQL服务器中也有 14 个表。
首先,即使应用程序不在前台,您也希望定期轮询服务器。为此,您需要运行后台服务- 在这里您必须在服务中手动创建一个线程,因为服务默认在 UI 线程上运行或使用IntentService - 您不必创建单独的线程。无论您在意图服务中编写的任何代码都将在不同的线程中自动处理
现在您必须让该服务定期执行。为此,请使用AlarmManager并使用setRepeating()功能。在参数中,您必须为您的Service或IntentService提供PendingIntent。但是,如果您要每隔不到 1 分钟轮询一次服务器,请不要使用警报管理器。因为电池会浪费很多。
这里有一些代码可能会给你一个想法:
function setalarm()
{
 Intent intent = new Intent(getBaseContext(), Intent_Service.class);
       PendingIntent sender = PendingIntent.getBroadcast(getBaseContext(), 192837, intent, PendingIntent.FLAG_UPDATE_CURRENT);
       Random randomGenerator = new Random();
     long interval=60000;  //1 minute in milliseconds
     AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
       am.setRepeating(AlarmManager.RTC, cal.getTimeInMillis(),interval,sender);
}
这是 IntentService 类型的 Intent_Service :
public class BackService extends IntentService
{
 Context context=this;
 //public Timer t=null;
 public BackService()
 {
 super("myintentservice");
 }
 @Override
 protected void onHandleIntent(Intent intent) 
 {
  try
  {
     PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
      wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "My Tag");
      wl.acquire();
        //..CPU will remain on during this section..
     //make our network connections, poll the server and retrive updates
   //Provide a notification if you want
    wl.release();//Release the powerlock
  }
}
}
但如果您想要即时更新,请使用Google Cloud Messaging Services。要了解有关其工作原理的更多信息,请参阅此
希望这对您有所帮助。