On Thu, Aug 6, 2009 at 5:20 PM, Jason Proctor <[email protected]
> wrote:

> (btw it used to work the other way round. did something change in r2 or
> r3?)


Not that I know of.  The code you are posting that you are saying doesn't
work as never worked afaik.


> i don't want to do it this way, trust me. i'm having to do this
> because i can't get a FileDescriptor to a file in /assets in my apk -
> i get a "this file is zipped" error or somesuch.


You need to store the asset uncompressed to be able to get a file descriptor
for it.  aapt will not compress certain extensions (.mp3 and .png for
example) and I believe there is a command line argument to specify other
extensions that shouldn't be compressed.


> so i get an
> InputStream from assetManager.open(path), cache it in /sdcard, then
> get a FileDescriptor to the file and return that (from
> ContentProvider.getFile()).


I am not connecting this with having to use ComponentName, but that is okay.

is there a better way round this than getting the resources for a
> "foreign" activity like i'm doing?


There is nothing wrong with loading and accessing the resources of another
applications; in many cases it is by far the most efficient way to get stuff
of it.  And this doesn't require using ComponentName: use use
Context.createPackageContext() to access the other package's resources.

-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to