How can I get the current page's url of the web browser?

by Dorothy » Wed, 16 Apr 2008 13:52:39 GMT


Sponsored Links
 Hi all,

Could someone tell me how to access the current page's content or url
of the web browser from another android application?

Thanks a lot. :)

D
--~--~---------~--~----~------------~-------~--~----~



How can I get the current page's url of the web browser?

by Megha Joshi » Thu, 17 Apr 2008 19:00:20 GMT


 Hi,

You can use WebView's getUrl() method to retrieve a URL for the current
page:
 http://code.google.com/android/reference/android/webkit/WebView.html #getUrl()< http://code.google.com/android/reference/android/webkit/WebView.html #getUrl%28%29>

Thanks,
Megha





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How can I get the current page's url of the web browser?

by Dorothy » Fri, 18 Apr 2008 12:12:46 GMT


 I've tried:

String[] mColumnStrings =
        { Browser.SearchColumns._ID,
                Browser.SearchColumns.URL,
                Browser.SearchColumns._COUNT,
                Browser.SearchColumns.DATE
        };

Cursor c = getContentResolver().query(Browser.SEARCHES_URI,
        mColumnStrings, null, null, null);

But the return is always null, I don't understand...

Someone can help me?

Thanks

D
--~--~---------~--~----~------------~-------~--~----~



How can I get the current page's url of the web browser?

by Dorothy » Fri, 18 Apr 2008 15:06:48 GMT


 Hi, Megha

It seems to me that WebView is to create a new browser in a
application. That's not exactly what I want.
I wonder if I can get the current page from the default web browser, I
want my application just to listen to the default browser and to do
something when the current page interests me. Will that be possible?
I've found android.provider.Browser, but I didn't find the way to get
the current uri yet.

Thanks,

D
--~--~---------~--~----~------------~-------~--~----~



How can I get the current page's url of the web browser?

by Megha Joshi » Fri, 18 Apr 2008 18:59:34 GMT


 Hi,

It is not possible to get information from one application to another,
unless exposed by contentproviders, due to security concerns.
Browser.SEARCHES_URI only returns strings the user puts in the GOTO box and
picks Google Search. To get all the urls visited, you could use
Browser.BOOKMARKS_URI.

Thanks,
Megha





--~--~---------~--~----~------------~-------~--~----~



How can I get the current page's url of the web browser?

by Dorothy » Mon, 21 Apr 2008 08:22:44 GMT


 Thanks Megha, it's very nice of you.

Hv a nice day :)
--~--~---------~--~----~------------~-------~--~----~



How can I get the current page's url of the web browser?

by Dorothy » Mon, 21 Apr 2008 08:25:38 GMT


 Thanks Megha, that's very nice of you.

Hv a nice day :)
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How test the openCORE on Android Emulator?

Dear All

I am trying to integrate my codec on the ARM side using my own OMX core.
Now I would like to test it on the Android Emulator using the Eclipse
and Android SDK. I would like to know,

1. Tool chain used to compile openCore
2. How to set up Android Emulator to test my latest openCore (after
integrating the Codec)?

Thank you for the help

Regards,
-Vishwa

--~--~---------~--~----~------------~-------~--~----~

2. Self-Updating Package?

I'm looking for ideas on how to have a package that is not distributed
through the Android Market (it's in closed Beta) upgrade itself.

I had hoped to download the .apk file from my web server and then use
PackageManager.installPackage(), but that requires the
INSTALL_PACKAGES permission, which is apparently not available to
packages not installed in /system/app.

Best idea I have now is to launch an Intent to download the .apk (via
web browser), but that would require the user to then manually install
the package, which is unkind.

Other ideas?

-Timo

--~--~---------~--~----~------------~-------~--~----~

3. My Log messages fails to appear on Logcat View

4. OpenCore bug: nOffset in OMX Buffer header

5. Touch event types supported in android v/s windows mobile

6. How can enable settings programmatically?

7. Save the background image