[android-developers] Re: Android setImageUri not working with asset Uri

2011-10-05 Thread Ash McConnell
Hi pskink,

Just getting round to trying this now due to family illness.  It works great 
:).  Thanks for taking the time!

Do you know if it could be used to load 9 patch files using Uri's by any 
chance?  It would be great if I could skin my widgets with 9 patch bitmaps.

Thanks again,
All the best,
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

[android-developers] Re: Android setImageUri not working with asset Uri

2011-09-26 Thread Ash McConnell
Hi Folks,

I'm still having problems with this, does anyone know if it's possible?

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

[android-developers] Re: Android setImageUri not working with asset Uri

2011-09-26 Thread skink


On Sep 26, 10:12 am, Ash McConnell ash.mcconn...@gmail.com wrote:
 Hi Folks,

 I'm still having problems with this, does anyone know if it's possible?

 Thanks!
 Ash

Yes, use AssetManager

pskink

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread Ashley McConnell
Unfortunately in this case I need to use a URI as eventually I am going to
use it to skin an AppWidget.

On Mon, Sep 26, 2011 at 10:32 AM, skink psk...@gmail.com wrote:



 On Sep 26, 10:12 am, Ash McConnell ash.mcconn...@gmail.com wrote:
  Hi Folks,
 
  I'm still having problems with this, does anyone know if it's possible?
 
  Thanks!
  Ash

 Yes, use AssetManager

 pskink

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




-- 
Awesome Widgets http://www.siroccosoftware.com/awesome
Online Racing Championship http://onlineracingchampionship.com
Twitter http://twitter.com/AshMcConnell

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread skink


Ashley McConnell wrote:
 Unfortunately in this case I need to use a URI as eventually I am going to
 use it to skin an AppWidget.

 On Mon, Sep 26, 2011 at 10:32 AM, skink psk...@gmail.com wrote:

 
 
  On Sep 26, 10:12 am, Ash McConnell ash.mcconn...@gmail.com wrote:
   Hi Folks,
  
   I'm still having problems with this, does anyone know if it's possible?
  
   Thanks!
   Ash
 
  Yes, use AssetManager
 
  pskink
 
  --
  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
 



 --
 Awesome Widgets http://www.siroccosoftware.com/awesome
 Online Racing Championship http://onlineracingchampionship.com
 Twitter http://twitter.com/AshMcConnell

Skin? What do you mean?

pskink

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread Kostya Vasilyev

ImageView supports resource URIs starting with Android 2.2.

The URI scheme is android.resource://, more info can be found here:

http://androidbook.blogspot.com/2009/08/referring-to-android-resources-using.html

-- Kostya

26.09.2011 14:21, skink пишет:


Ashley McConnell wrote:

Unfortunately in this case I need to use a URI as eventually I am going to
use it to skin an AppWidget.

On Mon, Sep 26, 2011 at 10:32 AM, skinkpsk...@gmail.com  wrote:



On Sep 26, 10:12 am, Ash McConnellash.mcconn...@gmail.com  wrote:

Hi Folks,

I'm still having problems with this, does anyone know if it's possible?

Thanks!
Ash

Yes, use AssetManager

pskink

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




--
Awesome Widgetshttp://www.siroccosoftware.com/awesome
Online Racing Championshiphttp://onlineracingchampionship.com
Twitterhttp://twitter.com/AshMcConnell

Skin? What do you mean?

pskink



--
Kostya Vasilyev

--
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: Android setImageUri not working with asset Uri

2011-09-26 Thread Ashley McConnell
Thanks, I am currently using resource URIs, but I'd like to use asset URIs
if possible

On Mon, Sep 26, 2011 at 11:48 AM, Kostya Vasilyev kmans...@gmail.comwrote:

 ImageView supports resource URIs starting with Android 2.2.

 The URI scheme is android.resource://, more info can be found here:

 http://androidbook.blogspot.**com/2009/08/referring-to-**
 android-resources-using.htmlhttp://androidbook.blogspot.com/2009/08/referring-to-android-resources-using.html

 -- Kostya

 26.09.2011 14:21, skink пишет:


 Ashley McConnell wrote:

 Unfortunately in this case I need to use a URI as eventually I am going
 to
 use it to skin an AppWidget.

 On Mon, Sep 26, 2011 at 10:32 AM, skinkpsk...@gmail.com  wrote:


 On Sep 26, 10:12 am, Ash 
 McConnellash.mcconn...@gmail.**comash.mcconn...@gmail.com
  wrote:

 Hi Folks,

 I'm still having problems with this, does anyone know if it's possible?

 Thanks!
 Ash

 Yes, use AssetManager

 pskink

 --
 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 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en



 --
 Awesome 
 Widgetshttp://www.**siroccosoftware.com/awesomehttp://www.siroccosoftware.com/awesome
 
 Online Racing 
 Championshiphttp://**onlineracingchampionship.comhttp://onlineracingchampionship.com
 
 Twitterhttp://twitter.com/**AshMcConnellhttp://twitter.com/AshMcConnell
 

 Skin? What do you mean?

 pskink


 --
 Kostya Vasilyev

 --
 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.comandroid-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en




-- 
Awesome Widgets http://www.siroccosoftware.com/awesome
Online Racing Championship http://onlineracingchampionship.com
Twitter http://twitter.com/AshMcConnell

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread Ashley McConnell
Skinning, to change the look of the AppWidget by changing backgrounds /
icons etc. according to user preferences.

On Mon, Sep 26, 2011 at 11:21 AM, skink psk...@gmail.com wrote:



 Ashley McConnell wrote:
  Unfortunately in this case I need to use a URI as eventually I am going
 to
  use it to skin an AppWidget.
 
  On Mon, Sep 26, 2011 at 10:32 AM, skink psk...@gmail.com wrote:
 
  
  
   On Sep 26, 10:12 am, Ash McConnell ash.mcconn...@gmail.com wrote:
Hi Folks,
   
I'm still having problems with this, does anyone know if it's
 possible?
   
Thanks!
Ash
  
   Yes, use AssetManager
  
   pskink
  
   --
   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
  
 
 
 
  --
  Awesome Widgets http://www.siroccosoftware.com/awesome
  Online Racing Championship http://onlineracingchampionship.com
  Twitter http://twitter.com/AshMcConnell

 Skin? What do you mean?

 pskink

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




-- 
Awesome Widgets http://www.siroccosoftware.com/awesome
Online Racing Championship http://onlineracingchampionship.com
Twitter http://twitter.com/AshMcConnell

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread skink


On Sep 26, 12:52 pm, Ashley McConnell ash...@siroccoracing.com
wrote:
 Skinning, to change the look of the AppWidget by changing backgrounds /
 icons etc. according to user preferences.





 On Mon, Sep 26, 2011 at 11:21 AM, skink psk...@gmail.com wrote:

  Ashley McConnell wrote:
   Unfortunately in this case I need to use a URI as eventually I am going
  to
   use it to skin an AppWidget.

   On Mon, Sep 26, 2011 at 10:32 AM, skink psk...@gmail.com wrote:

On Sep 26, 10:12 am, Ash McConnell ash.mcconn...@gmail.com wrote:
 Hi Folks,

 I'm still having problems with this, does anyone know if it's
  possible?

 Thanks!
 Ash

Yes, use AssetManager

pskink

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

   --
   Awesome Widgets http://www.siroccosoftware.com/awesome
   Online Racing Championship http://onlineracingchampionship.com
   Twitter http://twitter.com/AshMcConnell

  Skin? What do you mean?

  pskink

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

 --
 Awesome Widgets http://www.siroccosoftware.com/awesome
 Online Racing Championship http://onlineracingchampionship.com
 Twitter http://twitter.com/AshMcConnell

So you would like to call RemoteViews.setBitmap() right?

pskink

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread Ashley McConnell



 So you would like to call RemoteViews.setBitmap() right?


I'd like to call RemoteViews.setImageViewUri with a file in the assets
directory.  The problem with setImageViewBitmap is that it very quickly hits
an android imposed limit.

All the best,
Ash

-- 
Awesome Widgets http://www.siroccosoftware.com/awesome
Online Racing Championship http://onlineracingchampionship.com
Twitter http://twitter.com/AshMcConnell

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread skink


On Sep 26, 1:10 pm, Ashley McConnell ash...@siroccoracing.com wrote:
  So you would like to call RemoteViews.setBitmap() right?

 I'd like to call RemoteViews.setImageViewUri with a file in the assets
 directory.  The problem with setImageViewBitmap is that it very quickly hits
 an android imposed limit.

 All the best,
 Ash

 --
 Awesome Widgets http://www.siroccosoftware.com/awesome
 Online Racing Championship http://onlineracingchampionship.com
 Twitter http://twitter.com/AshMcConnell

Ok, I see it now.

Looking into ImageView sources it seems however that your problem can
be solved by using custom ContentProvider

pskink

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread Ashley McConnell
On Mon, Sep 26, 2011 at 1:04 PM, skink psk...@gmail.com wrote:



 On Sep 26, 1:10 pm, Ashley McConnell ash...@siroccoracing.com wrote:
   So you would like to call RemoteViews.setBitmap() right?
 
  I'd like to call RemoteViews.setImageViewUri with a file in the assets
  directory.  The problem with setImageViewBitmap is that it very quickly
 hits
  an android imposed limit.
 
  All the best,
  Ash
 
  --
  Awesome Widgets http://www.siroccosoftware.com/awesome
  Online Racing Championship http://onlineracingchampionship.com
  Twitter http://twitter.com/AshMcConnell

 Ok, I see it now.

 Looking into ImageView sources it seems however that your problem can
 be solved by using custom ContentProvider

 pskink


Thanks, That was a workaround I didn't think of, I'll give it a go.  I don't
understand why the asset URI doesn't work as advertised though.
-- 
Awesome Widgets http://www.siroccosoftware.com/awesome
Online Racing Championship http://onlineracingchampionship.com
Twitter http://twitter.com/AshMcConnell

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread skink


On 26 Wrz, 14:59, Ashley McConnell ash...@siroccoracing.com wrote:

 Thanks, That was a workaround I didn't think of, I'll give it a go.  I don't
 understand why the asset URI doesn't work as advertised though.
 --
 Awesome Widgets http://www.siroccosoftware.com/awesome
 Online Racing Championship http://onlineracingchampionship.com
 Twitter http://twitter.com/AshMcConnell

Simply in your ContentProvider
@Override
public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws
FileNotFoundException {
String path = uri.getPath().substring(1);
try {
AssetFileDescriptor afd = mManager.openFd(path);
return afd;
} catch (IOException e) {
throw new FileNotFoundException(No asset found:  + uri);
}
}

where mManager is initialized in onCreate method as:

mManager = getContext().getAssets();

pskink

-- 
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: Android setImageUri not working with asset Uri

2011-09-26 Thread skink


On 26 Wrz, 14:59, Ashley McConnell ash...@siroccoracing.com wrote:
 On Mon, Sep 26, 2011 at 1:04 PM, skink psk...@gmail.com wrote:

  On Sep 26, 1:10 pm, Ashley McConnell ash...@siroccoracing.com wrote:
So you would like to call RemoteViews.setBitmap() right?

   I'd like to call RemoteViews.setImageViewUri with a file in the assets
   directory.  The problem with setImageViewBitmap is that it very quickly
  hits
   an android imposed limit.

   All the best,
   Ash

   --
   Awesome Widgets http://www.siroccosoftware.com/awesome
   Online Racing Championship http://onlineracingchampionship.com
   Twitter http://twitter.com/AshMcConnell

  Ok, I see it now.

  Looking into ImageView sources it seems however that your problem can
  be solved by using custom ContentProvider

  pskink

 Thanks, That was a workaround I didn't think of, I'll give it a go.  I don't
 understand why the asset URI doesn't work as advertised though.
 --
 Awesome Widgets http://www.siroccosoftware.com/awesome
 Online Racing Championship http://onlineracingchampionship.com
 Twitter http://twitter.com/AshMcConnell

simply
@Override
public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws
FileNotFoundException {
String path = uri.getPath().substring(1);
try {
AssetFileDescriptor afd = mAssetManager.openFd(path);
return afd;
} catch (IOException e) {
throw new FileNotFoundException(No asset found:  + uri);
}
}

where mAssetManager = getContext().getAssets();

pskink

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