syncing android database with server with intermittent internet conectivity - android

so I am writing an android app that will be used at a point of sale in some shops for survey questions. I have a java jsf web app using jpa with a mysql database that I want to sync with, preferably both ways but only a couple of tables. The android app will have only a few tables and will not replicate my server database completely. Unfortunately the android apps will in some places have only intermittent internet access that will drop in and out. I am currently looking at different options to use to store my data on android. I have looked at:
writing my own sync between the database on my server and SQLite on android but there has to be an easier option
storing my data on app engine and syncing with app engine as per the example in the android developers guide however I am not sure how my limited internet connectivity will work
using couchdb but I dont really want to go down this route as I already have the server side set up
does anyone have any ideas?
can I store data locally using android then sync with app engine when I have a connection?
Thanks

Related

What SQL databases are used in Android to build a simple app with a login system?

I'm trying to build an Android app where the database is on the server side.I hear that SQLite is a local database so it doesn't really work for what I'm trying to do.
In java I would use JDBC to connect to MySQL and send requests normally.
In PHP too it's almost the same thing.
The app needs a login system and all of that...
How can I do this in Android ?
Android does not support MySQL out of the box, but you can implement it.
Probably the SQLite you heard about, in the Android environment, refers to Room, the standard to save persistent data locally on the device.
In the mobile world, often a good option (if they fits for you) are NoSQL databases. There are plenty, hosted services like Firebase, DynamoDB or open source like MongoDB, Supabase.

Is it possible to remotely run queries to a database on a device through a web interface?

So far I think it's a security thing that you're not allowed reading/writing to an Android SQLite database outside of the containing app's process.
But are there advanced techniques or tools that can be used to achieve this?
For instance, I want to make a web interface with a textbox where the Android app would connect to and then I can run SQL queries via said interface to read the database or to insert records into it.
I'm writing this question because I'm really stumped. Usually my search gives opposite results which is accessing a remote database with an Android app.
You will have to develop an API backend. The mobile app ( client ) will communicate with the API and do the desired operation based on the response.
It's not possible to directly connect to the app sqlite database. You can send web request and get the info you want, handle it in your app to store it in the sqlite database
You will have to add security measures, so everyone can't access your API.
So far I think it's a security thing that you're not allowed reading/writing to an Android SQLite database.
Apps can read and write to their SQLite databases. Otherwise, the database would not exist.
I want to make a web interface with a textbox where the Android app would connect to and then I can run SQL queries via said interface to read the database or to insert records into it.
You are certainly welcome to embed a Web server into your app. For example, Stetho does this to integrate with Chrome Dev Tools, offering your SQL interface among other things.
However:
Doing this for anything other than a debug build of your app is very risky, as securing a Web server is difficult enough when it is on a traditional server environment, let alone an Android device
The Web server is only accessible by whatever can reach the device via an IP address, which means it's usually only useful on WiFi (where it could be reached by other devices on the same WiFi LAN segment)

Android App Offline Sync to Azure SQL Server and Blob Storage

I've created an Android App which the user creates data in an SQLite database and also creates picture and audio files. The next stage is to create an offline sync to Microsoft Azure (SQL Server and Blob Storage). There will be multiple devices for the App which all need to sync, so data on all devices will be the same.
What is the best method that encapsulates Android App SQLite to Microsoft SQL Server and created files to blob storage in Azure which will handle two way sync?
I've looked at Azure's MobileServiceClient but don't think that totally fits my needs as its just data tables. Maybe Sync Adapter instead?
I'm thinking I should create my own sync but not sure where to start? I think in the app i want to keep a changes table so when data is created or changed its logged in the table and then when it syncs it looks at this table and transfers the data and files. Then on the server side I'm not sure how to handle syncs from multiple devices so that all devices have the same data.
Anyway any pointers would be great.
Thanks
There is a similar SO thread Upload images to Azure Blob Storage from an Android device With Offline Sync which discussed about offline sync for files with Azure Storage, that may helpful for you, but now Azure Mobile SDK for Android in Java doesn't support it, just implement the feature by self. If using Xamarin for Android, there is a solution introduced in the offical blog, that you can refer to and possibly implement this in Java.
Hope it helps.

Adding security to android app communicating with online MYSQL database

i am new to androd development. I am developing an android app which.communicates with remote online MYSQL database. But i want to know what are the ways in which someone can hack my online data base with my android app and also how to protect my app from those?

How to access data in android app from MySQL and display even in offline mode?

I am new in android development. I am developing android app for news portal. I want my users to be able to read news even when there is no Internet connection, somehow similar to twitter feed. I need advice about connecting server data from SQLite. I see two options for now: connecting directly to MySQL or generating XML data in server in /rss page and synchronize using scripts. Which one will be better? Or is there any other option?
SQLite is best solution for this problem. We need to put synchronization technique between SQLite and MySQL.

Categories

Resources