Application crashes when downloding long data in from server and in loop.............

by imran ali » Fri, 20 May 2011 19:22:33 GMT


Sponsored Links
 Hi all
I have been using AsyncTask<Context, Integer, String> to download data
from server,
in between it has been crashing with message in DDMS.
05-20 16:37:11.656: DEBUG/Zygote(33): Process 9489 terminated by
signal (11)

can any one has idea, what would be solution, i am downloading big
size of data approx 10MB of text.

Regards
Imran ali

-- 



Re: Application crashes when downloding long data in from server and in loop.............

by Daniel Drozdzewski » Fri, 20 May 2011 19:36:04 GMT


 Imran,

Any debug info?
Listing of your doInBackground() perhaps?

Are you saving the whole 10MB of text into memory or do you save it to
a file via some buffer?

Daniel








-- 
Daniel Drozdzewski

-- 


Sponsored Links


Other Threads

1. running an online streaming Media player in background as a service .

Hi,
I am working on streaming player application and the streaming player
is perfectly working fine when run as an activity. now I am trying to
run it as a service and I have to control the progress bar through it
as well .for that purpose I have coded  a MediaService Class extended
it from service.from the logcat I can see service being created and
destroyed.but still this is not working . please advise how can
acheive my goal ? any alternate solution. how can control
UserInterface on Activity re-start or refocus ?

I have initied MediaService class from my main activity like this



 Intent myIntent = new Intent(Application.this, X96MediaPlayer.class);
 
MediaService.setUpdateListener(this,txtstream,imgbtn,playbtn,streambtn,progressbar);
        startActivityForResult(myIntent, 00)  ;


Note I m attaching my UIUpdataListener through static Method



here is my MediaService class

public class MediaService extends Service {

        private static Application MAIN_ACTIVITY;
        StreamingMediaPlayer audioStreamer ;
    private static TextView textStreamed;
        private static ImageButton playButton;
        private static ProgressBar      progressBar;
        private static Button streamButton;
        private static Context context;



        public static void setUpdateListener(Context  lcontext,TextView
ltextStreamed, ImageButton      lplayButton, Button
lstreamButton,ProgressBar       lprogressBar) {
                context = lcontext;
                textStreamed = ltextStreamed;
                playButton = lplayButton;
                progressBar = lprogressBar;
                streamButton = lstreamButton ;

                }



        @Override
        public IBinder onBind(Intent arg0) {
                // TODO Auto-generated method stub
                return null;
        }



        @Override public void onCreate() {
                  super.onCreate();

                  // init the service here
                  _startService();


                }

                @Override public void onDestroy() {
                  super.onDestroy();
                  Log.e("Streaming Media", ""Media Service Killed");
                  _shutdownService();


                }
                private void _startService() {
                        try {
                                Log.e("MediaService", "Media service started");
                                audioStreamer = new 
StreamingMediaPlayer(this,textStreamed,
playButton, streamButton,progressBar);
        
audioStreamer.startStreaming(IStreamPlayer.songUrl,IStreamPlayer.mediaLengthInKb,
IStreamPlayer.mediaLengthInSeconds);


                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }

                }
                private void _shutdownService() {
                        if(audioStreamer !=null)
                        audioStreamer.interrupt();


                }

Thanks

-- 

2. Is this a joke or a spam or another April 1st prank?



And it is.


And it is.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in US: 14-18 June 2010: http://bignerdranch.com

-- 

3. ALSA: Waiting for sevice media.audio_policy...

4. Is this a joke or a spam or another April 1st prank?

5. Can we release an updated version of app with lower min sdk?

6. Is this a joke or a spam or another April 1st prank?

7. Writing Current Time