0

Over the last 18 months I've written an extensive Fashion Retail Business Management suite in php, html and Javascript.

However, I am a complete beginner with Android.

I have the Dev Clover Station, and I'm trying to setup a basic webview so I can test accessing part of our Web app from the clover station. I'm presented with an error message on the Clover Station, when I run the app.

"Web Page not available" followed by a standard message you might see on any browser. The URL is correct, and the web site is working fine.

I notice there is no Browser app available on the Dev Station App Market, I sincerely hope Clover is not blocking access to the internet from the Dev Station. If so, how might I test my apps?

Thanks Robin

asked 2017-03-15 13:40:07 -0500

Robin W gravatar image

3 answers

Sort by  
0

@Robin W you should be able to do this.

Can you please share your code?

Do you have internet permission in your manifest? <uses-permission android:name="android.permission.INTERNET" />

answered 2017-03-15 21:44:58 -0500

Voski gravatar image
0

I'm going to repost the answer that @Sam provided via email, in case it comes in handy for others.

Publicly accessible browsers are not supported on our devices due to compliance reasons but you can use webviews. https://developer.android.com/referen...

The simplest way to do this would be to set the entire Activity window as a WebView during onCreate()

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); WebView webview = new WebView(this); setContentView(webview); webview.loadUrl("http://www.example.com/"); }

While we allow for WebViews, we encourage that all native Android Application best practices be followed as closely as possible so that experience does not feel like a WebView. An important one would be using OAuth to automatically sign into your application using the device auth token. https://github.com/clover/android-examples/tree/master/gettoken

Best, Sam

answered 2017-03-15 18:36:04 -0500

rachel gravatar image
Comments

Thanks, however this didn't address the problem I mentioned. With both my original code, and with the code Sam suggested, I am presented with a "Web Page not available" message on the Clover Station.

The site I am trying to access is "http://www.google.com"

Both versions of the app will load the Google website from an emulator on my PC.

Are you confident that there is a channel to the internet from a "development" Clover Station ?

Thanks Robin

Robin W gravatar image
Robin W 2017-03-15 20:16:53 -0500

Hi Voski, I missed your reply, and yes, that's exactly how I did it. Thanks

Robin W gravatar image
Robin W 2017-03-16 08:20:32 -0500
0

Ok I figured it out. In addition to the code suggested above by Sam the following line is required in the AndroidManifest.xml file

<uses-permission android:name="android.permission.INTERNET"/>

I assume this gives the necessary permissions to the app to use the internet.

phew ..that was an ordeal. thanks for everyone's help.

answered 2017-03-15 22:44:39 -0500

Robin W gravatar image