Android Wing of mucchin | how to launch the browser passes the URL from the Android app



How to launch the browser passes the URL from the Android app


From the Android apps that you have created yourself, to launch the browser can pass the URL you want to connect?

Android has a mechanism called and Intent (Intent).
Is a mechanism of cooperation can be carried out (. It may be easier to grasp said during a later screen) Activity between the (activity).
You can call originating phone apps and by this mechanism, are present in the original Android phone, and a GoogleMap.
Of course, as is the browser.
It will come with us for quite different when you can or can not be, it is possible to realize in the Android app.
I think because I wanted to be that Android apps I wanted to create first, called to launch the browser passes the URL, if you do not this can be done, and did not even study for Android app probably I ·.


So, how to invoke a browser from Android application.
You only need to run the following code.


Uri uri = Uri.parse ("http://android.roof-balcony.com/");
Intent i = new Intent (Intent.ACTION_VIEW, uri);
startActivity (i);


For example, if the app is such that the above code is executed when the button is pressed, press the button, you can connect to the URL to launch the browser, set in the first line as follows.
How to launch the browser passes the URL from the Android app
Thanks to this intent that class (Intent), you can easily and other activities, cooperation with the app.
I'll also this is one of the charms of Android.

Add this entry to Hatena bookmark

There is no comment for this entry.

Comment from here




You can use the following tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> < del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Next »

«Previous