1

I want to get the current url the browser has in the address bar using any of the possible ways:

  1. adb
  2. python
  3. perl

Thanks

Rohan
  • 1,705
  • 7
  • 17
  • 38

1 Answers1

2

Get the URL of current browser on the Phone ?

  1. Can't
  2. Nope
  3. Yeah no.

But this might be of vague interest to you


Also how to get the browser history

I am abele to get history from following code

Cursor mCur = activity.managedQuery(Browser.BOOKMARKS_URI,
                    Browser.HISTORY_PROJECTION, null, null, null);
            mCur.moveToFirst();
            if (mCur.moveToFirst() && mCur.getCount() > 0) {
                while (mCur.isAfterLast() == false) {
                    Log.v("titleIdx", mCur
                            .getString(Browser.HISTORY_PROJECTION_TITLE_INDEX));
                    Log.v("urlIdx", mCur
                            .getString(Browser.HISTORY_PROJECTION_URL_INDEX));
                    mCur.moveToNext();
                }
            }

You can run a service, you'll need the permission :<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />

In short, use

 adb shell am startservice <INTENT>

which starts your service that reads the URL

You're welcome.

Community
  • 1
  • 1
Reno
  • 33,594
  • 11
  • 89
  • 102