1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| int count=2147483647;
try {
URL url = new URL("http://root:root@192.168.1.71:80/axis-cgi/" +"mjpg/video.cgi?resolution=640x480");
Log.i("count","in");
URLConnection conexion = url.openConnection();
Log.i("count","in1");
conexion.connect();
Log.i("count","in2");
File root = android.os.Environment.getExternalStorageDirectory();
Log.i("count","in3");
int lenghtOfFile = conexion.getContentLength();
Log.i("count","in4");
BufferedInputStream input = new BufferedInputStream(url.openStream());
Log.i("count","in5");
OutputStream output = new FileOutputStream("/sdcard/videoenreg" +".3gp");
byte data[] = new byte[1024];
long total = 0;
Log.i("count","in6");
while ((count = input.read(data)) != -1) {
Log.i("count","in7");
total += count;
// output.write(data, 0, count);
//output.write(total);
}
output.flush();
output.close();
input.close(); }
catch (Exception e) {} |
Partager