<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Pocket Journey</title>
	<atom:link href="http://blog.pocketjourney.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pocketjourney.com</link>
	<description>Know Anywhere</description>
	<lastBuildDate>Wed, 10 Mar 2010 16:16:39 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Android Tutorial 2: &#8220;Hit&#8221; testing on a View (MapView) by Biosopher</title>
		<link>http://blog.pocketjourney.com/2008/03/19/tutorial-2-mapview-google-map-hit-testing-for-display-of-popup-windows/#comment-574</link>
		<dc:creator>Biosopher</dc:creator>
		<pubDate>Wed, 10 Mar 2010 16:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=8#comment-574</guid>
		<description>Hi Andrew,

You should use this:

MapLocationViewer mlv = (MapLocationViewer)this.findViewById(R.id.map_location_viewer); 
MapView mp = mlv.getMapView();</description>
		<content:encoded><![CDATA[<p>Hi Andrew,</p>
<p>You should use this:</p>
<p>MapLocationViewer mlv = (MapLocationViewer)this.findViewById(R.id.map_location_viewer);<br />
MapView mp = mlv.getMapView();</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Tutorial 2: &#8220;Hit&#8221; testing on a View (MapView) by Andrew</title>
		<link>http://blog.pocketjourney.com/2008/03/19/tutorial-2-mapview-google-map-hit-testing-for-display-of-popup-windows/#comment-573</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 10 Mar 2010 06:44:04 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=8#comment-573</guid>
		<description>Your tutorial is amazing. Thanks a lot! I just have one question though.

I noticed you have a getter for the mapview in your MapLocationViewer which looks to be a java layout. Is there a way to call that getter? I&#039;ve tried using 

mv = (MapView)this.findViewById(R.id.map_location_viewer); 

in the MapActivity class but since MapLocationViewer is a linear layout, it throws an error because it&#039;s not a MapView. I mainly wanted to get the MapView so I can move to the user&#039;s current gps location. Thanks!</description>
		<content:encoded><![CDATA[<p>Your tutorial is amazing. Thanks a lot! I just have one question though.</p>
<p>I noticed you have a getter for the mapview in your MapLocationViewer which looks to be a java layout. Is there a way to call that getter? I&#8217;ve tried using </p>
<p>mv = (MapView)this.findViewById(R.id.map_location_viewer); </p>
<p>in the MapActivity class but since MapLocationViewer is a linear layout, it throws an error because it&#8217;s not a MapView. I mainly wanted to get the MapView so I can move to the user&#8217;s current gps location. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Tutorial 3: Custom Audio Streaming with MediaPlayer by vinod</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-571</link>
		<dc:creator>vinod</dc:creator>
		<pubDate>Fri, 05 Mar 2010 10:08:28 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-571</guid>
		<description>and you must  interrupt to buffer loading</description>
		<content:encoded><![CDATA[<p>and you must  interrupt to buffer loading</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Tutorial 3: Custom Audio Streaming with MediaPlayer by vinod</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-570</link>
		<dc:creator>vinod</dc:creator>
		<pubDate>Fri, 05 Mar 2010 10:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-570</guid>
		<description>HI 
kavitha 

you will try  mp.reset();</description>
		<content:encoded><![CDATA[<p>HI<br />
kavitha </p>
<p>you will try  mp.reset();</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Streaming MediaPlayer Tutorial &#8211; Updated to v1.5 (Cupcake) by Biosopher</title>
		<link>http://blog.pocketjourney.com/2009/12/27/android-streaming-mediaplayer-tutorial-updated-to-v1-5-cupcake/#comment-569</link>
		<dc:creator>Biosopher</dc:creator>
		<pubDate>Wed, 03 Mar 2010 16:37:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pocketjourney.com/?p=68#comment-569</guid>
		<description>Hi Tiger,

This tutorial only supports single files downloads so you must have updated it to support multiple files.  Look at how you&#039;re handling the handoff between files.  Seems like you are still writing to a file even though no data is being recieved.  

You should only be writing to file what you read from the stream.  

int numread = stream.read(buf);
...
out.write(buf, 0, numread);

Cheers,
Anthony</description>
		<content:encoded><![CDATA[<p>Hi Tiger,</p>
<p>This tutorial only supports single files downloads so you must have updated it to support multiple files.  Look at how you&#8217;re handling the handoff between files.  Seems like you are still writing to a file even though no data is being recieved.  </p>
<p>You should only be writing to file what you read from the stream.  </p>
<p>int numread = stream.read(buf);<br />
&#8230;<br />
out.write(buf, 0, numread);</p>
<p>Cheers,<br />
Anthony</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Streaming MediaPlayer Tutorial &#8211; Updated to v1.5 (Cupcake) by Tiger</title>
		<link>http://blog.pocketjourney.com/2009/12/27/android-streaming-mediaplayer-tutorial-updated-to-v1-5-cupcake/#comment-568</link>
		<dc:creator>Tiger</dc:creator>
		<pubDate>Wed, 03 Mar 2010 09:00:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pocketjourney.com/?p=68#comment-568</guid>
		<description>Hi,
first of all sorry for the old reply but here it is :

[quote]Are you saying that once you’ve downloaded the audio files, the final file residing on the device has gaps in the audio? [/quote]
Nope the files themselves were ok, but there is a gap which keeps getting bigger inbetween the stopping of a file and the starting up of the next one... So inbetween &quot;chunks&quot; (files in this case)...
I heard though that ogg would be faster thus completely removing those gaps, only my source is mp3 so is there some way, to your knwoledge, to encode mp3 to ogg in Android itself ?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
first of all sorry for the old reply but here it is :</p>
<p>[quote]Are you saying that once you’ve downloaded the audio files, the final file residing on the device has gaps in the audio? [/quote]<br />
Nope the files themselves were ok, but there is a gap which keeps getting bigger inbetween the stopping of a file and the starting up of the next one&#8230; So inbetween &#8220;chunks&#8221; (files in this case)&#8230;<br />
I heard though that ogg would be faster thus completely removing those gaps, only my source is mp3 so is there some way, to your knwoledge, to encode mp3 to ogg in Android itself ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Tutorial 3: Custom Audio Streaming with MediaPlayer by kavitha</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-567</link>
		<dc:creator>kavitha</dc:creator>
		<pubDate>Wed, 03 Mar 2010 04:45:27 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-567</guid>
		<description>Thanks for the reply catdaaady.

I tried with mp.stop() and mp.release().

Still it is same.

Any other alternatives????

or else do you have any idea of converting audio to PCM and playing from AudioTrack class of Android?</description>
		<content:encoded><![CDATA[<p>Thanks for the reply catdaaady.</p>
<p>I tried with mp.stop() and mp.release().</p>
<p>Still it is same.</p>
<p>Any other alternatives????</p>
<p>or else do you have any idea of converting audio to PCM and playing from AudioTrack class of Android?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Tutorial 3: Custom Audio Streaming with MediaPlayer by CatDaaaady</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-566</link>
		<dc:creator>CatDaaaady</dc:creator>
		<pubDate>Tue, 02 Mar 2010 06:17:53 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-566</guid>
		<description>I am not so sure on that one.
But maybe in your clear() try

mp.stop();
mp.release();

Instead of 
mp.pause();
mp.reset();
mp.release();

It could be the mediaplayer resources are not getting released properly?</description>
		<content:encoded><![CDATA[<p>I am not so sure on that one.<br />
But maybe in your clear() try</p>
<p>mp.stop();<br />
mp.release();</p>
<p>Instead of<br />
mp.pause();<br />
mp.reset();<br />
mp.release();</p>
<p>It could be the mediaplayer resources are not getting released properly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Tutorial 3: Custom Audio Streaming with MediaPlayer by kavitha</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-565</link>
		<dc:creator>kavitha</dc:creator>
		<pubDate>Tue, 02 Mar 2010 04:45:37 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-565</guid>
		<description>Hi CatDaaaady and Biosopher,

Thanks for the replies.
Using catDaaady&#039;s player idea,I am able to play continously an Internet Radio.

But when i change the Internet Radio link url,file is getting downloaded,but i am not able to play once again,,MediaPlayers hang up without even showing error.


I am calling player(File f) from another thread and pause it when user clicks on another url,clear mediaplayers vector in clear() ,,and again start thread when file gets downloaded.

Please tell me the solution.

Here is what I am doing when i change url

public void player(File ff){
		   final File f = ff;
	    final String TAG = &quot;**************************************setupplayer*****:&quot;;
        Log.i(TAG, &quot;File &quot; + f.getAbsolutePath());
      //  Runnable r = new Runnable(){
      //  	public void run(){
       try{
    	   MediaPlayer mp=new MediaPlayer();
        		try{
        			FileInputStream ins = new FileInputStream( f );
                    mp.setDataSource(ins.getFD());
                    mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
                    mp.setOnCompletionListener(playerlistener);
                    if ( ! started  ){
                        mp.prepare();
                    } else {
                        //This will save us a few more seconds
                        mp.prepareAsync();
                    }
                    insertMedia(mp);
                    if ( ! started  ){
                        startMediaPlayer();
                  }
        		}catch(Exception e){
        			 Log.e(TAG, &quot;:ERROR********:&quot;+e.toString());
        			 e.printStackTrace();
        		}
        		
       }catch(Exception e){
    	   System.out.println(&quot;********************ERROR IN PLAYER &quot;+e);
    	   e.printStackTrace();
       }
        //	}
      //  };
     //   new Thread(r).start();
	}
	


MediaPlayer.OnCompletionListener playerlistener = new MediaPlayer.OnCompletionListener () {
		public void onCompletion(MediaPlayer mp){
			onMediaPlayerCompletePlay(mp);
        }
	};
	
	 private void onMediaPlayerCompletePlay(MediaPlayer mp){
		  String TAG = &quot;MediaPlayer.OnCompletionListener&quot;;
         Log.i(TAG, &quot;Current size of mediaplayer list: &quot; + mediaplayers.size() );
      
         MediaPlayer mp2 = getMedia();
         if(mp2 != null)
        	 mp2.start();
         mp.release();
         removefile();
	 }    


public  void insertMedia(MediaPlayer file){
			///add file at last of vector
		try{
			 mediaplayers.add(file);
			available = true;
		}catch(Exception e){
			System.out.println(&quot;EXCEPTION IN INSERTMEDIA&quot;+e);
			e.printStackTrace();
			
		}
		
		 	
	}
		
	 public  MediaPlayer getMedia(){
	try{
		if(mediaplayers.size()&lt;1){
			available=false;
		}
		
		if(!available){
			return null;
		}
		mediaplayers.remove(0);;
		
		if(mediaplayers.size()&lt;1){
			return null;
		}
	}catch(Exception e){
		System.out.println(&quot;EXCEPTION IN GETMEDIA&quot;+e);
		e.printStackTrace();
	}
		return mediaplayers.firstElement();
	}
	 
	 
	 
	   private void removefile (){
    
        String TAG = &quot;removefile ***:&quot;;
     try{
        File temp = new File(context.getCacheDir(),DOWNFILE + playedcounter);
        Log.i(TAG, temp.getAbsolutePath());
        temp.delete();
        synchronized(this){
        	playedcounter++;
        }
     }catch(Exception e){
 		System.out.println(&quot;EXCEPTION IN REMOVEFILE&quot;+e);
 		e.printStackTrace();
 	}
    }
   
    //Start first audio clip
    private void startMediaPlayer() {
        String TAG = &quot;startMediaPlayer***:&quot;;
        try{
        //Grab out first media player
        synchronized(this){
        	 started = true;
        	MediaPlayer mp = mediaplayers.get(0);
        	mp.start();  
        }
        }catch(Exception e){
     		System.out.println(&quot;EXCEPTION IN STARTMEDIAPLAYER&quot;+e);
     		e.printStackTrace();
     	}
       
       
    }
    
    public  void clear(){
    	String TAG = &quot;CLEAR URL STREAMPLAYER***:&quot;;
    
    	try{
    		synchronized(this){
    			playedcounter = 1;
    			started = false;
    	    	 available=false;
    			for(int i=0;i&lt;mediaplayers.size();i++){
    				MediaPlayer mp=mediaplayers.get(i);
    				if(mp != null){
    					if( mp.isPlaying())
    						mp.pause();
    					mp.reset();
    					mp.release();
    				}
    			}
    	
    			mediaplayers.removeAllElements();
    			
    		}
    	
    	}catch(Exception e){
    		 Log.i(TAG, &quot;ERROR CLEARING MEADIA PLAYERS : &quot; + mediaplayers.size() );
    		 e.printStackTrace();
    	}</description>
		<content:encoded><![CDATA[<p>Hi CatDaaaady and Biosopher,</p>
<p>Thanks for the replies.<br />
Using catDaaady&#8217;s player idea,I am able to play continously an Internet Radio.</p>
<p>But when i change the Internet Radio link url,file is getting downloaded,but i am not able to play once again,,MediaPlayers hang up without even showing error.</p>
<p>I am calling player(File f) from another thread and pause it when user clicks on another url,clear mediaplayers vector in clear() ,,and again start thread when file gets downloaded.</p>
<p>Please tell me the solution.</p>
<p>Here is what I am doing when i change url</p>
<p>public void player(File ff){<br />
		   final File f = ff;<br />
	    final String TAG = &#8220;**************************************setupplayer*****:&#8221;;<br />
        Log.i(TAG, &#8220;File &#8221; + f.getAbsolutePath());<br />
      //  Runnable r = new Runnable(){<br />
      //  	public void run(){<br />
       try{<br />
    	   MediaPlayer mp=new MediaPlayer();<br />
        		try{<br />
        			FileInputStream ins = new FileInputStream( f );<br />
                    mp.setDataSource(ins.getFD());<br />
                    mp.setAudioStreamType(AudioManager.STREAM_MUSIC);<br />
                    mp.setOnCompletionListener(playerlistener);<br />
                    if ( ! started  ){<br />
                        mp.prepare();<br />
                    } else {<br />
                        //This will save us a few more seconds<br />
                        mp.prepareAsync();<br />
                    }<br />
                    insertMedia(mp);<br />
                    if ( ! started  ){<br />
                        startMediaPlayer();<br />
                  }<br />
        		}catch(Exception e){<br />
        			 Log.e(TAG, &#8220;:ERROR********:&#8221;+e.toString());<br />
        			 e.printStackTrace();<br />
        		}</p>
<p>       }catch(Exception e){<br />
    	   System.out.println(&#8220;********************ERROR IN PLAYER &#8220;+e);<br />
    	   e.printStackTrace();<br />
       }<br />
        //	}<br />
      //  };<br />
     //   new Thread(r).start();<br />
	}</p>
<p>MediaPlayer.OnCompletionListener playerlistener = new MediaPlayer.OnCompletionListener () {<br />
		public void onCompletion(MediaPlayer mp){<br />
			onMediaPlayerCompletePlay(mp);<br />
        }<br />
	};</p>
<p>	 private void onMediaPlayerCompletePlay(MediaPlayer mp){<br />
		  String TAG = &#8220;MediaPlayer.OnCompletionListener&#8221;;<br />
         Log.i(TAG, &#8220;Current size of mediaplayer list: &#8221; + mediaplayers.size() );</p>
<p>         MediaPlayer mp2 = getMedia();<br />
         if(mp2 != null)<br />
        	 mp2.start();<br />
         mp.release();<br />
         removefile();<br />
	 }    </p>
<p>public  void insertMedia(MediaPlayer file){<br />
			///add file at last of vector<br />
		try{<br />
			 mediaplayers.add(file);<br />
			available = true;<br />
		}catch(Exception e){<br />
			System.out.println(&#8220;EXCEPTION IN INSERTMEDIA&#8221;+e);<br />
			e.printStackTrace();</p>
<p>		}</p>
<p>	}</p>
<p>	 public  MediaPlayer getMedia(){<br />
	try{<br />
		if(mediaplayers.size()&lt;1){<br />
			available=false;<br />
		}</p>
<p>		if(!available){<br />
			return null;<br />
		}<br />
		mediaplayers.remove(0);;</p>
<p>		if(mediaplayers.size()&lt;1){<br />
			return null;<br />
		}<br />
	}catch(Exception e){<br />
		System.out.println(&quot;EXCEPTION IN GETMEDIA&quot;+e);<br />
		e.printStackTrace();<br />
	}<br />
		return mediaplayers.firstElement();<br />
	}</p>
<p>	   private void removefile (){</p>
<p>        String TAG = &quot;removefile ***:&quot;;<br />
     try{<br />
        File temp = new File(context.getCacheDir(),DOWNFILE + playedcounter);<br />
        Log.i(TAG, temp.getAbsolutePath());<br />
        temp.delete();<br />
        synchronized(this){<br />
        	playedcounter++;<br />
        }<br />
     }catch(Exception e){<br />
 		System.out.println(&quot;EXCEPTION IN REMOVEFILE&quot;+e);<br />
 		e.printStackTrace();<br />
 	}<br />
    }</p>
<p>    //Start first audio clip<br />
    private void startMediaPlayer() {<br />
        String TAG = &quot;startMediaPlayer***:&quot;;<br />
        try{<br />
        //Grab out first media player<br />
        synchronized(this){<br />
        	 started = true;<br />
        	MediaPlayer mp = mediaplayers.get(0);<br />
        	mp.start();<br />
        }<br />
        }catch(Exception e){<br />
     		System.out.println(&quot;EXCEPTION IN STARTMEDIAPLAYER&quot;+e);<br />
     		e.printStackTrace();<br />
     	}</p>
<p>    }</p>
<p>    public  void clear(){<br />
    	String TAG = &quot;CLEAR URL STREAMPLAYER***:&quot;;</p>
<p>    	try{<br />
    		synchronized(this){<br />
    			playedcounter = 1;<br />
    			started = false;<br />
    	    	 available=false;<br />
    			for(int i=0;i&lt;mediaplayers.size();i++){<br />
    				MediaPlayer mp=mediaplayers.get(i);<br />
    				if(mp != null){<br />
    					if( mp.isPlaying())<br />
    						mp.pause();<br />
    					mp.reset();<br />
    					mp.release();<br />
    				}<br />
    			}</p>
<p>    			mediaplayers.removeAllElements();</p>
<p>    		}</p>
<p>    	}catch(Exception e){<br />
    		 Log.i(TAG, &quot;ERROR CLEARING MEADIA PLAYERS : &quot; + mediaplayers.size() );<br />
    		 e.printStackTrace();<br />
    	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Android Tutorial 3: Custom Audio Streaming with MediaPlayer by CatDaaaady</title>
		<link>http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/#comment-564</link>
		<dc:creator>CatDaaaady</dc:creator>
		<pubDate>Tue, 16 Feb 2010 04:30:06 +0000</pubDate>
		<guid isPermaLink="false">http://pocketjourney.wordpress.com/?p=16#comment-564</guid>
		<description>I actually hear it in my app.  In my app I am saving pieces of a live, continuous, stream and playing them one by one.
It is VERY subtle. But I know the gap is there. None of my users have complained about it yet though. So I assume maybe it is only for people with sensitive ears.

My plan to getting around it is to implement some type of live stream-to-rtp converter.  So the program will download a portion of audio, put it into a RTP packet, then send that off to the audio player.

I &quot;think&quot; this is how other apps are doing it. I haven&#039;t had time to do this just yet. I noticed some links on this page that mention RTP. Maybe they point the way even though it is for video?  I think sometime next month, after I add a different feature to my app, I will tackle this rtp thing.  I will report back.</description>
		<content:encoded><![CDATA[<p>I actually hear it in my app.  In my app I am saving pieces of a live, continuous, stream and playing them one by one.<br />
It is VERY subtle. But I know the gap is there. None of my users have complained about it yet though. So I assume maybe it is only for people with sensitive ears.</p>
<p>My plan to getting around it is to implement some type of live stream-to-rtp converter.  So the program will download a portion of audio, put it into a RTP packet, then send that off to the audio player.</p>
<p>I &#8220;think&#8221; this is how other apps are doing it. I haven&#8217;t had time to do this just yet. I noticed some links on this page that mention RTP. Maybe they point the way even though it is for video?  I think sometime next month, after I add a different feature to my app, I will tackle this rtp thing.  I will report back.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
