Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
hades_6
Posts: 178
Registered: ‎08-26-2009
My Device: Not Specified

issues with ContentConnection

Hi guys,

 

I'm using ContentConnection, to open up a stream and then use it in a sourcestream. But when I close the player and then attempt to close the ContentConnection, it keeps downloading the file. Is there any way for me to force the connection to close and then flush it?

 

Any help would be much appreciated. Thank you

 

Here's my code, (at least part of it)

 

	_contentConnection = (ContentConnection) Connector.open(getLocator(), Connector.READ_WRITE);
readAhead = SharedInputStream.getSharedInputStream(_contentConnection.openInputStream());
_feedToPlayer = new LimitedRateSourceStream(readAhead, _contentConnection.getType());

 

 

if (readAhead != null)
    		{        		      
    			synchronized(this){
    				readAhead.close();
    			}
    			readAhead= null;
    		}     
    		
    		if(_feedToPlayer != null){
    			_feedToPlayer.close();
    			_feedToPlayer = null;
    		}
    		
    		if(_contentConnection != null){
    			  synchronized (this)
    		        {
    				  _contentConnection.close();
    				  
    		        }
    			

 

 

 

Please use plain text.
Developer
editormax
Posts: 133
Registered: ‎07-20-2009
My Device: Not Specified

Re: issues with ContentConnection

hello,

 i am trying to do the streaming of mp3. But even I follow the BufferedPlayeback sample, it still not start download the mp3 after open the connection. You seems success to work on this part, Would you tell me the trick of stream play. 

Please use plain text.
Developer
hades_6
Posts: 178
Registered: ‎08-26-2009
My Device: Not Specified

Re: issues with ContentConnection

Please use plain text.