Discussion Forums  >  Uncategorized

Replies: 9    Views: 353

Swiss-Android
Android Fan
Profile
Posts: 10
Reg: Apr 11, 2011
Switzerland
100
04/30/11 09:23 AM (14 years ago)

External Browser

Hello, Ist it possible to use for a link the external browser? Regards Roger
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/01/11 10:06 PM (14 years ago)
Yes, it's possible. There are lots of ways to do this. Some are super-duper tough and others are easy. Probably the easiest way is to 'detect' a certiain URL or domain (part of a URL) and launch the external browser for some sites. Example: Launch the external browser if the domain is EXACTLY 'xyx.com/mypage.html' or launch the external browser for any URL that contains 'xyz.com' In your Android project, have a look at Act_ActivityBase.java in the /src folder. Scroll down to about line 138 and you'll see the start of this method: public void showCustomURL() This is the method that fires when you tap a menu item that loads a URL. In this method, you'll see a few places where the code is already launching the native browser. Example: If the URL contains the text youTubeVideo or youtube.com it flags useMyIntent = 0. This means, 'don't use the custom built in browser but instead us the native browser. This means you could add a block of code (copy-n-paste) that also checks for your special URL that you want to open in the native browser. hope this helps.
 
slater
Android Fan
Profile
Posts: 87
Reg: Aug 09, 2011
St. Pete FL
870
like
08/10/11 09:08 AM (14 years ago)
YA! thanks David! :-)
 
slater
Android Fan
Profile
Posts: 87
Reg: Aug 09, 2011
St. Pete FL
870
like
08/10/11 10:55 AM (14 years ago)
aww didnt seem to do the trick?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/12/11 01:19 AM (14 years ago)
Did you get it to find the URL you want to open in the native browser. This process (checking the URL then flaggin useMyIntent = 0 is super reliable. Maybe do some print-trace or something so you can see where it's breaking?
 
slater
Android Fan
Profile
Posts: 87
Reg: Aug 09, 2011
St. Pete FL
870
like
08/12/11 08:04 AM (14 years ago)
Got it working but let me explain what im trying to do better.. Im trying to get my rss feen to show in app browser then when it links to the actual page to open in useMyIntent = 0 I try to set if statements to if / .xmk and if / .rss but it still opened in native browser for both.. :-( any idea on how to work this?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/12/11 10:50 PM (14 years ago)
You cannot control the behavior after the URL opens in the native app...Android does. If you keep things in your app's browser then you can capture link taps, etc. So, you'll need to figure out why the app is loading your URL in the external, native browser. Then..the next step will be to capture each tap on the RSS list so you can open the native browser. But..wait a moment..if you're setting up an RSS screen, the RSS items are not being showed in a browser...they are being showed in the Screen_RSSReader.java file. This is not a browser, it's a complicated list. The browser is not used until after you tap a story. Have a look at the Screen_RSSReader.java file.
 
slater
Android Fan
Profile
Posts: 87
Reg: Aug 09, 2011
St. Pete FL
870
like
08/12/11 10:54 PM (14 years ago)
It was launching Dolphin browser just to view the rss feed after I messed with the code.. Is there a way I could modify the way the rss is shown? My goal is to get one particular rss to show full version.. The rss is outputing in full article mode but the screen is not viewing it. Only the teaser of it.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/12/11 11:13 PM (14 years ago)
Yeah, only a bit of the story is displyed. You'll need to tweak / adjust the list view and the layout files to expose more of the story. Have a look at the Adapter_RSSStory.java file, this is the file that controls each story in the list.
 
slater
Android Fan
Profile
Posts: 87
Reg: Aug 09, 2011
St. Pete FL
870
like
08/12/11 11:44 PM (14 years ago)
ok cool thanks much working on it now :-) will post results
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.