title: Android live streaming of TV before Android 2.1
body: <p>I am developing app in which I have to implement live TV streaming.  My Google search has lead me to believe that live streaming is not possible till 2.1 Android.</p>
  
  <p>Is it right?</p>
  
  <p>As I get code of streaming music of mediaplayer and I can use type of it by setting below method:</p>
  
  <p><code>mp.setAudioStreamType(2)</code>;</p>
  
  <p>But i want to know is it sufficient for streaming just code like that and save file like below method:</p>
  
  <pre><code>private void setDataSource(String path) throws IOException {
          if (!URLUtil.isNetworkUrl(path)) {
              mp.setDataSource(path);
          } else {
              Log.i("enter the setdata","enter the setdata");
              URL url = new URL(path);
              URLConnection cn = url.openConnection();
              cn.connect();
              InputStream stream = cn.getInputStream();
              if (stream == null)
                  throw new RuntimeException("stream is null");
              File temp = File.createTempFile("mediaplayertmp", "dat");
              String tempPath = temp.getAbsolutePath();
              FileOutputStream out = new FileOutputStream(temp);
              byte buf[] = new byte[128];
              do {
                  int numread = stream.read(buf);
                  if (numread &lt;= 0)
                      break;
                  out.write(buf, 0, numread);
              } while (true);
              mp.setDataSource(tempPath);
  
              try {
                  stream.close();
                  Log.i("exit the setdata","exit the setdata");
              }
              catch (IOException ex) {
                  Log.e(TAG, "error: " + ex.getMessage(), ex);
              }
          }
      }
  </code></pre>
  
  <p>Is there any extra stuff needed for live TV streaming? </p>