简体   繁体   English

在没有phonegap的情况下将Web应用程序部署到android

[英]deploying web app to android without phonegap

I am deploying my Sench touch 2 app to android. 我正在将Sench touch 2应用程序部署到android。 I am using PhoneGap to do it. 我正在使用PhoneGap做到这一点。 It works fine but is slow. 它工作正常,但速度较慢。 I was trying to deploy the app without PhoneGap to a embedded Webview. 我试图将不带PhoneGap的应用程序部署到嵌入式Webview。

I get the app running but it doesn't get past the sencha loading screen. 我使该应用程序运行,但没有超过sencha加载屏幕。

here my MainActivity 这是我的MainActivity

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        WebView myWebView = (WebView) findViewById(R.id.webView1);
        WebSettings webSettings = myWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setAllowFileAccess(true); // i was trying this, dont know if i need it
        myWebView.loadUrl("file:///android_asset/www/index.html");
    }
}

here is my layout: 这是我的布局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true" />

</RelativeLayout>

These are the permissions I have enabled 这些是我已启用的权限

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

I cant seem to figure out what I am missing. 我似乎无法弄清楚我所缺少的。 Is there something special i have to do to make this run? 我需要做些特别的事情来使它运行吗?

Oh and LogCat dosent show any thing ... 哦,LogCat剂量显示任何东西...

If you're not planning on calling any native code (except via Ext.Device), you could also use package your Sencha app using Sencha SDK Tools/ Sencha CMD. 如果您不打算调用任何本机代码(通过Ext.Device除外),则还可以使用Sencha SDK Tools / Sencha CMD打包您的Sencha应用程序。

Documentation at: 文档位于:
http://docs.sencha.com/touch/2-0/#!/guide/native_android http://docs.sencha.com/touch/2-0/#!/guide/native_android

Please note Sencha SDK Tools recently got updated to Sencha CMD, for more information and further documentation see the blogpost on the release here: 请注意,Sencha SDK工具最近已更新到Sencha CMD,有关更多信息和更多文档,请参见此处发布的博客文章:
http://www.sencha.com/blog/all-new-sencha-cmd/ http://www.sencha.com/blog/all-new-sencha-cmd/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM