Yes, you can read pages stored on the phone:

I'm using index.html here. Put it into your assets folder :


webView = (WebView) spinnerView.findViewById(R.id.spinnerviewwebview);

        webView.getSettings().setJavaScriptEnabled(true);
        webView.addJavascriptInterface(new AndroidBridge(), "android");
        webView.setVerticalScrollBarEnabled(false);

        webView.setWebChromeClient(new WebChromeClient()
        {
public void onConsoleMessage(String message, int lineNumber, String sourceID)
              {

              }
            });

        webView.loadUrl("file:///android_asset/index.html");

The above also sets the WebView up to use Javascript.




On 12/07/2010 2:10 PM, kypriakos wrote:
In this case below, the URL can only be public and remote? I could not
read
a page stored locally on the phone - or is storing files locally not
an option?

Uri uri = Uri.parse("http://www.example.com";);
  Intent intent = new Intent(Intent.ACTION_VIEW, uri);
  startActivity(intent);

Thanks

On Jul 12, 3:21 pm, Mark Murphy<[email protected]>  wrote:
On Mon, Jul 12, 2010 at 3:10 PM, kypriakos<[email protected]>  wrote:
Instead of launching a UI I was wondering if I could have a process
monitor
the execution of a javascript in the emulator's browser and read in
the output
data. Is it possible to execute a local javascript file using the
phone's browser?
You can use WebView, but only from an Activity.

If you want to embed a Javascript interpreter, you can consider Rhino.

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

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

--
Sincerely,

Brad Gies
-----------------------------------------------------------------------
Bistro Bot - Bistro Blurb
http://www.bgies.com
http://www.bistroblurb.com
http://www.ihottonight.com
-----------------------------------------------------------------------

Never doubt that a small group of thoughtful, committed people can
change the world. Indeed. It is the only thing that ever has - Margaret Mead

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

Reply via email to