Framework7 app doesnt load in android webview


#1

i’ve downloaded f7 single view template

and created an android webview app to load the web inside the app … but it wont show up
it shows any other web app fine … just not f7 apps
obviously there is something missing here … i should do something to load f7 inside android webview
anyone has done this before ? am i missing something ?

btw im not using cordova or any other lib … just a simple webview … here is my MainActivity.js … im using api 16

package com.zarinbet.zarinb;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {

    public WebView webview ;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        webview = (WebView)findViewById(R.id.MainWebView);
        webview.setWebViewClient(new WebViewClient());
        webview.getSettings().setJavaScriptEnabled(true);
        webview.getSettings().setAllowFileAccessFromFileURLs(true);
        webview.getSettings().setAllowUniversalAccessFromFileURLs(true);

        webview.loadUrl("http://10.0.2.2/framework7/");



    }
}

#2

Do you mean white page and finish loading, error or keeps loading?


#3

thee is no error just a blank page , there is no error i enabled the device remote debug and checked the execution in chrome while it was running in android device … no error even the console.log that i put after f7 code was executed without problem


#4

ok i stil dont know what the problem is but for anyone who has this problem i solved it by using cordova to create a webview ( i used inappbrowser plugin )

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>
<script type="text/javascript" charset="utf-8">
	document.addEventListener('deviceready', function() {
			  var url = 'http://10.0.2.2/framework7'
		cordova.InAppBrowser.open(url, '_self', 'location=no');
	}, false);
</script>
</div>
<script type="text/javascript" src="cordova.js"></script>
</body>
</html>

#5

Whenever I had problems whitescreen on Android was incorrect plugin, fullscreen mode or statusbar …

Verify your file config.xml try compile for VHD Android Studio and Google Chrome.

Sorry for my bad english!