[android-developers] Re: Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2012-03-01 Thread Efi Merdler-Kravitz
YuviDroid, confirmed your bug, happens on the BitmapDrawable
constructor, the DENSITY_DEFAULT is being used which is medium
density.

On Feb 29, 11:48 am, Efi Merdler-Kravitz efi.merd...@gmail.com
wrote:
 I think that medium density is being used by default. The only way I
 found to bypass it is by using explicit width and height in the xml
 layout, e.g.
 ImageView
         android:id=@+id/imageView1
         android:layout_width=480px
         android:layout_height=200px /

 other, better ideas are welcomed.

 On Feb 23, 7:28 pm, YuviDroid yuvidr...@gmail.com wrote:







  I think I found the problem...and it looks like it's an Android bug.
  Drawable.createFromStream() doesn't take as parameter a Resources object,
  and later it calls Drawable.createFromResourceStream() passing 'null' as
  the Resources parameter.
  From my understanding the resources are then used to ensure that the
  drawable will set its target density correctly, but by being 'null' some
  default density is used.

-- 
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


[android-developers] Re: Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2012-03-01 Thread Efi Merdler-Kravitz
I can see there is already an open bug -  
http://code.google.com/p/android/issues/detail?id=22590 you are more than 
welcomed to star it.

On Thursday, March 1, 2012 12:27:56 PM UTC+2, Efi Merdler-Kravitz wrote:

 YuviDroid, confirmed your bug, happens on the BitmapDrawable 
 constructor, the DENSITY_DEFAULT is being used which is medium 
 density. 

 On Feb 29, 11:48 am, Efi Merdler-Kravitz efi.merd...@gmail.com 
 wrote: 
  I think that medium density is being used by default. The only way I 
  found to bypass it is by using explicit width and height in the xml 
  layout, e.g. 
  ImageView 
  android:id=@+id/imageView1 
  android:layout_width=480px 
  android:layout_height=200px / 
  
  other, better ideas are welcomed. 
  
  On Feb 23, 7:28 pm, YuviDroid yuvidr...@gmail.com wrote: 
  
  
  
  
  
  
  
   I think I found the problem...and it looks like it's an Android bug. 
   Drawable.createFromStream() doesn't take as parameter a Resources 
 object, 
   and later it calls Drawable.createFromResourceStream() passing 'null' 
 as 
   the Resources parameter. 
   From my understanding the resources are then used to ensure that the 
   drawable will set its target density correctly, but by being 'null' 
 some 
   default density is used.

-- 
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

Re: [android-developers] Re: Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2012-03-01 Thread YuviDroid
Uhh great!
I just added a comment + starred.

I hope more devs will star it too so it gets some attention..


Cheers,
Yuvi

On Thu, Mar 1, 2012 at 11:56 AM, Efi Merdler-Kravitz
efi.merd...@gmail.comwrote:

 I can see there is already an open bug -
 http://code.google.com/p/android/issues/detail?id=22590 you are more than
 welcomed to star it.


 On Thursday, March 1, 2012 12:27:56 PM UTC+2, Efi Merdler-Kravitz wrote:

 YuviDroid, confirmed your bug, happens on the BitmapDrawable
 constructor, the DENSITY_DEFAULT is being used which is medium
 density.

 On Feb 29, 11:48 am, Efi Merdler-Kravitz efi.merd...@gmail.com
 wrote:
  I think that medium density is being used by default. The only way I
  found to bypass it is by using explicit width and height in the xml
  layout, e.g.
  ImageView
  android:id=@+id/imageView1
  android:layout_width=480px
  android:layout_height=200px /
 
  other, better ideas are welcomed.
 
  On Feb 23, 7:28 pm, YuviDroid yuvidr...@gmail.com wrote:
 
 
 
 
 
 
 
   I think I found the problem...and it looks like it's an Android bug.
   Drawable.createFromStream() doesn't take as parameter a Resources
 object,
   and later it calls Drawable.**createFromResourceStream() passing
 'null' as
   the Resources parameter.
   From my understanding the resources are then used to ensure that the
   drawable will set its target density correctly, but by being 'null'
 some
   default density is used.

  --
 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




-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
to quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

-- 
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

[android-developers] Re: Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2012-02-29 Thread Efi Merdler-Kravitz
I think that medium density is being used by default. The only way I
found to bypass it is by using explicit width and height in the xml
layout, e.g.
ImageView
        android:id=@+id/imageView1
        android:layout_width=480px
        android:layout_height=200px /

other, better ideas are welcomed.

On Feb 23, 7:28 pm, YuviDroid yuvidr...@gmail.com wrote:
 I think I found the problem...and it looks like it's an Android bug.
 Drawable.createFromStream() doesn't take as parameter a Resources object,
 and later it calls Drawable.createFromResourceStream() passing 'null' as
 the Resources parameter.
 From my understanding the resources are then used to ensure that the
 drawable will set its target density correctly, but by being 'null' some
 default density is used.


-- 
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


Re: [android-developers] Re: Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2012-02-20 Thread YuviDroid
Yep I played with the xml attributes (such as scaleType)...but none would
change the density being used. Or did I miss that?

On Mon, Feb 20, 2012 at 7:36 AM, Dusk Jockeys Android Apps 
duskjock...@gmail.com wrote:

 Could you not play with the xml settings of the ImageView itself? I
 think there are some attributes there that control how the image is
 displayed, whether or not it is scaled, centred etc.

 On Feb 18, 4:56 am, YuviDroid yuvidr...@gmail.com wrote:
  Hi,
 
  sorry to resurrect this post...but I got into a similar problem. And as
 the
  OP did, I'm using RemoteViews.setImageViewUri() to set my image on the
  appwidget. However I noticed that my image is being scaled according to
 the
  screen density.
 
  So, for example, on an XHDPI screen, if I have a bitmap which is 100x100
  and I set it using setImageViewBitmap() I get the image to look as
 100x100.
  However, if I store that bitmap into a png on disk, and then use
  setImageViewUri() my bitmap is displayed as 50x50.
 
  Do you know if there is a way to change this behavior? (i.e. if my image
 is
  100x100 I'd like it to remain 100x100 also after it is decoded).
  Maybe there is a way to force some density on the ImageView itself?
 
  My only workaround (which sucks..) is to scale-up the bitmap before
 storing
  on disk so that when it is being decoded I get back my original size. But
  in this way I use more memory to save the image and I also loose image
  quality..:(
 
  I hope someone can help me!
  Thanks,
  Yuvi
 
  On Mon, Aug 1, 2011 at 8:05 PM, Ash McConnell ash.mcconn...@gmail.com
 wrote:
 
 
 
 
 
   Thanks Kostya and Dianne, setUri works as expected.  I had to create
 the
   files using context.openFileOutput.  Unfortunately that means I loose
 the
   ability to use directories.  I can't see a Java way to set
 permission on
   files, it can be done with native methods, but that seems like
 overkill.
I'll do some more googling.
 
   Thanks again for the help, I was worried that this problem might have
 been
   a show-stopper.
   Ash
 
--
   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
 
  --
  YuviDroid
  Check out Launch-X http://android.yuvalsharon.net/launchx.php (a
 widget
  to quickly access your favorite apps and contacts!)
 http://android.yuvalsharon.net- Hide quoted text -
 
  - Show quoted text -

 --
 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




-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
to quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

-- 
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

[android-developers] Re: Avoiding FAILED BINDER TRANSACTION error when updating lots of widget bitmaps

2012-02-19 Thread Dusk Jockeys Android Apps
Could you not play with the xml settings of the ImageView itself? I
think there are some attributes there that control how the image is
displayed, whether or not it is scaled, centred etc.

On Feb 18, 4:56 am, YuviDroid yuvidr...@gmail.com wrote:
 Hi,

 sorry to resurrect this post...but I got into a similar problem. And as the
 OP did, I'm using RemoteViews.setImageViewUri() to set my image on the
 appwidget. However I noticed that my image is being scaled according to the
 screen density.

 So, for example, on an XHDPI screen, if I have a bitmap which is 100x100
 and I set it using setImageViewBitmap() I get the image to look as 100x100.
 However, if I store that bitmap into a png on disk, and then use
 setImageViewUri() my bitmap is displayed as 50x50.

 Do you know if there is a way to change this behavior? (i.e. if my image is
 100x100 I'd like it to remain 100x100 also after it is decoded).
 Maybe there is a way to force some density on the ImageView itself?

 My only workaround (which sucks..) is to scale-up the bitmap before storing
 on disk so that when it is being decoded I get back my original size. But
 in this way I use more memory to save the image and I also loose image
 quality..:(

 I hope someone can help me!
 Thanks,
 Yuvi

 On Mon, Aug 1, 2011 at 8:05 PM, Ash McConnell ash.mcconn...@gmail.comwrote:





  Thanks Kostya and Dianne, setUri works as expected.  I had to create the
  files using context.openFileOutput.  Unfortunately that means I loose the
  ability to use directories.  I can't see a Java way to set permission on
  files, it can be done with native methods, but that seems like overkill.
   I'll do some more googling.

  Thanks again for the help, I was worried that this problem might have been
  a show-stopper.
  Ash

   --
  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

 --
 YuviDroid
 Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
 to quickly access your favorite apps and 
 contacts!)http://android.yuvalsharon.net- Hide quoted text -

 - Show quoted text -

-- 
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