[android-developers] setXfermode not working on pre-ICS

2013-04-20 Thread user123
I have 2 images, one on top of the other. I paint a circle in the 
front-image with xfermode to let the image bellow show through.

I realized this with 2 views in a RelativeLayout. The front-view acts as 
mask and is a custom view. 

The problem: Works well in 4.x, but on 2.x the circle is black, instead of 
transparent.


The code:


@Override
public void onDraw(Canvas canvas){
super.onDraw(canvas);

c2.drawCircle(X, Y, 50, pTouch);
Paint new_paint = new Paint();
new_paint.setXfermode(new PorterDuffXfermode(Mode.SRC_ATOP));
rect.set (0, 0, getWidth(), getHeight());
canvas.drawBitmap(overlay, null, rect, new_paint);

}

And c2 was initialized to a canvas with bitmap overlay, like this:

Bitmap overlay;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inScaled = false;
overlay = BitmapFactory.decodeResource(getResources(), R.drawable.overlay, 
options);
//...
overlay = Bitmap.createScaledBitmap(overlay, newWidth, newHeight, false);

c2 = new Canvas(overlay);
c2.drawBitmap(overlay, null, rect, filterPaint);


Thanks!

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] setXfermode not working on pre-ICS

2013-04-20 Thread user123
I have 2 images, one on top of the other. I paint a circle in the 
front-image with xfermode to let the image bellow show through.

I realized this with 2 views in a RelativeLayout. The front-view acts as 
mask and is a custom view. 

The problem: Works well in 4.x, but on 2.x the circle is black, instead of 
transparent.


The code:


@Override
public void onDraw(Canvas canvas){
super.onDraw(canvas);

c2.drawCircle(X, Y, 50, pTouch);
Paint new_paint = new Paint();
new_paint.setXfermode(new PorterDuffXfermode(Mode.SRC_ATOP));
rect.set (0, 0, getWidth(), getHeight());
canvas.drawBitmap(overlay, null, rect, new_paint);

}

And c2 was initialized to a canvas with bitmap overlay, like this:

Bitmap overlay;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inScaled = false;
overlay = BitmapFactory.decodeResource(getResources(), R.drawable.overlay, 
options);
//...
overlay = Bitmap.createScaledBitmap(overlay, newWidth, newHeight, false);

c2 = new Canvas(overlay);

Paint filterPaint = new Paint();
filterPaint.setColorFilter(new PorterDuffColorFilter(0xff22, 
 PorterDuff.Mode.SRC_ATOP));
rect.set (0, 0, w, h);
c2.drawBitmap(overlay, null, rect, filterPaint);


Thanks!

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] How to compress text data before saving in a database

2013-04-20 Thread Simon Giddings
I have a more than 800 records of data, of which each record will contain a 
variable size of text data.
It is this text data (anything between 800 bytes and 4kb) which I need to 
compress before putting it into the database.

It doesn't matter if the saving of the data is a bit long, it will be the 
reading and decompressing which needs to be fast and efficient.

Note that I am targetting tablet devices here.

Is there a recommended / best way to go about this ?

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: setXfermode not working on pre-ICS

2013-04-20 Thread user123
I forgot:

Initialization of pTouch (used in onDraw()):

pTouch = new Paint(Paint.ANTI_ALIAS_FLAG); 
pTouch.setXfermode(new PorterDuffXfermode(Mode.SRC_OUT)); 
pTouch.setColor(Color.TRANSPARENT);
pTouch.setMaskFilter(new BlurMaskFilter(25, Blur.NORMAL));




Am Samstag, 20. April 2013 11:07:16 UTC+2 schrieb user123:

 I have 2 images, one on top of the other. I paint a circle in the 
 front-image with xfermode to let the image bellow show through.

 I realized this with 2 views in a RelativeLayout. The front-view acts as 
 mask and is a custom view. 

 The problem: Works well in 4.x, but on 2.x the circle is black, instead of 
 transparent.


 The code:


 @Override
 public void onDraw(Canvas canvas){
 super.onDraw(canvas);

 c2.drawCircle(X, Y, 50, pTouch);
 Paint new_paint = new Paint();
 new_paint.setXfermode(new PorterDuffXfermode(Mode.SRC_ATOP));
 rect.set (0, 0, getWidth(), getHeight());
 canvas.drawBitmap(overlay, null, rect, new_paint);

 }

 And c2 was initialized to a canvas with bitmap overlay, like this:

 Bitmap overlay;
 BitmapFactory.Options options = new BitmapFactory.Options();
 options.inScaled = false;
 overlay = BitmapFactory.decodeResource(getResources(), R.drawable.overlay, 
 options);
 //...
 overlay = Bitmap.createScaledBitmap(overlay, newWidth, newHeight, false);

 c2 = new Canvas(overlay);

 Paint filterPaint = new Paint();
 filterPaint.setColorFilter(new PorterDuffColorFilter(0xff22, 
  PorterDuff.Mode.SRC_ATOP));
 rect.set (0, 0, w, h);
 c2.drawBitmap(overlay, null, rect, filterPaint);


 Thanks!


-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Maps api key v1?

2013-04-20 Thread user123
I need urgently a key for maps api v1. Is there any way to still get one?

The context: I finished an app a few months ago. I want to release it now. 
Now I see that I need a new map key for the release keystore.

Well, I go to the page to get the key, and it says, that I have to port my 
maps to version 2.

I can't do that now. Release is planned now, as said, everything is 
finished and tested. Is there a way to still get a version 1 key!?

Thanks in advance.

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Maps api key v1?

2013-04-20 Thread ram goud
Sorry to say that there is no way to work with api v1 you should go for
google maps api v2...


On Sat, Apr 20, 2013 at 9:32 PM, user123 ivanschu...@gmail.com wrote:

 I need urgently a key for maps api v1. Is there any way to still get one?

 The context: I finished an app a few months ago. I want to release it now.
 Now I see that I need a new map key for the release keystore.

 Well, I go to the page to get the key, and it says, that I have to port my
 maps to version 2.

 I can't do that now. Release is planned now, as said, everything is
 finished and tested. Is there a way to still get a version 1 key!?

 Thanks in advance.

 --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Android Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Regards
Rambabu Mareedu
9581411199

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.