Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在webview中使用AngularJS的Android应用程序_Android_Hybrid Mobile App - Fatal编程技术网

在webview中使用AngularJS的Android应用程序

在webview中使用AngularJS的Android应用程序,android,hybrid-mobile-app,Android,Hybrid Mobile App,我如何使用AngularJS和H5构建Android原生/混合应用程序,而不使用PhoneGap或Cordova,只是Android布局文件中的简单webview 请提供一些参考:)任何AngularJS web应用程序在网络视图中运行良好 要在WebView中运行网站,只需执行以下操作 final WebView containerWbVw = findViewById(R.id.fragment_wbVw_container_id); WebSettings webSettings = co

我如何使用AngularJS和H5构建Android原生/混合应用程序,而不使用PhoneGap或Cordova,只是Android布局文件中的简单webview


请提供一些参考:)

任何AngularJS web应用程序在
网络视图中运行良好

要在
WebView
中运行网站,只需执行以下操作

final WebView containerWbVw = findViewById(R.id.fragment_wbVw_container_id);
WebSettings webSettings = containerWbVw.getSettings();
webSettings.setJavaScriptEnabled(true);
containerWbVw.setWebChromeClient(new WebChromeClient());
然后在
WebView
中使用

containerWbVw.loadUrl(WEBAPP_URL);
WEBAPP\u URL
可以是资产文件夹中的HTML页面,也可以托管在服务器上

//assets folder file
WEBAPP_URL = "file:///android_asset/main.html";
//server link
WEBAPP_URL="https://mysite.mycompany.com/myapp";

除此之外,您还需要与本机android应用程序交互以发送和接收数据。例如,一个用例是使用设备的摄像头获取扫描的条形码。为此,您需要一个。

所以我需要创建html文件并放入资产文件夹&调用加载url?但是我的angular代码将如何运行呢