I want to get the current url the browser has in the address bar using any of the possible ways:
- adb
- python
- perl
Thanks
Get the URL of current browser on the Phone ?
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.