I am unable to figure out what is the best way to achieve a scenario like this:
Working on a project that would have android application as client.
User will take their device with the android application installed to field/visit and capture/punch/key data through out the day. This data would be stored locally on the device in SQLite database.
The data captured in SQLite needs to be exported out and imported into the desktop app (it could be java or .net based) for further processing.
Other points:
A. User could connect the phone via usb to desktop.
B. data flow would always be in one direction (i.e. Phone to Desktop).
C. No internet connection on the phone
My dilemma is how to access the sqllite database programmatically in desktop application? Are there any JDBC drivers that could read data from the sqlite database from a device connected via USB to the computer?
This is just a way to do what you want, there are more ways to do it but from my point of view is the most accurate and scalable.
You would have to make a webservices server on Java, PHP, etc ... with a database MySQL, MongoDB, etc ... and so the mobile device is synchronized with the database that was the cloud.
Thus after a desktop client would connect to the webservice to bring the data in order to process it on your desktop client.
EDIT:
You can view this post's
send-data-from-android-to-pc-via-usb
transferring-data-usb
bi-directional-data-transfer-through-usb-between-an-android-device-and-a-pc-mac
Related
Just like what I mentioned from the question.
My watch is LG Urban, when I was developing my android app, I can use the mysql connector to connect with my DB server. Can I use the same to make my Android wear connect to mysql?
Thank you!
Starting with Android Wear 2, proxying data requests through the phone has been replaced by direct network access from the watch. So going forward, your existing code to connect to a MySQL server should work essentially unchanged on the watch.
More details here: https://developer.android.com/training/wearables/data-layer/network-access.html
A couple of caveats:
Wear 2 is only now rolling out to the majority of devices (your Urbane probably doesn't have it yet, for example).
You should try to minimize the data being transferred to/from the watch; these devices have enough issues with battery life as it is.
You can talk to the DB via the phone. You can send messages back and forth and also sync data to the wearable.
You could therefore - indirectly - get whatever data you want from the DB and display it on the watch. You could also get sensor data from the watch and save it back to the DB.
https://developer.android.com/training/wearables/data-layer/index.html
shared SQLite db on windows with android applications
I want write application android that install on some device android
I want Center Database for all of application install
I want shared one SQLite db on windows with my Application
I use Web Service but i want use connect to db with IP or (local network) or other way
thank you
I don' think you will be able to connect to remote SQLite database via socket (IP) connection from Android. Mobile data connections are not so reliable as LAN or WiFi on notebooks/PCs.
I think webService is the best solution for you. All your clients (Android apps, Windows apps) should connect to this webService.
Difference is that webService call it's just short connection (connect, send request, receive response, close connection), while database connection need to be persisted in time and can be interrupted, which may cause in inconsistent data or broken transactions.
EDIT: Other way is to use some MBasS (Mobile Backend as a Service). For example Parse.com. It could be your database and the provide their own REST API to access it.
I'm looking to program a network application. I was going through: http://www.stanford.edu/class/ee368/Android/Tutorial-3-Server-Client-Communication-for-Android.pdf which talk about server and client programming for android. Now imagine I don't have an internet connection and I want both server and client applications run on either same android device or different android devices locally.
Is it possible to develop and run both server and client applications using TCPIP/UDP/Multicast locally on either standalone android device or multiple android device?
Yes, it is possible to communicate between Android devices or applications that are not connected to the Internet.
If you are using different devices, you probably want to use sockets, but it is possible to run an HTTP server on the server device and then use HTTP. Make sure they are connected to the same wifi network.
There are several different ways to communicate between different processes on the same Android device. The easiest might be to use a Messenger service but sockets and HTTP are also possible here.
Yes, it is possible in some manner.You can either use sqlite database present in android device to store various types of data in table form and data retreive from same.
Another way is to use Parse cloud as a server or backend of your client application.It allows your app to run even when you are not connected to internet.It stores the data in cache memory with its api and then uploads data to the server cloud as soon as you get connected to Intenet.
You can ask if you have any further queries. :)
It may sound as if I am rambling (which I am anyways)
So I am thinking to create an android app which basically query my server to fetch some data based on user criterions and display it to the user (think of Yelp for example). User can push data also to the server (like ratings, comments etc.)
I want:
I want the app to be available in offline mode also (i.e. no network connection)
I can do it because:
Server side data will not be refreshed that frequently so no point in redirecting every request to network. For client updates however, (like when users gives a rating) I am not sure what to do. Should I immediately send it to the server or persist it in my local datastore and send it in periodic fashion?
How I am thinking of doing it (this is where I am confused)
Thinking of using phone storage to store data in SqlLite database?
How can I sync local db with cloud datastore? So that whenever connects to network or after a certain timeout period both client and server are in sync?
What should I use for cloud storage? How about Google App Engine?
How do people generally approach it? Looks to me common questions.
1. Thinking of using phone storage to store data in SqlLite database?
You can do just that, but i advice you read up on the other solutions plus the pros and cons about storage in Android here
2. How can I sync local db with cloud datastore? So that whenever connects to network or after a certain timeout period both client and server are in sync?
You can store the offline db (sqlite) data on a file and then upload (more like "backup") to a server (which can be Google App Engine) when you get Internet connection.Read more on this here
3. What should I use for cloud storage? How about Google App Engine?
Google App Engine is perfect for your backend server. this is the official documentation.You can also find tutorials on creating a Google App Engine connected Android app here
i am testing some scenarios here. I have a simple login application with a backend mySQL Database on my windows laptop. It is working fine. I am using JDBC-ODBC Driver for connectivity.
I was thinking that is it possible that my java swing application can communicate with my same application on a second connected computer through wifi or LAN.
I want something like a central sort of database on one system and other connected system should use this central database.
I seriously don't know how to achieve this. On a single system this is very easy but how to achieve this with multiple systems is totally another thing
Scenario ->
Database on PC1
Java Swing Application on PC2 - When trying to Login , data should
come from the database on PC1