Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. byte[] data = null;
  2. dataPath = "url";
  3. String dataMsg = "Your video description here.";
  4. Bundle param;
  5.  
  6. URL url;
  7. try {
  8. Log.v("dataPath", dataPath);
  9. url = new URL(dataPath);
  10. HttpURLConnection connection = (HttpURLConnection) url
  11. .openConnection();
  12. connection.setDoInput(true);
  13. connection.connect();
  14. input = connection.getInputStream();
  15. } catch (MalformedURLException e1) {
  16. // TODO Auto-generated catch block
  17. e1.printStackTrace();
  18. } catch (IOException e) {
  19. // TODO Auto-generated catch block
  20. e.printStackTrace();
  21. }
  22.  
  23. // InputStream is = null;
  24. try {
  25. // is = new FileInputStream(dataPath);
  26. data = readBytes(input);
  27. param = new Bundle();
  28. param.putString("message", dataMsg);
  29. // param.putByteArray("video", data);
  30. param.putString("filename", "video");
  31. param.putString("contentType", "video/quicktime");
  32. param.putByteArray("video.mov", data);
  33. mAsyncFbRunner.request("me/videos", param, "POST",
  34. new WallPostListener());
  35. } catch (FileNotFoundException e) {
  36. e.printStackTrace();
  37. } catch (IOException e) {
  38. e.printStackTrace();
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement