Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I am trying to connect with a Biometric Fingerprint Attendance Device using a Java Program (actually I am newbie in that!). The device I am using is a Biocom Fingerprint attendance system. However, I am search and reading about that and I see the SDK could used which based on device type (which hard, not logical, moreover, it is not global solution!)

I research for a global standard on how to connect, send and retrieve data with a Fingerprint Device which again I wasn't lucky enough to find a clear solution. Currently, I tried to connect with the device by creating a Socket Object (through Ethernet port) but also not executed with me! This open infinity loop problems on my head!

In sum please:

Is there any general, standard way to connect, send and retrieve data from such device using Java?
Is a Socket can consider as a solution for such problem?
If yes please, what is the wrong in my code below, what additional things needed more than the host ip and port number to connect with Device?

The Socket code that used:
Java
public class Requester {
Socket requestSocket;
ObjectOutputStream out;
ObjectInputStream in;
String message;

Requester() {
}

void run() throws IOException {
    try {
        // 1. creating a socket to connect to the server
        requestSocket = new Socket("192.168.0.19", 4370);
        System.out.println("Connected to given host in port 4370");
        // 2. get Input and Output streams
        in = new ObjectInputStream(requestSocket.getInputStream());
        // 3: Communicating with the server
        String line;
        while (true) {
            line = in.readLine();
            if (line != null) {
                System.out.println(line);
            }
        }
    } catch (UnknownHostException unknownHost) {
        System.err.println("You are trying to connect to an unknown host!");

    } catch (IOException ioException) {
        ioException.printStackTrace();

    } catch (Exception Exception) {
        Exception.printStackTrace();

    } finally {
        in.close();
        requestSocket.close();
    }
}

void sendMessage(String msg) {
    try {
        out.writeObject(msg);
        out.flush();
        System.out.println("client: " + msg);

    } catch (IOException ioException) {
        ioException.printStackTrace();
    }
}

public static void main(String args[]) throws IOException {
    Requester client = new Requester();
    client.run();
}
}



Sorry for this long question. BUT any Hint will be appreciated!
Posted

1 solution

Please do not post the same question in multiple forums. I already responded to this in the Java forum.
 
Share this answer
 
Comments
Maheera Jazi 4-Jun-14 4:26am    
I ask the same question in the same form BUT in different places Please! in the hope of get useful answer :( (it is really depressed me) I am suck for along of time with no progress!
Richard MacCutchan 4-Jun-14 4:35am    
Please don't, it is duplicating effort and diverting resources from other people who do follow the posting rules.
MarioFerns16 2-Oct-17 9:25am    
@Richard MacCutchan I have a similar requirement but I haven't been able to locate your answer even after using the search functionality. I request you to send a link to the answer or forum for the same. Many thanks in advance. Much appreciated!
Richard MacCutchan 2-Oct-17 9:29am    
The answer will not be much use (read the documentation), but here is the link: Re: Handling Biometric Fingerprint Attendance Machine - Java Discussion Boards[^].
Maheera Jazi 4-Jun-14 4:36am    
ok, sorry for that! in future I will never do that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900