0

I'm pretty new to Android so apologies if I've missed an obvious solution. I'm writing a system that includes an android app and a Java Swing program. I want to know if there is a way to pass data (eg. Strings, integers) from the Java Swing program to the Android app and receive data back directly.

The data won't contain heavy stuff like photos or videos but just simple Strings.

Any help would be appreciated!

3
  • 1
    The android app will be running on the phone i assume and the java app on a pc. Do you want to send the data over the internet? Or usb,bluetooth? Commented Jun 3, 2015 at 9:51
  • @LaurentiuL. Thanks for your quick response! I want to send data over the internet. And yes, the android app will be running on phones and the Java program on a pc. Commented Jun 3, 2015 at 9:52
  • Make API calls on pc side and use them to send data in form of JSON. Commented Jun 3, 2015 at 9:56

1 Answer 1

1

You need a web application in order to expose web services to your android app users.

This answer addresses the first part (java swing webapp). For more complex interactions I recommend using a framework for web development (Spring framework). For least configuration you can use Spring Boot.

The Android app connects to the internet and consumes the web services. Here's a lesson from the android development guides .

Here's an introduction to the concept of webservices. I recommend RESTful Web Services.

A Spring introductory lesson to RESTful web services.

Here's an Introduction to Spring using Swing

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.