0

My app needs to use the in-built Internet Browser to render a web page.

How to do this kind of job?

fms
  • 2,147
  • 4
  • 18
  • 16
  • In your question title you mention the JDK, but it isn't mentioned in your question. What's does your question have to do with the JDK? – ThomasW Feb 27 '11 at 05:47
  • I'm using the android jdk to develop my app. – fms Feb 27 '11 at 05:51
  • @Javanator ,I just accepted many of them a while ago,but seems SO hasn't recalculated it... – fms Feb 27 '11 at 06:26
  • @fms thats good and this the way stackoverflow works. The answer posted below my @samuh is correct . follow the thread mention in the answer and if it helps you then dont forget to accept it – Rohit Sharma Feb 27 '11 at 06:58
  • @Javanator ,seems not,I don't see any logic that chooses which browser to use to render the web page... – fms Feb 27 '11 at 07:09

1 Answers1

2

Launch an Intent with ACTION_VIEW action and pass the URL of your website as Intent data.
This thread might help.

Community
  • 1
  • 1
Samuh
  • 36,316
  • 26
  • 109
  • 116
  • I don't see there is the logic to control which browser to use ...In my case,only the **Internet Browser** will render it correctly... – fms Feb 27 '11 at 07:08
  • 1
    `ACTION_VIEW` is a generic intent; `IntentResolver` will display a chooser Activity to the User in case there are multiple caterers for handling the data. So, if there are multiple browsers user will be given an option to choose from one. – Samuh Feb 27 '11 at 07:11
  • @sms yes i think you should leave it to choose any available browser. instead of specifying any perticualr. because that could differ in different devices – Rohit Sharma Feb 27 '11 at 07:14
  • But the web page can only be rendered correctly by the **Internet Browser**,and my end users have no technical background,so I need to do this programmatically for them.. – fms Feb 27 '11 at 07:22
  • @Javanator ,the **Internet Browser** is shipped with each android phone so it's fine.. – fms Feb 27 '11 at 07:34
  • @fms : if you want a specific Application to be invoked, like in your case the Browser app, create a `Component` that identifies the `com.android.browser` package and set it in the Intent object. Note that however, if that component is not found in any device(even due to a name change), your Intent might go unresolved. – Samuh Feb 28 '11 at 03:44