Doubts related to Android wear development | Beginner - java

I have built a Java Spring Application. This application in the end after doing its work pushes data to a sqlite database.
Now the functionality that i want to add is: Once data is pushed into db, i want to send a custom notification on an app running on android wear. This custom notification should have a message and some options for user to respond to. Finally on seeing the notification on android wear the user should select one of the options and that should be stored in a database.
As i am new to android development, I cannot understand three things:
1. What kind of android application should i develop?
2. How can this android application receive some message or data from some other service (in my case java application)?
3. How to save user response to database?
Some guidance would be really appreciated.
Thanks

I will try to answer all your questions. If your current Java application is a web app, then you will end up building a mobile/wearable app that will communicate to this web app. If your current Java application is not a web app, you will either have to integrate its logic into the mobile/wearable app directly or turn it into a web app so it can communicate with the mobile/wearable app.
You will end up developing two Android apps, essentially. A mobile app for the mobile device and a wearable app that will communicate with the mobile app. This can all be done in Android Studio and in one project though, so it will basically be one application at the end of the day.
Like I mentioned above, you will have to either integrate that existing application's logic directly into your new Android mobile app, or turn your Spring app into a web app and host it on a server that your Android mobile app can call out to to get data.
Android has the concept of local databases and can actually use SQLite on the device. This is most likely how you would store the response from your service.

Related

Host database using Android phone

Here is the current scenario:
I have two(2) Android phones.
Android Phone 1 as the server phone.
Android Phone 2 as the client phone.
Here is what I want to do:
I want to create an Android-based app (E.g. Student Information app) where it will have basically two (2) modes:
Server - for adding, editing and deleting data on a local database.
Client - for viewing data from the database of the server.
The app will be installed to Android Phone 1 and set to Server mode.
The app will be installed to Android Phone 2 and set to Client mode.
I want to ask these questions:
I want to locally host the database of the Server app, so that Client app will be able to view the data. Is this possible?
If yes, how can I do it?
Note:
I am currently a web developer so I know that connected on the same network is a requirement.
I have implemented the same concept on a medium business where the web-based system is locally hosted so that computers on the same network can access it.
Suggest everything that you want to suggest, except the disadvantage of doing this concept. I am aware of some obvious disadvantages based from my research and willing to face the disadvantages provided that I will be able to implement the concept.
Rooting the phones is an option.
I want to accommodate small-sized business that is why I want to use Android phones rather than using Desktop Computers/Laptop.
I have read similar suggested questions here based on my title.
We have done the exact same thing in my company. The way we solved this is that the server exposes a service using the Android NSD API, so the clients (using the same API) can find it on the network. And after a client has connected to the server, the server sends its database file (yes, the .db file in /data/data/...) to the client via OutputStream. When the client receives the entire database and checks for its integrity, it copies it to its own /data/data/... and restarts part of the app.
Android NSD

Out of the box sync service for mobile app

amazon-cognito
I have a mobile app that collects a lot of medical data from the user and every ~30 minutes needs to send the new data to the server.
I need 2 things:
1- Sync between the server and the app the data. If a user login from another mobile device he should get all of his past data and have full picture of his history.
2- the data that is being sync with the server should be store also on data base that I can query for analytics purposes.
What do you suppose to be the architecture ? What technologies do you recomend for that? I thought to use aws Cognito with Redshift but it is limited to 20 MB for each user.
My main question is there any out of the box sync service that i can copy it also for my BI DB like Redshift?
You should try the AWS Mobile Hub site. It will produce a sample app with the functionality you are talking about. You then click to download that sample app.
It will produce an IOS app in Objective-c or Swift, or an Android app (in java?).
It will sync up to 1M per user using Cognito Sync, but the app can also provide access to files through S3 or database through DynamoDB.

java desktop app invoking webservice on android app

I'm developing java desktop application that communicates with MySQL database via JDBC.
I want to develop an android application that will use Web services to access data in the same database.
Is there a way to tell android app from my desktop app when to invoke web service (I want all changes that i have committed from desktop app on database to show in android app)?
Which is the best way to implement this?
Is it possible to send parameters from desktop to android via socket and then in socket thread in android app to invoke web service? Is this good approach?
the best way to do this is with an SOA approach. use a j2ee container, and expose your services by web services. then android can directly use those over http.
alternatively, you can use jdbc in android just as you use jdbc in the desktop application.
You can use Google Cloud Messaging. GCM is perfect for doing this type of data syncing. To achieve that you can do the following
Register your android app with the GCM server and save the ID in your database.
Send a push notification from your desktop app or web service to your android app by taking the ID from your database at the time of update.
Simply invoke the web service in your android app when you get the message from GCM server.
Here is an implementation of GCM server & client.

What are the prerequisites for using Google App Engine with Android?

I am new to Android Application Development and know all the stuff, which is required to build an Application which can use the local resources (databases and all that stuff). I want to build an Application, which will interact with the Application server. And I chose Google App Engine as my Application server. As I am slightly new to this topic, I just want to know, what are the prerequisites for doing both client and server side programming.
I would require to store some data on Google App Engine and interact with the apps with reference to the same.
P.S. I have chosen Java as my language with Google App Engine.
I don't think that there is any prerequisites for using android with google app engine.
Google App Engine is a PAAS, u can write the server side and it should work irrespective of Android, iPhone or any other device. For data transfer you can use XML or JSON format, see this if u are interested in creating REST services.Create and Deploy a JAX-RS REST service on Google App Engine
For data transfer from server to android device, u can use Google Cloud Messaging Google Cloud Messaging for Android

Turning web app to Android app

I have an online store (like PC WORLD) and I want to create a Android app of this store, too.
The back-end of this online store is written by PHP & MySQL Database. So all of the data is stored in MySQL Database.
So what is the best way to retrieve information from remote MySQL server to my Android app?
Best regards,
Julius
Create a web service or some sort of API for your site.
Have you thought about using your current web site and just creating a web view app? In other words just creating a web browser window minus the address bar, and other controls? You could create one custom webpage then all you would be doing in the native app language is the browser window.
To retrive data from mysql the best way is create your web as android app or simply convert this web application to an android app by using www.web2apk.com.
This site will create an apk file of your web application. So you dont need to make any new database for android it will automatically retrive from same database.
You dont need to include any service for that.

Categories