waleedAhmad1 / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

Connection Glass-Arduino #463

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to connect my Glass with Arduino and a Wifi Shield.  

At MenuActivity.java I call :

 protected void onCreate(Bundle savedInstanceState) 
    {
        new ConnexioArduino().execute();
        super.onCreate(savedInstanceState);
    }

And my ConnexioArduino :

private boolean socketReady;
    private BufferedWriter outA;
    private BufferedReader inA;
    private Socket mySocket;
....
.... 
@Override
    protected Void doInBackground(Void... params) {

        socketReady = true;         
        String Host = "192.168.43.177";
        int Port = 10001; 
        outA = null;
        inA = null;
        mySocket = null;

        try {
            mySocket = new Socket(Host, Port);
        } catch (UnknownHostException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        try {
            mySocket.close();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }

So it only does a connexion between Glass-Arduino Wifi Shield through Socket. 
But when I execute my app it stops and it gives me the following error (see 
file attached).

Any help?

Original issue reported on code.google.com by gmarc.ex...@gmail.com on 9 Apr 2014 at 12:26

Attachments:

GoogleCodeExporter commented 9 years ago
Hi There, 

I am busy with a project where I have to use google glass and arduino wifi 
shield much the same as you had to do. I am not at all an expert with android 
coding, but rather a mecahtronic engineering student. 

Have you managed to figure out what the problem was? And if so, would it be 
possible to see your source code. 

Thank you for your help!

Original comment by josuab...@gmail.com on 25 Jun 2015 at 10:44