title: RTMP android aftek
body: <p>I am trying to implement the library from <a href="http://www.aftek.com/afteklab/aftek-RTMP-library.shtml" rel="nofollow">http://www.aftek.com/afteklab/aftek-RTMP-library.shtml</a>
  to stream live video from a red5 server.</p>
  
  <p>On the server i am using the simpleBroadcaster and i want to stream it to the android phone.</p>
  
  <p>my code:</p>
  
  <pre><code>package com.cu.reader;
  
  import java.nio.channels.FileChannel;
  import java.util.Map;
  import com.al.rtmp.client.RtmpClient;
  import com.al.rtmp.client.RtmpStream;
  import com.al.rtmp.client.RtmpStreamFactory;
  import com.al.rtmp.client.data.MetaData;
  import com.al.rtmp.client.data.RTMPData;
  import com.al.rtmp.client.data.VideoCodec;
  import com.al.rtmp.message.Metadata;
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  
  public class StreamreaderActivity extends Activity implements RtmpClient {
       RtmpStream stream = null;
       Boolean connected = false;
   String server = "rtmp://216.224.181.197/oflaDemo/";
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      stream = RtmpStreamFactory.getRtmpStream();
      stream.setClient(this);
      stream.connect(server);
  }
  @Override
  public void streamCreated() {
      Log.i("stream","Connected!");       
  
      connected = true;
      stream.setPlayName("red5StreamDemo");
      stream.play();
  
  }
  @Override
  public byte[] getWriteData(int length) {
      // TODO Auto-generated method stub
      return null;
  }
  @Override
  public void invoke(String arg0, Object... arg1) {
      // TODO Auto-generated method stub
  ;   
  }
  @Override
  public void onDataReceived(RTMPData rtmpData) {
      MetaData metaData = rtmpData.getMetaData();
      VideoCodec vc = metaData.getVideoCodec();
  }
  @Override
  public void onError(Exception ex) {
      Log.e("ClientException", " Some exception occurred." + ex.getMessage());
      ex.printStackTrace();
  }
  @Override
  public void onMetaDataReceived(Map map) {
      Log.i("code","METADATA:" + map);        
  
  }
  @Override
  public void onResult(String method, Object... arg1) {
      Log.i("result","METADATA:" + method);       
  
  }
  @Override
  public void onStatus(String code) {
      Log.i("code",code);     
  }
  
  }
  </code></pre>
  
  <p>i am always receiving  NetStream.Play.StreamNotFound in onStatus function.</p>
  
  <p>Thank you </p>