Is there any way allows my Android wear connect to MYSQL - java

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

Related

How to handle Android to MySQL updates when smartphone is offline

I am currently working on a forum-like Android app which interacts with a MySQL database through JSON and PHP scripts. On certain occasions, the app has to send updates to the database, e.g. when a post to the forum is made or updated.
My question considers the situation that the smartphone is offline, i.e. doesn't have a internet connection thus cannot connect to the server, and tries to post something to the forum. However, due to the offline status, it cannot interact with the database immediately. In this situation we want to handle the messages in such a way that the post is sent to the database on the next instnce when the device connects to the internet.
What exactly has to be done on the app side to achieve that?
I guess the post has to be buffered in some directory locally and the app has to check the internet connection constantly. Does anybody know how to do that? Does JAVA provide certain functions for doing this?
Thanks in advance!

Firebase Java SDK offline

How to use Firebase java SDK (To Desktop applications) offline? Is possible? I need this function to use software desktop offline and sincronization with Android using Firebase.
The Firebase Java SDK will handle intermittent connectivity loss. It will simply keep the data it's already received in memory and will queue any local modifications in memory until it has a connection to the server again.
This data will be lost when the user restarts of the application. There is an option to persist the data to disk, but that is only available for iOS and Android.

Android SQLite and Desktop Sync

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

Is it Possible to run both Server and Client android applications Locally?

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. :)

Android strategy to store data

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

Categories

Resources