update SQLite data from tablet to mobile in android - android

I am creating an app that is for my grandmother as she suffers from Alzheimer. I would like to have a feature where I could remotely update the schedules from my mobile to her tablet .Now I am thinking of various possibilities to have the same set of data in both Tablet and Mobile for example:Authenticating the application with caretaker's username and password requires checking data from SQLite table.Now how is it possible to have same set of SQLite data in both mobile and tablet. Any update on SQLite table in tablet should also update the mobile SQLite database.
-I don't want any cloud service or third party apis.
-One way I think is have a PHP enabled server and have both devices integrated to it.
-Is there a way to have the tablet send data directly to mobile through HTTP?(Of
course mobile should be connected to Wifi but that is fine!)

As I see it there are two ways you can go.
Server based: You write a server and then post updates to it, the tablets periodically pulls any updates from it, you need to write a web server in language and framework of your choice communicating over JSON or XML with phone and tablet. This has the advantage that the phone can post multiple updates and the tablet can pull whenever it has net available.
Direct: Use (tcp) sockets to send commands from the phone to the tablet over the net. If you know that both will be connected to the internet or the same wifi all the time this will be more efficient, and you don't need to write a server.

Related

best way to connect android app with desktop app?

I want to develop a system in which data is being shared between DESKTOP app and Android app.
After searching I have found that I need a server in between them. But I can't figure out what the server is? How do I create it? And how will it help me connect my two platform devices?
Desktop App will receive data from android app. And manage data. It will also be used to send notifications/messages to android apps.
Android App will be used to input data and send it to desktop app. It will receive updates/notifications from desktop app.
Now how do I connect these two? I basically need a common database for real-time data sharing and notifications.
Edit: I am building the desktop app using C# and android app using Java.
Edit2: Maybe I can host the database on CPANEL or 000webhost using PHP. And then connect it with both android and C#. Is this the correct way to do it? Is it possible to connect it with C#? I know it can be connected with Android, not sure about C#.
You don't necessarily need a database. You need a common network protocol between two applications.
All network communication is done via sockets. You need a library that allows you send data over sockets. For example, here's an Android guide that is about sockets.
A socket binds to a specific port of a computer, essentially making it a "server". Much like how web servers all expose port 80, and communicate over a protocol called HTTP. Which is important because it is up to you to decide what protocol your applications communicate between each other, because the socket just sends bytes - it doesn't care what you send or how, as long as it travels to a port on a particular server. It also won't parse the data for you, that's up to your application to handle. For example, how would your desktop app know the Android device sent it a text message, or some image to be displayed, or an address to show a map?
All in all, your reason for wanting a desktop application rather than a web application is not entirely clear. Parsing only the body of HTTP payloads from different HTTP paths that are mapped to different methods (which is typically referred to as a REST API) is much simpler than building your own protocol. You might as well build a desktop GUI over top of a web server.
Making the desktop app send updates back to your mobile application is basically impossible using a bi-directional socket architecture. Your Android should not be running an open server socket continuously just for your application, mostly because battery drain, but because its network address is subject to change frequently, and you therefore additionally need a registration server from which your device would reconnect to. Such a service exists as Firebase Cloud Messaging, which is a rebranding of the GCM technology made by Google, and it can be used to send push notifications to devices, but only with small data payloads.
See here about what activities occur on an Android device for notifications. How does push notification technology work on Android?
Back to the question about databases. Suggesting one to use is too broad. And you only need one of those if you want to store and/or query or join datasets. The same computer running the desktop app can install and run whatever flavor of database you prefer, whether it's a relational database or noSQL database, entirely up to you. The only realtime databases I know of are RethinkDB and Firebase.
You could also just hold a SQLite file which is as good as a small scale database (even the SQLite documentation recommends it for low traffic web sites).
Firebase supports web interface, so you can develop html code and integrate in desktop app, something like web integration in windows form application

Implementation of data flow between devices?

A similar question was asked How to send data from one android device to another?
However their scope of data pass is between android devices.
And so to extend that question, I wanted to know ways of connecting two completely separate devices like ECG device to apps (Android or IOS).
For example, AliveCor allows to send reading of external device to their mobile app.
So what ways do we have apart from Bluetooth or TCP/IP?
You have essentially listed all reasonable means that are used nowadays. You can either transfer data via bluetooth, using your own/3rd party hosted webservices like firebase or direct tcp/ip connection. TCP/IP probably being the hardest, bluetooth being 2nd hardest and webservice being the easiest but yet requiring both devices to be online. The implementation is however totally your responsibility (with web you would either add user registration and sync user data to all signed in devices, or if sync is one time thing, you could upload data to your server, issue a expiring token, which if entered in other device allow it to download that data).
Another way is NFC(Near field communication). You can transmit data when phone(with NFC) is near to another device (with NFC). Also,
For example, AliveCor allows to send reading of external device to their mobile app.
this app use NFC for transmitting data.
From permissions ( google play AliveCor Kardia app)
Also read the information about this system on https://www.alivecor.com/faq/
https://books.google.com.ua/books?id=H-JRAwAAQBAJ&lpg=PA41&ots=EV9Qy61sjY&dq=nfc%20data%20transfer%20ECG&hl=uk&pg=PA41#v=onepage&q=nfc%20data%20transfer%20ECG&f=false

Use MS Access form on a mobile device

I'm going to a robotics competition (FRC) in which we're supposed to "scout" other robots' and see how they perform. My database consists of the number of points they get for each category. I made a form to enter in the data. There are six teams, and I wanted to use six android phones or tablets for data entry.
Is there a way to open the form and enter data in on a mobile device, and then transfer the records to a master computer?
P.S. At the competition we would not have an internet connection, so the only data transfer methods would be USB, Bluetooth, or LAN.
Thanks
EDIT: I figured it out. Instead of using an access form, i'm creating an android app that simply allows you to enter the data in, and export the data as a csv to use in a database. I'll try and make it work.
The easiest way to "run" MS Access application on any iOS, Android or WinCE device is using remote desktop. Enterprise solutions like Citrix would be better. You will need a server in local network, which can support the terminal clients and install on each device RDP terminal client or Citrix client. Access application in fact works on the server, mobile device shows the screen and allows to interact with application.

Mobile device as database server

Is it possible for one mobile device to act as database server for another devices (clients) in the same network. I know there are lot of embedded mobile database like sqllite, couchdb lite, pouch db etc but they are meant to sync with remote server and work as standalone database for a single mobile device. I want to make very lite hybrid offline mobile app which should work without internet but should have facility to share data between two or more device in the same wifi network.
Have you considered multipeer connectivity API? http://nshipster.com/multipeer-connectivity
I have alternative things.
Use Cloud service like Dropbox, Google Drive, And Box.
Make server app that can communication with client app, and you can share your data.

Syncing between a local network and Android application

I am in need of some help here.
I want to make an Android application that eventually syncs to a web server in order to get information (i.e. user can write a note through the website, and it automatically syncs to the phone).
I am aware that I would need some web servers and hosting, and don't know too much about that so I will look into it later.
MY question, however, is how I can simulate this over a local network?
As in, if I create a basic webpage that has a two text boxes (one for name, one for content) and a 'submit' button, if I run it via localhost WHAT methods can I use to get this information to sync to my handset?
If anyone could be kind enough to give me a laymens terms breakdown it would be seriously appreciated, I feel so lost!
You have some alternatives to achieve what you want, here is a traditional one:
Start with installing XAMPP and run a local server
Write your web pages, store the data in mysql
Write PHP code to extract the data from mysql
Use Android HttpClient to call your PHP
There are other alternatives:
Use the same method but instead of PHP write HTML5 and you have a mobile WEB application
Check out the GCM Demo Application
Check out Google App Engine
Check out Amazon Web Services
There are others
Enjoy :)
Yaron
When you use localhost (meaning you install a server package such as Apache / IIS / XAMPP / WAMP in your computer), your machine becomes a server. So, you can access the localhost from any device which is in the same network.
Say you have a computer connected to a WiFi router. If you setup the server i.e. the localhost in that computer and a laptop and a mobile phone is connected to the same WiFi router, the phone and laptop will be able to get service from the computer.
To access data stored in the MySQL server from the other devices (e.g. the phone), you have to write proper service. Else, you can write a mobile web app in the server that accesses the MySQL data and just access it from the device.

Categories

Resources