-2

I need my widget to interact with any built-int browser. What I mean by an interaction is to know the content of the visible web page. Is it possible for a floating widget to "know" what DOM element lies below and read some info about the element? The following scenario is demanded: user moves the widget across a browser with some HTML page visible, the widget then recognizes HTML elements and shows the user some information about that element.

If there is no such possibility, is it possible to read the whole text from the actual web page? Only text, without any other objects.

peterp
  • 171
  • 1
  • 1
  • 9
  • You might want to take a look here: [http://stackoverflow.com/questions/9579772/android-get-text-out-of-webview](http://stackoverflow.com/questions/9579772/android-get-text-out-of-webview) – Smittey Sep 16 '15 at 08:11
  • Why downvote? I asked a clear question. And I have found nothing on that subject neither on SO nor anywhere else. @Smittey I was asking about interacting with external browser. – peterp Sep 16 '15 at 08:37

1 Answers1

0

if you want to show a web page directly on your app, you can use android webview. Make a activity with a webview.

webveiw.xml

<?xml version="1.0" encoding="utf-8"?>
<WebView  xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>

then you can use in the activity

WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://www.example.com");

you have to add this part in your manfiest file

<manifest ... >
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>

Use this guide http://developer.android.com/guide/webapps/webview.html

  • The question was about interaction between a widget and **an external browser**, not a WebView, which is trivial. – peterp Sep 16 '15 at 08:36