Java in webView

I can’t get a website to display properly as it requires Java. I can not figure out how to get Java to run inside a webView. Help would be appreciated.

local webView = native.newWebView( 0, 0, display.contentWidth, display.contentHeight ) webView.x = display.contentWidth \* 0.5 webView.y = display.contentHeight \* 0.5 webView:request( "http://keephd.com/about/" ) local function webListener( event ) if event.url then print( "You are visiting: " .. event.url ) end if event.type then print( "The event.type is " .. event.type ) -- print the type of request end if event.errorCode then native.showAlert( "Error!", event.errorMessage, { "OK" } ) end end -- Called when a key event has been received. local function onKeyEvent( event ) -- Print which key was pressed down/up to the log. local message = "Key '" .. event.keyName .. "' was pressed " .. event.phase print( message ) if (system.getInfo("platformName") == "Android") then if (event.keyName == "back") and (event.phase == "down") then webView:back() return true end end -- Return false to indicate that this app is \*not\* overriding the received key. -- This lets the operating system execute its default handling of this key. return false end -- Add the key event listener. Runtime:addEventListener( "key", onKeyEvent ); webView:addEventListener( "urlRequest", webListener )

When you say Java are you referring to Java proper, like a Java Applet, or JavaScript, the HTML scripting language?   They are different things.  JavaScript should work.  A Java applet will not likely work.  I’ll ask engineering to be doubly sure, but Java usually needs a plugin to run and webViews generally don’t support plugins as they are not a full web browser.

Rob

It tells me to install java in order to download YouTube video. It gives me the link to install java. I’m assuming it needs JavaScript but no YouTube downloading sites work with corona’s webView

JavaScript and Java are two totally different things.  JavaScript should work.  Are you building for Android or iOS?  Are you trying to make this work on the Simulator?

The Business App sample plays YouTube videos.  Perhaps you could try running it and see if you have the same issue:

https://github.com/coronalabs/business-app-sample

Rob

Java applets wont run on iOS (JavaScript works just fine but this a completely unrelated thing aside from the first 4 letters of the name).

http://stackoverflow.com/questions/2368166/can-i-run-a-webpage-embedded-java-applet-on-the-iphones-web-browser

You can’t do this on Android either (which is a little more surprising).

Well poo, Alright thanks for letting me know, you have a great community here at Corona :wink:

Did you try the Business App Sample?

There is no need. Besides, come to think of it there are plenty of YouTube downloading apps on Android already. It seems the only working way is to use YTSDK but I don’t know Java much.

I’m curious I never picked a best answer why does it say I already picked the best answer?

Dunno. 

When you say Java are you referring to Java proper, like a Java Applet, or JavaScript, the HTML scripting language?   They are different things.  JavaScript should work.  A Java applet will not likely work.  I’ll ask engineering to be doubly sure, but Java usually needs a plugin to run and webViews generally don’t support plugins as they are not a full web browser.

Rob

It tells me to install java in order to download YouTube video. It gives me the link to install java. I’m assuming it needs JavaScript but no YouTube downloading sites work with corona’s webView

JavaScript and Java are two totally different things.  JavaScript should work.  Are you building for Android or iOS?  Are you trying to make this work on the Simulator?

The Business App sample plays YouTube videos.  Perhaps you could try running it and see if you have the same issue:

https://github.com/coronalabs/business-app-sample

Rob

Java applets wont run on iOS (JavaScript works just fine but this a completely unrelated thing aside from the first 4 letters of the name).

http://stackoverflow.com/questions/2368166/can-i-run-a-webpage-embedded-java-applet-on-the-iphones-web-browser

You can’t do this on Android either (which is a little more surprising).

Well poo, Alright thanks for letting me know, you have a great community here at Corona :wink:

Did you try the Business App Sample?

There is no need. Besides, come to think of it there are plenty of YouTube downloading apps on Android already. It seems the only working way is to use YTSDK but I don’t know Java much.

I’m curious I never picked a best answer why does it say I already picked the best answer?

Dunno.