HttpResponse

by Mr.No » Mon, 02 Mar 2009 23:31:14 GMT


Sponsored Links
 Hello,
where i find the Content(message body) of a HttpResponse?
rgds Mr.No
--~--~---------~--~----~------------~-------~--~----~



HttpResponse

by Streets Of Boston » Sat, 07 Mar 2009 00:43:14 GMT


 If i remember correctly, try httpResponse.getEntity() and go from
there.



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Android benchmark with rectangles

Hi I am trying to find the number of rectangles per sec in three
different size rectangles. I did find it though. But the only problem
is that I see all the rectangles after it ran the program completely.
But I would like to have rectangles drawn, when I call
canvas.drawRect(rec1,paint); function.

I am also looking to keep the old rectangles on the screen while new
ones are drawn.

I tried with lots of different options nothing worked. To display the
rectangles

Can anybody show me the direction to which way to go ?

Thanks in advance.

Cheers
Kishore Srimat

package com.Benchmark.Rectangle;
import java.util.TimerTask;
import android.R.anim;
import android.app.Activity;
import android.app.AlertDialog;
import android.graphics.drawable.shapes.*;
import android.os.Bundle;
import android.content.Context;
import android.graphics.*;
import android.view.View;
import android.view.animation.Animation;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class Benchmark_Rectangle extends Activity {
        DemoView demoview;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        demoview = new DemoView(this);
                setContentView(demoview);
    }

    int getRandom(int min1 , int max1)
    {
            return  (int) ((int)(Math.round(Math.random()*(max1-min1)))
+min1);
    }

        private class DemoView extends View{
                public DemoView(Context context){
                        super(context);
                }

                @Override protected void onDraw(Canvas canvas) {
                        super.onDraw(canvas);
                        long beforedrawing = 0;
                        // remember: y increases from top to bottom
                        // x increases from left to right
                        int i = 0;
                        int left = getLeft();
            int top = getTop();
            int right = getRight();
            int bottom = getBottom();
                        Paint paint = new Paint();
                        paint.setStyle(Paint.Style.FILL);
                        // make the entire canvas white
                        paint.setColor(Color.WHITE);
                        canvas.drawPaint(paint);
            int LoNumber = 0;
            int HiNumber = 255;

                        long startwithoutrect = System.currentTimeMillis();
            for(i=0;i<=10000; i++)
            {
              int myRandomNumber_Ra = getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rr=  getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rg = getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rb = getRandom(LoNumber,HiNumber);
              paint.setARGB(myRandomNumber_Ra, myRandomNumber_Rr,
myRandomNumber_Rg, myRandomNumber_Rb);
             int sizex= 50;
             int sizey = 50;
             int x = getRandom(left, right-sizex);
                         int y = getRandom(top, bottom-sizey);
            }
            long stopwithoutrect = System.currentTimeMillis();
//
******************************************************************************************************************//
            long startwithlargerect = System.currentTimeMillis();
            for(i=0;i<=10000; i++)
            {
              int myRandomNumber_Ra = getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rr=  getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rg = getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rb = getRandom(LoNumber,HiNumber);
              paint.setARGB(myRandomNumber_Ra, myRandomNumber_Rr,
myRandomNumber_Rg, myRandomNumber_Rb);
              int sizex=right;//320;
              int sizey = bottom;//430;
              int x = getRandom(left, right-sizex);
                          int y = getRandom(top, bottom-sizey);
                          Rect rec1 = new Rect(x/*left*/, y/*top*/, x + 
sizex/*right*/, y
+ sizey/*bottom*/);
            //if(sx != 0 && sy != 0)
              canvas.drawRect(rec1,paint);
//              Animation = new Benchmark_Rectangle();
//              Animation.Initalise(Bitmap.decodeResource(res,
R.drawable.idle), 200, 150, 5, 5);

             }
            long stopwithlargerect = System.currentTimeMillis();
//
******************************************************************************************************************//
            long startwithmediumrect = System.currentTimeMillis();
            for(i=0;i<=10000; i++)
            {
              int myRandomNumber_Ra = getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rr=  getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rg = getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rb = getRandom(LoNumber,HiNumber);
              paint.setARGB(myRandomNumber_Ra, myRandomNumber_Rr,
myRandomNumber_Rg, myRandomNumber_Rb);
              int sizex= 150;
              int sizey = 150;
              int x = getRandom(left, right-sizex);
                          int y = getRandom(top, bottom-sizey);
                          Rect rec1 = new Rect(x/*left*/, y/*top*/, x + 
sizex/*right*/, y
+ sizey/*bottom*/);
            //if(sx != 0 && sy != 0)
              canvas.drawRect(rec1,paint);
            }
            long stopwithmediumrect = System.currentTimeMillis();
//
******************************************************************************************************************//
            long startwithsmallrect = System.currentTimeMillis();
            for(i=0;i<=10000; i++)
            {
              int myRandomNumber_Ra = getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rr=  getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rg = getRandom(LoNumber,HiNumber);
              int myRandomNumber_Rb = getRandom(LoNumber,HiNumber);
              paint.setARGB(myRandomNumber_Ra, myRandomNumber_Rr,
myRandomNumber_Rg, myRandomNumber_Rb);
              int sizex= 50;
              int sizey = 50;
              int x = getRandom(left, right-sizex);
                          int y = getRandom(top, bottom-sizey);
                          Rect rec1 = new Rect(x/*left*/, y/*top*/, x + 
sizex/*right*/, y
+ sizey/*bottom*/);
            //if(sx != 0 && sy != 0)
              canvas.drawRect(rec1,paint);
           }
            long stopwithsmallrect = System.currentTimeMillis();
//
******************************************************************************************************************//
             if(i >= 10000)
            {
            long exceptrect = (stopwithoutrect - startwithoutrect);
            long totaltimeforsmallrect =  ((stopwithsmallrect -
startwithsmallrect) - exceptrect);
            long totaltimeformediumrect =  ((stopwithmediumrect -
startwithmediumrect)-exceptrect);
            long totaltimeforlargerect =   ((stopwithlargerect -
startwithlargerect)-exceptrect);
            float secssmallrect =  (float) (totaltimeforsmallrect/
1000.0);
            float secsmediumrect = (float) (totaltimeformediumrect/
1000.0);
            float secslargerect =  (float) (totaltimeforlargerect/
1000.0);
            float noofsmallrectpersec = (float) (10000.00/
secssmallrect);
            float noofmediumrectpersec = (float) (10000.00/
secsmediumrect);
            float nooflargerectpersec = (float) (10000.00/
secslargerect);
            android.util.Log.d("rect", " Number of small rectangles
per sec = " + (noofsmallrectpersec) + " secs");
            android.util.Log.d("rect", " Number of medium rectangles
per sec  = " + (noofmediumrectpersec) + " secs");
            android.util.Log.d("rect", " Number of large rectangles
per sec  = " + (nooflargerectpersec) + " secs");
            AlertDialog.Builder ab=new
AlertDialog.Builder(Benchmark_Rectangle.this);
            ab.setMessage(" Small rect per sec(50 x 50) = " +
(noofsmallrectpersec) + "      Number of medium rectangles per sec  =
" + (noofmediumrectpersec) + "      Number of large rectangles per
sec  = " + (nooflargerectpersec));
            ab.setPositiveButton("ok", null);
            ab.show();
            }
                }

        }

}


-- 

2. Boss kita Kelaperan...

Mantap, ati 2x tersendak bang

Brian
dikirim dari white  spica



Kasihan, matjet jkt - bandung, demi liat spg bb pake kostum bola celana
{*filter*}  ... sampe jalan kaki....
:-D

Salam,

Lucky Sebastian

-- 
"Indonesian Android Community [id-android]"

Join:  http://www.***.com/ 
Moderator: id.andr...@gmail.com
ID Android Developer:  http://www.***.com/ 
ID Android Surabaya:  http://www.***.com/ 
ID Android on FB:  http://www.***.com/ 

-- 
"Indonesian Android Community [id-android]" 

Join:  http://www.***.com/ 
Moderator: id.andr...@gmail.com
ID Android Developer:  http://www.***.com/ 
ID Android Surabaya:  http://www.***.com/ 
ID Android on FB:  http://www.***.com/ 

3. loadable kernel module...

4. Please tell me where to look for help!

5. Root dan upgrade htc incredible

6. <WTA> exZeus di Desire

7. app2sd nexus one