Ask Your Question

QASIMQADRI's profile - activity

2020-07-21 10:36:30 -0600 received badge  Popular Question (source)
2013-10-14 12:21:04 -0600 commented question Android Socket Programming recieve images from client

if this not relate can u braking up by answering this question related to openCV http://answers.opencv.org/question/21896/opencv-andriod-error-after-import-libraray/

2013-10-13 13:39:46 -0600 asked a question Android Socket Programming recieve images from client

client that is connected to the image source (camera) sends the frames to the server(serializes the frame and then sends it)

i have done server code and get stream images c# here is code.but my task to perform in android...

TcpListener listener = new TcpListener(IPAddress.Any, 8080); listener.Start(); backgroundWorker1.RunWorkerAsync(); private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { try { using (TcpClient client = listener.AcceptTcpClient()) {

            IFormatter formatter = new BinaryFormatter();

            while (true)
            {

                Bitmap bitmap = (Bitmap)formatter.Deserialize(client.GetStream());
                PictureBox1.Image = bitmap;
                Thread.Sleep(1);
            }
        }
    }
    catch (Exception EX)
    {
        MessageBox.Show(EX.Message);
    }
}
}

my android code is but this code does not working..pls help me to fix my android code..i run app in my mobile nothing happen..here android code:-

Socket socket; Bitmap imgview; ImageView imageLoad; InetAddress serverAddr; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new Thread(new ClientThread()).start(); imageLoad=(ImageView)findViewById(R.id.image123); try { serverAddr = InetAddress.getByName("192.168.0.101"); } catch (UnknownHostException e) { // TODO Auto-generated catch block e.printStackTrace(); }

} class ClientThread implements Runnable {

    @Override

    public void run() {




        try {
            socket = new Socket(serverAddr, 8080);

            ObjectInputStream  dis=new ObjectInputStream(socket.getInputStream());

            int bytesRead;
            byte[] pic = new byte[352*256];
            bytesRead = dis.read(pic, 0, pic.length);
            imgview= BitmapFactory.decodeByteArray(pic, 0, bytesRead);              

            imageLoad.setImageBitmap(imgview);
            imageLoad.invalidate();


        }
        catch(Exception e) { 
            Log.e("TCP", "S: Error", e); 
        } 

        finally { 
            try {
                socket.close();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } 
        }            
    }

}

activity main code

please help me to fix my android code.i remian thankful to you forever

2013-10-03 15:14:12 -0600 asked a question opencv andriod error after import libraray

image description

when i include opencv library..i get alots errors as show below image..even i try Open Project Properties -> C/C++ Build, and replace “Build command” text to "${NDKROOT}/ndk-build" (remove .cmd at the end). but still same error Program ".ndk-build not found path..

pls help me to fix all errors as shown below image