0

I need to send an object from a java application that runs on my laptop to an Android device via Bluetooth. The class is the following:

public class Contact {
    private static int counter = 0;
    private int id;
    private String firstName;
    private String lastName;
    private String email;

    public Contact(String firstName, String lastName, String email) {
        this.id = ++counter;
        this.firstName = firstName;
        this.lastName = lastName;
        this.email = email;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public String getEmail() {
        return email;
    }
}

I have no idea what library or API to use in order to send data. I think that, first, I have to pair both devices, but I have no idea how to do it neither. After pairing I think that I should have a listener in my Android application that is executed when data has been received, shouldn't I?

I hope you can help me because I totally stuck.

Thanks in advance.

lmiguelvargasf
  • 63,191
  • 45
  • 217
  • 228

1 Answers1

1

If you want to send data from a laptop with a running java application to an android device check this question please. Also, I would recommend use a backend framework to share data between an android app through a web service.

Community
  • 1
  • 1
Alberto Alegria
  • 1,023
  • 10
  • 26
  • Thank you @Alberto. I will strongly consider using web services instead of this method because painfully I haven't been able to solve using Bluetooth. – lmiguelvargasf Jun 21 '16 at 14:14