On Thu, Dec 15, 2011 at 8:25 PM, bob <[email protected]> wrote: > Can I use this function from BitmapFactory to read an asset? > > static Bitmap > decodeFile(String pathName) > Decode a file path into a bitmap.
I believe that reads files on the filesystem, not assets, though you are welcome to try. More likely, you should not be using assets for images. > Also, is there really a need for both resources and assets? Aren't > assets sufficient? http://developer.android.com/guide/topics/resources/index.html "For any type of resource, you can specify default and multiple alternative resources for your application: - Default resources are those that should be used regardless of the device configuration or when there are no alternative resources that match the current configuration. - Alternative resources are those that you've designed for use with a specific configuration. To specify that a group of resources are for a specific configuration, append an appropriate configuration qualifier to the directory name. For example, while your default UI layout is saved in the res/layout/ directory, you might specify a different UI layout to be used when the screen is in landscape orientation, by saving it in the res/layout-land/ directory. Android automatically applies the appropriate resources by matching the device's current configuration to your resource directory names." Assets lack the same capabilities. IMHO, your default should be to use resources, not assets, unless you have a concrete reason *to* use assets (e.g., you can't store a font in a resource IIRC). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in NYC: http://marakana.com/training/android/ -- 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

