Reputation: 429
My intention is to develop an android app that has the capability of storing data temporarily to the database even when there is no internet connection and sending those stored data to a remote database when the app has an internet connection. Is there any relevant technology or DBMS or tools to do so? If there is can you please send any references I would go through?
Temporary storing should be able done by many mobile devices into its own store(repository) without the internet connection. When the internet connection is available, the users should have the ability to send those data to a common database(remote).
Upvotes: 2
Views: 9238
Reputation: 3930
I recommend Firebase Cloud Firestore for most developers starting a new project. Cloud Firestore
offers additional functionality
, performance
, and scalability
on an infrastructure designed
to support more powerful features.
Cloud Firestore caches data that your app is actively using, so the app can write, read, listen to, and query data even if the device is offline. When the device comes back online, Cloud Firestore synchronizes any local changes back to Cloud Firestore.
For more details Firebase Cloud Firestore
Upvotes: 1
Reputation: 31
I prefer the ROOM database for storage. The remote syncing functionality can be accomplished using WORK MANAGER API with periodic work requests combined with network constraints.
room: https://developer.android.com/training/data-storage/room
Workmanager: https://developer.android.com/topic/libraries/architecture/workmanager
periodic work: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/recurring-work
Upvotes: 1
Reputation: 455
Don't see much detail but how I would do it is store the data in a Room
database:https://codelabs.developers.google.com/codelabs/android-persistence/#0,and then use a method to check for internet connectivity,For instance in Volley this library:https://github.com/adnanbinmustafa/Gloxey-Network-Manager ,has an isNetwork
method you can override to check internet connectivity then send that data to remote server using the same library.
Upvotes: 2
Reputation: 780
You can use the following local databases to store the data and access it in offline mode.
If you do not want to use any library, then you can use the inbuilt local database,
Google provides codelabs on using Room Database for locally storing data
Upvotes: 2
Reputation: 3097
I would suggest using internal SQLite database for storing larger data even if it is temporary, there is plenty of Wrapper libraries for that like Room
, ORMLite
and others...
For smaller datasets like options or preferences use SharedPreferences
.
Upvotes: 1
Reputation: 131
You can use Room for local offline storage: https://developer.android.com/training/data-storage/room
If you want to have automatic remote sync you can use Firebase Realtime Database: https://firebase.google.com/docs/database
Upvotes: 4