Hosting an IONIC project to access with a WebView

I tryed to upload my IONIC 3 test app to a server (all files in www folder) and load it on my Android device.

I would like to do an android app (using Android Studio) with a WebView component to load the address: http://www.smartbit.inf.br/add (it is an Ionic app)

If a load it using Chrome on my android device, it opens well. But on my WebView app it stay blank and do not opens.
What am I doing wrong?
Does Ionic could be used for this purpose?

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android Look at the console and network tabs for errors.

When you run ionic cordova run android it also builds an app with Cordova that includes a Webview and displays the app. You know about that?

Thank you,
Actually I’m not having a problem with Ionic
I hosted my Ionic project on a server and am accessing from my mobile using Chrome, and it works perfectly fine. (I uploaded all files from www folder to my server at http://www.smartbit.inf.br/add)
My problem is that I want to load it my own WebView that I developed in Android Studio and it does not open.

How did you build your app on the command line?

Doesn’t load for me unfortunately.

Why do you have your own Webview instead of using Cordova that is well integrated with Ionic? (which is of course valid - I am just asking for details).

I did not make any special build, I just execute: cordova run android --device
To test it on Device, and it runs very well. Then I saw that it makes files in www folder, so I uploaded all this files to my web server and try to access by Chrome :slight_smile:
I am very begginer in Ionic
Thank you again

I wrote wrong the address, the correct is http://www.smartbit.inf.br/app
Sorry

You should run ionic build (if you have a recent Ionic CLI verson - please post your ionic info output) and then copy /www over. The build you copied was made for Android, but as you saw it still works.

Your problem is probably related to your native app with the WebView. My guess would be that it is not allowed to download and execute some files - that is why Ionic uses Cordova for native apps, there this is automatically taken care of or easy to take care of.

So even though this is not related to Ionic in any way, some advice:

Did you remote debug the problem on the device already?
Follow these instructions here to debug the problem in Safari dev tools: https://ionic.zone/debug/remote-debug-your-app#ios
Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android
Look at the console and network tabs for errors.

What I want to do is to develop with Ionic all my project and host it on my web server and make a fake app some webview.
At moment I am studying how to do it and making some app tests.

And to make my fake app on android I tried to do with Android Studio. But if you have sudggestions it will be very welcomed.
cli packages: (C:\ionic\ionreddit\node_modules)

@ionic/cli-plugin-cordova       : 1.6.2
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils                : 1.7.0
ionic (Ionic CLI)               : 3.7.0

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.6.0

System:

Node : v6.11.2
OS   : Windows 10
npm  : 3.10.10

Why not just use the normal “hybrid app” you can build with ionic cordova build android? This is also just a webview displaying the site, but from a local file that doesn’t have to be downloaded.

(By the way: What you are currently planning can very well be declined from Apple for the AppStore if you need iOS.)

1 Like

Hello rbamorim40,

Do you get any solution for this?