0
如何從Android定期發送位置到服務器?我試過以下內容:從Android應用定位到PHP服務器的GPS定位
Intent i = new Intent(this, UpdateLocation.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, PendingIntent.FLAG_UPDATE_CURRENT);
// Repeat the notification every 15 seconds (15000)
AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
am.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 1000 * 60 * Interval, pi);