Cordova Local Storage Sync with Server - android

I have a hybrid app where I use a backend server on the cloud using mongodb and nodejs. I feed my frontend web app and android app using http post and get request.
I was wondering if there is a best way to save the data (from server to android or vise versa) and sync them together. Much like how Trello does their android app.

As far as i know local Storage is not a safe storage, as it can be cleaned as needed by the phone.
I recommend using sqlite for the mobile side.
for quick communication with server, i recommend using sockets (i used it for my chat app)

Related

How to save and store data locally and on a server simultaneously in Swift?

I am planning to make a mobile application for both iOS and Android. First, I would like to make the iOS version of the app. I am planning to use CoreData to save data locally when the mobile is not connected to the internet, then when the phone is connected to the internet, I would like to add the data (which is saved by the help of the CoreData) to the FireBase, then I would like to download all the data from the Firebase to the app to get the latest data.
Is there any other solution to be able to save data offline and synchronize it to other platforms (in this case to Android) when the app is connected to the internet?
Since you're already looking into Firebase, I'd suggest leveraging their Realtime Database tool, as it handles everything from automatically syncing data between client and server, and leverages offline databases in case your users go offline and they have SDKs for iOS and Android.

Communication between website and android app

I want to build a website, where the data will be saved in a data base, logical in a sql database. Also, I want to build an android app, which will take the data from the above (sql) data base. How can I achieve it? I mean how can I manage the communication between the website and the android app. In past, I have create website with php and sql and also I have build android apps, but now I want to achieve the communication between them. Can I use parse platform?
FYI, without any server communication you can't use the website database in android application.
If you want to manage the communication between the website and the android app means you need a centralized server which having the data of your web/mobile applications. So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them.
yeah unfortunately chrome won't let webapps use local storage on android. what you can do is create a local server (using org.apache.http package for example), let it run as a background android service, then have the website make requests to that url. Its considered hacky, but it would work. You can post whatever data you wanted the website to know about , and then get it from the website.

Access Heroku database from Android application

I've built a Rails 4 web application with PostgreSQL database and hosted it on Heroku. The future plan for that database is to also be used by one Android application.
I am not completely sure how can I accomplish that. Do I need to build another REST application and host it on Heroku and somehow connect to the same database or there is another way?
How to connect with Android application to that database which is used by the web site? I know I can't connect directly.
Thank you for your guidance.
You don't need another app - just build an API for current one and then you can communicate from Android app to your web application (web app will connect to db and return data).
Have a look at Twitter API as example - you can access different resources and manage them via Twitter API
https://dev.twitter.com/docs/api/1.1
You can build something similar - create rails controllers that access your database and respond with structure you want - preferably JSON format of your models (or something custom if you need)
From Android app you can send request to your API and parse JSON responses - then process data your own way on Android app.
Don't forget about authentication between your Android app and web application - let only your Android app to use it.
I encourage you to browse internet for best practices 'How to create an API' :)

Can you use the database on a website for android?

I'm developing an app and a website simultaneously. The website will be done in django and using Google' app engine, so therefore Google's database. IS there anyway i can download and use the database for an android app? Preferably I would like it to download and make it available offline to the users.
use a REST api like django tastypie on the server side, and consume the rest resources for the models you need with your android app. After you get the Json/xml messages on your android just save it to the local sqllite db
Android does provide a SQLite interface for you to read and write to a local db. You could fetch the db through a web request and save it locally, yes. Being on Google App Engine does not help / hinder your ability to do this.

Android application and Application server

I want to develop a basic form application which records datas into a sql server. However, it is commercial work so i need to use an application server for security reasons. I searched and discovered that android can connect to a sql server via a open source library but i'm not sure how to use an application server with these?
You should write a webservice layer on you application sever and consume these on the android client.
Connecting to DB directly is not advisable

Categories

Resources