php and java in the same web application - java

I have a php webapp that get Facebook posts through API and save them into db. Then I have a java application that read this posts from db, classify them and save classification out into db.
How can I call java application from my php script??
JavaBridge Could be a solution, but are there web hosts that allow to use it ??
Thanks for any suggestion.
P.S.
The Java part is a processes that should be started by the PHP process on demand and stops when its task ended

Related

Where can I deploy my java REST webservice for free so that I can access it remotely?

I have developed a REST web-service in Java interacting with a MySQL database.I want to deploy the web-service and the create a database at a server so that I can invoke it from an application.I tried Microsoft Azure but was unable to get it done.Where can I find relevant information for this?
I had similar problems with a MySQL database using the third party option in the Azure Marketplace from ClearDb. What I ended up doing was switching my database from a MySQL instance to an Azure Database Instance (Subset of SQL Server's features.) This worked perfectly for me! I was able to query from my database feed data to my api, and access the API through my Azure Web App.
I understand this may not be an option for you, however, Digital Ocean is a great cloud hosting option (with scaling similar to Azure, although not as good in my honest opinion.) You can set up a Linux Environment with a MySQL Server and JVM and serve your whole API through there. Best of Luck!
#coderden, According to your description, I think you have been deployed your Java Application on an Azure WebApp. Then when you created a MySQL database on Azure for connection from the Java webapp, please make sure the webapp & mysql instance created in a same resource group and note the connection string of MySQL on Azure.
As reference, please see the article to try again although it's for PHP, the steps are the same for Java.

How to use php mysql with Android for post and get data?

I want to know how to use php MySql with Android application for get and post the data through android application. I know the JSON Parsing as and when creating database in php with JSON format.But here is creating in MySql.So i don't know how to work with.Can someone help me please.
Here is snap shot of PHP MySql Screen .
There is no direct connection between Android and MySql & PHP.
In your screen shot you see phpMyAdmin this is just a UI for MySQL database (there are more).
To achieve your goal you need a server, for example wamp which contains Apache, MySql & PHP.
With PHP and MySql you need to create a web services.
After you create these services you can write an Android application that call these services.
You need to write a webservice which will get the data from your mysql database and send it to your android app.
First of all you need a server (Ex: Wamp). WAMP is acronym for Windows, Apache, MySQL and PHP, Perl, Python. WAMP software is one click installer which creates an environment for developing PHP, MySQL web application. By installing this software you will be installing Apache, MySQL and PHP
Second
Write a php script on your server which can retrieve the required data from the MySQL database. Encode the retrieved data inside a JSON object and send it back to your app.
This tutorial excellently illustrates what you are looking for. Hope it helps.
URL: http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/
Thanks!
To connect to the MySQL database you need to have something like a connector.php and it would be good to use a class for writing, reading, updating and deleting the data.
Then call to JSON.
JSONObject json = jsonParser.makeHttpRequest(url_create_entry, "POST", params);

Connecting Android to live Website for database calls

I am currently developing an android application using eclipse and I already have a website developed in PHP and MySQL, can some one guide me how to connect to my website database through android for exchanging data
The simpliest, but maybe not so elegant way to do it, is writing special php-scripts for the queries, sending http requests from the android-app to these scripts and getting the results as json-arrays.
Check out this: http://www.helloandroid.com/tutorials/connecting-mysql-database
You need a Webservice Written Using REST Protocol or SOAP protocol or SimpleXML....
Using any of the above three links you may communicate throught Mysql DB to interact ur Android App Requests
To connect the Android Application to Webservices below given Two Links could be helpful
Android App Development and Web Server Interactions
interacting with web services and android
UPDATED
Below Link Might be most helpful to you.. chk it
Connection to DB from Android Device

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

flex mobile project : using Blazeds to access data from java class

I know how to create a flex web application that uses blazeds for back end data connectivity.
Now I need to use blazeds in flex mobile application for accessing data from java classes. I am searching it in internet for two days but I didnt find any solutions. Please help me to use blazeds in flex mobile app
On Coenraets blog you have a couple of examples relates to connection mobile flex applications to a java backend (both remoting and messaging).
In order to detect if the file was modified you can have a timer in java checking for that at a specified interval. When detecting any changes you can send a message to your Flex application using the messaging services from BlazeDS.

Categories

Resources