Clarification on loading local images with WebView

by Jeff Thorn » Fri, 14 May 2010 06:42:22 GMT


Sponsored Links
 Regarding option 1 - if I create a content provider it appears I need to
implement the openFile method and return a ParcelFileDescriptor. Sounds easy
enough.  But how do you create a File object from something in the assets
directory?






As I wrote in my previous reply:


Try creating a ContentProvider to serve the image, and see if you have
better luck with a content:/...

Not if your image is only in an asset. The image viewer won't have
rights to access it.


Not directly, but you can use the 2D graphics API (e.g., Canvas and
friends). Basically, you're looking to use the same techniques games do
to view a portion of a large map, for example.

--

Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
http://commonsware...
Android Online Training: 21-25 June 2010:  http://onlc.com 


--



Clarification on loading local images with WebView

by Mark Murphy » Fri, 14 May 2010 06:51:08 GMT


 


Perhaps use openAssetFile() instead?

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android App Developer Books:  http://commonsware.com/books 

--


Sponsored Links


Clarification on loading local images with WebView

by Jeff Thorn » Fri, 14 May 2010 07:18:31 GMT


 You would think huh? But I got the impression for the docs that that method
just allows you return a file segment using an offset and length.

Can you do something like:

File f = new File("assets/myfile.png");

I wish you could create a ParcelFileDescriptor with something Oberlin than a
File.






Perhaps use openAssetFile() instead?

--

Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 

 http://commonsware.com/blog  |  http://twitter.com/commonsguy 
Android App Developer Books:  http://commonsware.com/books 


--



Clarification on loading local images with WebView

by Jeff Thorn » Fri, 14 May 2010 07:21:24 GMT


 PS - meant something OTHER than. Droid autospell. :)




You would think huh? But I got the impression for the docs that that method
just allows you return a file segment using an offset and length.

Can you do something like:

File f = new File("assets/myfile.png");

I wish you could create a ParcelFileDescriptor with something Oberlin than a
File.









Groups "Android Developers" group.
To post to this group, send email to android-develop...@googlegro...

--



Clarification on loading local images with WebView

by Mark Murphy » Fri, 14 May 2010 07:38:06 GMT


 



Hmmmm...yeah, I was probably a bit too off-the-cuff with that
recommendation. I had done a ContentProvider to serve large images to a
WebView, but it wasn't an asset. It doesn't look like doing one from an
asset will be terribly simple.

Sorry!

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android Training in NYC: 4-6 June 2010:  http://guruloft.com 

--



Clarification on loading local images with WebView

by Jeff Thorn » Fri, 14 May 2010 08:14:59 GMT


 I appreciate your help. I think I will just open the large image in a new
custom Activity.









Hmmmm...yeah, I was probably a bit too off-the-cuff with that
recommendation. I had done a ContentProvider to serve large images to a
WebView, but it wasn't an asset. It doesn't look like doing one from an
asset will be terribly simple.

Sorry!

--

Mark Murphy (a Commons Guy)

 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.c ...
Android Training in NYC: 4-6 June 2010:  http://guruloft.com 


--



Other Threads

1. Browser Plugin for Android

Hello All,

My goal is to run a custom plugin on the android web browser. I have
found a "hello world" plugin, and successfully compiled with webkit.
now i have the plugin as a .so file.

what should be the next steps :-
1. where do i copy this plugin so that browser can load it?
2. How do i check if its loaded. in Firefox we can do "about:plugins"
to list plugins. anything similar available in android browser?

Raj

--~--~---------~--~----~------------~-------~--~----~

2. Android Platform Profiling

Hi Everyone

I have successfully brought up a OMAP24240 target running Android with
YAFFS2 and UBIFS file systems. I am now trying to identify the
performance overheads associated at every level like the application,
file system, DVM, File Translation Layer, Linux IO scheduler etc. I am
primarily interested in measuring the flash memory read/write
performance. Is there any standard application available already for
the Android platform for profiling such a scenario?

Thanks in advance
Rajib

--~--~---------~--~----~------------~-------~--~----~

3. how can i upload audio file into res/raw folder

4. video playing in grayscale mode on dream

5. how to put OMX audio decoder in IDLE strate at the end of playback

6. Records not loading from database in listview

7. Records not loading from database in listview