Parse.com: Does PinInBackground() to Local DB save to the Cloud eventually? - java

I use the Parse.com Cloud service in my Android app to sync data between devices.
I use the app mainly offline and use the local DB
Parse.enableLocalDatastore(getApplicationContext());
I would like to use PinInBackground() to store the data locally and sync once every day by hitting the sync button in my app.
Now if my app crashes or the device restarts - how do I know which objects are stored only locally so I can sync them with Save()?

pinInBackground() will not save to the cloud eventually. The only action that does BOTH is saveEventually(), which will pin your objects locally if your network is down so that you can still query them even though you are still offline.
More in the Parse Android guide

Related

saving room database data locally

I am using room database in my android app and I want to use it offline to access it from any device that installs the app...
where is the place I should put my database file in the android application to access it offline?

Data storage in Firestore For Offline App

I am using Firestore as a NoSQL databse in my Android app. I want to store data locally in my Android device and avoid syncing with Firestore server in the initial stages of app. Is is possible for the data to persist on device even if app or mobile device restarts without syncing with Firestore database? If yes then how do I do it ?
I want to store data locally in my android device and avoid syncing with Firestore server in the initial stages of app.
According to the official documentation regarding Firestore offline persistens:
For Android and iOS, offline persistence is enabled by default. To disable persistence, set the PersistenceEnabled option to false.
And to answer the second question:
Is is possible for the data to persist on device even if app or mobile device restarts without syncing with Firestore database?
Yes it is. This kind of persistens is called disk persistence, which means that recently listened data (as well as any pending writes from the app to the database) are persisted to disk. The data in this cache survives app restarts, and phone reboots.

Out of the box sync service for mobile app

amazon-cognito
I have a mobile app that collects a lot of medical data from the user and every ~30 minutes needs to send the new data to the server.
I need 2 things:
1- Sync between the server and the app the data. If a user login from another mobile device he should get all of his past data and have full picture of his history.
2- the data that is being sync with the server should be store also on data base that I can query for analytics purposes.
What do you suppose to be the architecture ? What technologies do you recomend for that? I thought to use aws Cognito with Redshift but it is limited to 20 MB for each user.
My main question is there any out of the box sync service that i can copy it also for my BI DB like Redshift?
You should try the AWS Mobile Hub site. It will produce a sample app with the functionality you are talking about. You then click to download that sample app.
It will produce an IOS app in Objective-c or Swift, or an Android app (in java?).
It will sync up to 1M per user using Cognito Sync, but the app can also provide access to files through S3 or database through DynamoDB.

sync data to server android

I'm new to android sync so I really need ideas to get started. Actually my app's requirement is like this: My app needs to connect to my database online. But my android app can be used offline meaning, the user can add records to a local db, say sqlite. And then when the user connects to the Internet, the app should automatically connect to the server and add the record the user added when he is not online. Can you give me some considerations and ideas on how to do this? I really need your help guys. Thanks.
I will recommend you to go for Sync Adapter. See these links
AbstractThreadedSyncAdapter and Creating Sync Adapter.
I have used them long time ago. I will say that it is the best approach for syncing data between device and server. Usually, email apps use these sync adapters.
Sample is also given there. Download it if you want to go deep inside of "HOW".
Thank You!
You need to run background service like android alarm manager. You need to check that device is connected via internet or not. if device is connected via internet then sync the data to server.
Check this like to the way of data sync
How to sync SQLite database on Android phone with MySQL database on server?
Thanks

Offline storage management for android

Theme : Newspaper updates in android application.
How to fetch or retrieve data from server and post updates on android application . How to manage offline storage means whenever there is no internet connection how the data gone be updated on android application , atleast how it consider showing updates on android application . If any one known this issue please answer about it .
I am actually using php or json as intermediate files for fetching data from server and send updates to android application but its seems to be more complex and if i wont get the permission to access the server side files , how do i manage for updates ? whether is it necessary to have permission to access the server files ?
More about the topics : if i want to syncronise the update with website , how do i handle it or implement it ? i am not asking any sort of coding here .
How to fetch or retrieve data from server and post updates on android application
use HTTPClient.
How to manage offline storage means whenever there is no internet connection how the data gone be updated on android application
I think you don't understand what offline storage means. If there is no internet connection, that's it. You are not able to update your content. Offline storage is useful if you have internet connection, but not everytime. The content you downloaded when you had internet connection can be saved to SQLLite to be loaded when you don't have internet connection.
I am actually using php or json as intermediate files for fetching data from server and send updates to android application but its seems to be more complex and if i wont get the permission to access the server side files , how do i manage for updates ? whether is it necessary to have permission to access the server files ?
Create WebService as an interface. Do not let other system to be able to directly access your files. Or just create a PHP files that basically return Json or XML Data.
Other option : create an RSS.
More about the topics : if i want to syncronise the update with website , how do i handle it or implement it ? i am not asking any sort of coding here .
Create an event to start sync using HTTPClient. If there is new update, save it to SQLLite(for offline storage) and display the content. The event can be triggered during the start of your application or clicking refresh button and if Internet exist.
Update :
There is a new framework called couchbase mobile. You can sync the local mobile db from a couch server. You can insert/update the data locally(offline mode) and then the data can be synced also to the couch server, whenever you have internet connection. This means the need to create HTTPClient is no longer necessary.
For the database, try cloudant.

Categories