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. customised list adapter by extending the BaseAdapoter.

I have created a customised list adapter by extending the BaseAdapoter.


This has many kinds of Views.Thats is button text,etc.How do I control UI
such that I am only able to click the button in the list of items


For example

Suppose this is the list
Text View1 Button1
Text View2 Button2
Text View3 Button3
Text View4 Button4

Now i donot want the text view to be clickable are selectable,how do I
acheive that?


Thanks
Guru

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

2. Now the source is released what steps do we need to take to port to other hardware?

Now the source is released what steps do we need to take to port to
other hardware?

In particular I would like to port to the HTC prophet, but I know that
others will want to port to their own flavours of handset.

However I'd be grateful if someone could point me in the right
direction of a porting guide, or anything that I can use to get
started.



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

3. implementing apps on the G1

4. TabHost and TabWidget

5. Git and proxy HOW TO?

6. repo sync always dies

7. question...