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!

Chinmay Dabke
  • 5,070
  • 11
  • 40
  • 63
  • 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? – Laurentiu L. Jun 03 '15 at 09: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. – Chinmay Dabke Jun 03 '15 at 09:52
  • Make API calls on pc side and use them to send data in form of JSON. – Rajat Mehra Jun 03 '15 at 09:56

1 Answers1

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

Community
  • 1
  • 1
Laurentiu L.
  • 6,566
  • 1
  • 34
  • 60