Eclipse + cupcake + referenced projects in build path = VerifyError

by Guillaume Perrot » Wed, 29 Apr 2009 00:27:26 GMT


Sponsored Links
 Argh I deleted the first version of my topic but you had the time to
answer it :p
The right topic is located at



Other Threads

1. positioning problem with canvas.drawBitmap()

i recently tried using a SurfaceView to draw a large collection of
circles to a Canvas arranged in a ring shape. just to prototype the
idea i originally wrote some code that effectively went like this:

                        Paint paint = new Paint();
                        paint.setStyle(Paint.Style.STROKE);
                        paint.setStrokeWidth(1);
                        paint.setAntiAlias(true);
                        paint.setStrokeCap(Cap.ROUND);
                        paint.setColor(0xffffffff);

                        int circleSize = 20;
                        int circleCount = 50;
                        double theta = 0;
                        double thetaDelta = 2*Math.PI/circleCount;
                        int ringRadius = 100;
                        for(int idx = 0; idx < circleCount; idx++){
                                float x = (float)(ringRadius * Math.cos(theta) 
+ (surfaceWidth -
circleSize)/2);
                                float y = (float)(ringRadius * Math.sin(theta) 
+ (surfaceHeight -
circleSize)/2);
                                surfaceCanvas.drawCircle(x + circleSize/2, y + 
circleSize/2,
circleSize/2 - 2, paint);
                                theta += thetaDelta;
                        }

[this code sits in a "draw" method being called by a non-ui thread]

for the number of iterations above it works great. but as
"circleCount" gets higher, the performance penalty of
canvas.drawCircle() because noticeable.

so, i decided to try using a sprite instead. i changed the code to
draw a single circle to a bitmap first, then draw that bitmap to the
canvas for each iteration instead. here's the new code:

                        Paint paint = new Paint();
                        paint.setStyle(Paint.Style.STROKE);
                        paint.setStrokeWidth(1);
                        paint.setAntiAlias(true);
                        paint.setStrokeCap(Cap.ROUND);
                        paint.setColor(0xffffffff);

                        int circleSize = 20;
                        int circleCount = 50;
                        Bitmap sprite = Bitmap.createBitmap(circleSize, 
circleSize,
Config.ARGB_8888);
                        Canvas spriteCanvas = new Canvas(sprite);
                        spriteCanvas.drawCircle(circleSize/2, circleSize/2, 
circleSize/2 -
2, paint);

                        double theta = 0;
                        double thetaDelta = 2*Math.PI/circleCount;
                        int ringRadius = 100;
                        for(int idx = 0; idx < circleCount; idx++){
                                float x = (float)(ringRadius * Math.cos(theta) 
+ (surfaceWidth -
circleSize)/2);
                                float y = (float)(ringRadius * Math.sin(theta) 
+ (surfaceHeight -
circleSize)/2);
                                surfaceCanvas.drawBitmap(sprite, x, y, null);
                                theta += thetaDelta;
                        }
                        sprite.recycle();
                        sprite = null;

this code performed significantly better ... but then i noticed that
there was something off about the visual result. it's a little hard to
explain, but it basically looked like there was a rounding error
happening when drawing the sprite to surfaceCanvas: the rendered
circles did not appear to be spaced evenly as they did in the initial
code.

here's a picture of what i get using the first code:
http://www.1908media.com/wp-content/shaperendered.jpg

here's a picture of what i get using the sprite code:
http://www.1908media.com/wp-content/spriterendered.jpg

i tried several things to get my sprite code to come out right ... the
only thing that eventually worked for me was to position *as well as
rotate* the sprite and paint it to the canvas using a separate Paint
object with anti-aliasing and filterBitmap enabled. i implemented this
using canvas.drawBitmap( bmp, matrix, paint ). but this incurred an
even greater performance penalty than canvas.drawCircle()!

i'm only barely knowledgeable of openGL, so hoping someone can
enlighten me as to what's not right with the second code block
above ... thoughts anyone?

fwiw, i saw the same results on my n1 running 2.2 as i did on an
emulator running 1.6

tia//


-- 

2. Google maps: please fetch me a location

Hi.

Excuse my noobishness, but I cannot find an answer on how to preform
'get location' operation on google maps.

I don't need any special map view and just need the user to pick a
location from google maps application.

I found (http://developer.android.com/guide/appendix/g-app-
intents.html) that you can start google maps app on a given location.

Since the list of intent on that page is incomplete, I wonder, where
can one find the complete list of intents that google maps can respond
to ?

In short, my app requires a user to pick some location from a map.

Do I have to create a specialized MapView for this ?


Thanks

-- 

3. Registering for proximity alert doesn't work for more than one Location.

4. Layout help for WebView

5. Camera Activity and screen rotation

6. startService an unusual way results in a a NullPointerException

7. Select behavior of a TextView