On Wed, Jun 1, 2011 at 4:40 PM, Mark Murphy <mmur...@commonsware.com> wrote:

> On Wed, Jun 1, 2011 at 4:38 PM, Abhishek Soni <ab.abhish...@gmail.com>
> wrote:
> >              Actually this is a webpage and when i open this page.  I
> want
> > to read the Html code.  That is when html code comes into picture.
>
> There is no simple way to do this. With addJavascriptInterface() and
> loadUrl() of a javascript: URL, you can get the HTML by brute force.
>
>
Thanks for pointing this out Mark.

I also note that if you want to keep the browser from opening the default
Android browser, you'll have to change the behavior of the links:

http://stackoverflow.com/questions/2378800/android-webview-click-opens-default-browser

This might be a bit much to ask, but, out of interest, am I correct in
saying it is impossible to have similar actions performed by the plain old
Android browser?

I could imagine an application which the user might start, which starts a
service, which if the browser loaded a page would allow interacting from
javascript to an object in aforementioned service.  I understand that this
is a bit contrived, because your process might be eventually killed, so I
presume that the standard thing to do in this situation is to add a receiver
to capture links of some form and hand them to your app instead.  However, I
can imagine uses for such functionality that don't fit into this model:
during some research in the last year I wanted to have multiple pages
throughout the net interact with an Android app that users would run in the
background, that does things like record information about browsing
interests.  Obviously this situation should be outlawed in real apps because
the idea that a rouge application could intercept HTML from any site the
user was browsing would be a *major* security hole, however this wasn't
something we were worried about (as, again, the app was used just for
research.)  My question isn't for that particular situation, as we can just
root the phone and hack what we needed, but in general.

Kris

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

Reply via email to