Sending data from desktop app to web app - java

I have been looking for an answer since an long time now and i gte answer that i Should use RestApi or i should try it with this and that code but now i want to aks what is the easiest and securest way to send data from and desktop app to an web app and then get the web apps respond and giving it back to the desktop app. I used the direct way with hardcoding the passwords and all the database things so the desktop app will directly connect to the Database but that isn't secure at all. If you could provide me with a link or with the code i would help me more then just giving hints and playing hide and seek with me :)
Thanks in advance

You could use Web Services like , RESTful or WSDL. I think you could start it from WSDL. Othewise you could use encryption methods your own.
Please refer following links to get some idea
Web Service Introduction
https://docs.oracle.com/cd/E19509-01/821-0236/ghyto/index.html

Related

Spring webapp: sending notifications to java and android clients

I recently started developing my first web application with Spring and I'm stuck with a question I could not really find an answer to. What I have is a simple Spring MVC application running in tomcat which provides data in form of JSON, XML or binary via REST. This service is consumed by two clients I developed, a simple Java desktop application and an Android app. So far the clients only got information about new data by polling.
What I want now, is a way for the server to send notifications/messages to the clients when new data is available. For the Android client it would be good if the notifications could received anytime, not only when the app is currently open of course. I found lots of information for JavaScript client code but very little really useful, up-to date input about what the options for java and android clients are.
It would be really great if someone could give me some idea what would be the best way to achieve what I want (ideally something which integrates well with Spring on the server side), what protocols/libraries/frameworks to use, maybe even point me to some example or tutorial, how to implement this on server and client side.
Thanks in advance for any input.
For android or mobile devices, Google Cloud Messaging is the preferred way of sending messages to applications running on devices.
Example : spring gcm server side project and a sample tutorial.
For desktop apps, either poll regularly the server or run something in background like crontab or active-mq to check the messages and start the desktop app.
WebSockets are the best solution. check the implementation in java in the server side

Android mobile application to capture data from form and input into a MySQL database LAMP

I'am new to Android app development. I want to create a mobile application that has two entry fields.
i.e:
FirstName and
LastName
and will input into MySQL database.
Is there a basic source code example available to achieve something like this? how would i create something like this?
Thanks for your help guys.
Android access to remote SQL database will explain to you why you dont want to connect a android device directly to a SQL server of any kind. It is a bad idea.
Go do some research on how to create either a SOAP or REST service and how to consume them in Android. Here is a article on REST and here is a article on SOAP.
Once you can create web services either SOAP or REST then any device can use your service not just android.
There is some great way to generate web services for this example by using Netbeans and Eclipse. Here is a great Netbeans tutorial to get you started.

Android & my PostgreSQL database advice

I apologise for the very general question but I'm looking for some advice. I have two products that I have created for a project. An android app and a website service. I want the android app to be able to connect to a PostgreSQL database in order to authenticate user login and submit a small amount of data.
The data on the PostgreSQL database will then be produced on the website. Simples!
I'm wondering if there are some tutorials or discussions that provide a simple solution to this. I've looked at loads of forums which mention using a lot of complicated protocols, frameworks, etc.
I'm just looking for some nice efficient android examples on how to achieve this.
Any advice would be appreciated.
You should not worry about android and PostgreSQL communication because they won't communicate directly.
All what you need is a simple HTTP communication between your android and the web service to send and receive information (e.g. credential for authentication)
Your web service should take care of storing and retrieving data from the database

GAE as service provider for Desktop App (Swing)

I'm new to Google App Engine.
I know the Cloud concept and I know a bit about the API and Storage of GAE.
Problem:
One Desktop application (Java, Swing) needs some services. These services should be given to the app via HTTP/HTTPS.
For example the app sends some parameters and receive a result (String(s)).
Is GAE good for providing the services to the App?
If so, What is the best point to start?
Thanks in advance
Maybe you could create a web service and put it on GAE. So that could be way how to use it from your Swing app.
There is no reason why this approach shouldn't work.

Communication between a desktop app and a web app?

I'm interested in having a desktop application send messages to a web app. Specifically, the desktop app, written in Java, needs to send messages to a Javascript function that will be running in a browser. The messages only need to be sent one way. Also, both programs will be running on the same local machine. I can set up a local development server if necessary.
I'm new to networking and web development and I have no idea how to approach this problem. Can anyone offer any suggestions?
I think the appropriate way to do that (if not the only way) would be to go through a server both apps talks to
The enterprise architecture way I recommend you do is:
Put the common information into a webservice.
The website sends information, possibly via ajax or by navigating to a different URL or doing a form POST to the webservice.
The desktop app will start up and will subscribe to the webservice. The webservice will notify the desktop app once it has an update. (note that the desktop app, might need to poll for updates).
That approach is how services such as flikr, twitter etc use.
The light weight (ie smaller architecture) way of hacking this is to make your website have an RSS feed that your desktop app subscribes to. The desktop app gets updated via the RSS feed.
That approach is how services such as news websites will send updates to readers. See google reader as an example RSS client. RSS has an adavantage of supporting generic rss consumers like MS outlook or google reader from the start, where as webservices are likely to be more flexible and cleaner in the long run.
why does the desktop app need to talk to javascript? What is it you are actually trying to do? Send or receive data to or from a database? Run some business logic on the web app? These things are typically done from a desktop app to a website using soap or rest.
is the browser embedded somehow in the desktop app? Or could is it just running as a separate process? It seems like audio processing should really run in the desktop app.
However, assuming that the browser is running as a separate app, you should be able to send messages to the browser through the query string. The desktop app could fire up the browser, point it to a url and pass some parameters to it. THen javascript can process those parameters. Google whether jquery can process query string parameters.
Embed a simple container like jetty then use Jersey or a Simple Servlet

Categories

Resources