Discussion Forums  >  WebViews and HTML for Mobile

Replies: 13    Views: 176

Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
03/24/13 06:36 AM (11 years ago)

link to other buzztouch screens from html android

OK. Been searching but can't seem to find a clear answer. Is it possible to make a link or button in an HTML screen launch another buzz touch screen in an android app and how is it done? Thanks
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/24/13 07:56 AM (11 years ago)
I don't think so. There is a creative workaround for iOS 6.0, but I don't think the same capability exists on Android. Although, I have a theory that might be worth exploring if someone has time. Html in both iOS and Android is simply html code loaded in a webview. The html code could really be thought of as a string. And the app should be able to see what that code/string is. So, if you could set up some type of listener to check for changes in the webview's code, you theoretically could set up a button in the html page that goes to a blank page with a single line of text (such as "load screen A"). Then set up your listener to see if the change in the webview content matches "load screen A" and if so, perform an action. I have no clue whether this will work or not, I'm just thinking on the fly. Another possibility is to check for changes in the webView's url and have the html button go to a specified page (aka url) that would trigger an action in the main app.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/24/13 08:00 AM (11 years ago)
Just did a quick search and found this which may prove promising... http://stackoverflow.com/questions/2219556/how-do-i-listen-for-something-in-webview-android
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/24/13 08:04 AM (11 years ago)
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/24/13 08:23 AM (11 years ago)
Thanks. How about forgetting that and making a link launch the native browser instead of loading it insidethe webview?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/24/13 08:25 AM (11 years ago)
Sure you could do that too. In fact, the Custom URL plugin already has that code in there I believe. If you needed to make an HTML link launch the native web browser, then you'd need to use my approach above.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/24/13 08:46 AM (11 years ago)
OK so if I host an HTML doc in the app and use custom URL to load it then links inside the HTML doc will launch in native browser? This would be great. Will give it a try. Thanks
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/24/13 10:14 AM (11 years ago)
It gives the option to the user - you could apply the code to the oncreate method to do it automatically I would think
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/24/13 10:19 AM (11 years ago)
I tried using custom URL to load a webpage and set document behavior to show launch in native app button but nothing shows. It just loads clicked link in the URL screen. How do I add it to the on create? Thanks for your help :)
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/24/13 10:58 AM (11 years ago)
I see now that there is button to launch in native app when we press the menu button to bring up the options. The only problem with that is it still loads the webpage inside the custom URL screen and as I amlinking to outside websites it is my understanding that this could be copyright iinfringment. So is there any way to automatically launch any link that is clicked with the native browser so it does not load inside URL screen. Thanks
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/24/13 11:16 AM (11 years ago)
Well I admit I haven't used that function on Android before, let alone looked at its code
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/24/13 11:22 AM (11 years ago)
OK thanks. I imagine it should be possible if the load in native app button can somehow be automatically selected when a link is clicked but I would not know how. Is it 100% against copyright to show webpages inside custom URL? It is after all nothing more than a web browser so I am not sure.
 
Mr stuck
Android Fan
Profile
Posts: 974
Reg: Apr 09, 2012
Fife, Scotland
15,740
like
03/24/13 11:40 AM (11 years ago)
Just another thought. Is it possible to have a map pin that when clicked gives 3 buttons instead of 2. Let's say website link, directions and the OK button
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
03/25/13 09:36 AM (11 years ago)
I think copyright law is untested in this area. Other apps do it though. Be clear about where its coming from though. As for maps, I'd make a new thread - I haven't worked much with maps yet, but I know it's possible.
 

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.