DB에 모든 데이터를 로컬에 저장 한 다음 인터넷 연결이 가능한지 확인하십시오 (인터넷을 사용할 수있는 경우). API 호출을 통해 웹에 데이터를 전송 한 다음 로컬 DB에서 데이터를 삭제하십시오. 서버로부터 응답을받습니다. 이 방법은 서버로부터 응답을 얻은 후 ur 로컬 DB의 각 행을 삭제합니다.
이 구현을 위해, 당신은 할 수 있습니다
- create a database on mobile
- Register User on Server, After registering client should get a response from server and a timestamp.
- Save timestamp and register a Pending Intent for 12/24 hrs to Start a Background Service that would Sync the Data to Server.
- In case of no availability of Internet while Service wants to Sync data, we should have a Broadcast Receiver that check for internet connectivity, and as soon as Internet is available it would silently Start Service (Sync Service) in background and send data to Server.
- Server would again send a response with timestamp, on receiving timestamp we delete our local Database, and repeat step 3. This cycle will keep on repeating.
내가이 서버 목적을한다고 생각합니다. 이 방법을 구현하는 경우 코멘트를 남겨 두십시오.
출처
2012-07-28 19:38:44
Ali