Thaddeus Aid
Thaddeus Aid

Reputation: 169

image processing between Java and Android

I have a problem where I have a program that takes an image file as input on a Java desktop program, processes it and now I need to send this image from the Java application to an Android handset.

In Java I have it stored as either a ImageIcon or BufferedImage and I need to turn it into an Android Drawable, preferably without sending the file back to disk.

I am using the latest in Java and Android 1.6

Currently using a RESTful webserver sitting between the Java Desktop application and the Android handset to assist communications.

Upvotes: 1

Views: 605

Answers (1)

Pedro Loureiro
Pedro Loureiro

Reputation: 11514

I think you'll have to create a web server to send the file to the device.

You don't need a full-fledge server. Listening localhost in some specific port that you may choose should be enough.

Then, you'd open the device and open your application (or simply the browser if you only want to dowload/view the image) and open the address of your server.

The simplest version would be creating a server in your computer (localhost), for instance using port 5555 and then go to the browser and open a page with the ip address/port of your computer.

Here is a tutorial on listening to a local port with java

Upvotes: 1

Related Questions