|
![](/images/resource/spacer.gif) |
|
Android การบันทึก Video Streaming ต้องทำยังไงต้องรับไฟล์เข้ามาแปลงก่อนไหม |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ลองดูตัวอย่างนี้ครับ การ Save ไฟล์ครับ
Code (Android-Java)
URL url = new URL(from);
URLConnection conexion = url.openConnection();
conexion.connect();
int lenghtOfFile = conexion.getContentLength(); // Size of file
InputStream input = new BufferedInputStream(url.openStream());
String fileName = from.substring(from.lastIndexOf('/')+1, from.length());
OutputStream output = new FileOutputStream(path+fileName); // save to parh sd card
byte data[] = new byte[1024];
while ((count = input.read(data)) != -1) {
output.write(data, 0, count);
}
output.flush();
output.close();
input.close();
Android Download Save file from Server
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2013-05-30 17:48:08 |
By :
mr.win |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 02
|