• <i id='CGsOJ'><tr id='CGsOJ'><dt id='CGsOJ'><q id='CGsOJ'><span id='CGsOJ'><b id='CGsOJ'><form id='CGsOJ'><ins id='CGsOJ'></ins><ul id='CGsOJ'></ul><sub id='CGsOJ'></sub></form><legend id='CGsOJ'></legend><bdo id='CGsOJ'><pre id='CGsOJ'><center id='CGsOJ'></center></pre></bdo></b><th id='CGsOJ'></th></span></q></dt></tr></i><div id='CGsOJ'><tfoot id='CGsOJ'></tfoot><dl id='CGsOJ'><fieldset id='CGsOJ'></fieldset></dl></div>

  • <small id='CGsOJ'></small><noframes id='CGsOJ'>

    <tfoot id='CGsOJ'></tfoot>

        <bdo id='CGsOJ'></bdo><ul id='CGsOJ'></ul>
    1. <legend id='CGsOJ'><style id='CGsOJ'><dir id='CGsOJ'><q id='CGsOJ'></q></dir></style></legend>

        将网站转换为 Android 应用程序

        Convert a website to an android application(将网站转换为 Android 应用程序)
        <tfoot id='KewpS'></tfoot>
          <bdo id='KewpS'></bdo><ul id='KewpS'></ul>

          <i id='KewpS'><tr id='KewpS'><dt id='KewpS'><q id='KewpS'><span id='KewpS'><b id='KewpS'><form id='KewpS'><ins id='KewpS'></ins><ul id='KewpS'></ul><sub id='KewpS'></sub></form><legend id='KewpS'></legend><bdo id='KewpS'><pre id='KewpS'><center id='KewpS'></center></pre></bdo></b><th id='KewpS'></th></span></q></dt></tr></i><div id='KewpS'><tfoot id='KewpS'></tfoot><dl id='KewpS'><fieldset id='KewpS'></fieldset></dl></div>

            <legend id='KewpS'><style id='KewpS'><dir id='KewpS'><q id='KewpS'></q></dir></style></legend>
          1. <small id='KewpS'></small><noframes id='KewpS'>

              <tbody id='KewpS'></tbody>

                  本文介绍了将网站转换为 Android 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我用 asp.net C# 建立了一个站点.视觉工作室 2010.

                  I built a site in asp.net C#. Visual Studio 2010.

                  该网站可以很好地扩展,适合我的手机和其他 Android 设备.它也是数据库驱动的.我现在想从我的网站上为安卓市场制作一个应用程序.免费应用.

                  The site scales nicely and fits on my phone and other Android divices. It database driven also. I want to make an app for the android market out of my site now. Free app.

                  我可以轻松做到这一点吗?应用程序可以像启动浏览器窗口一样简单吗?安卓市场会接受这样的应用吗?

                  Can i easily accomplish this? Can a app be as simple as launching a browser window? Will the android market accept an app like that?

                  请指出正确的方向.我不确定从哪里开始.

                  Point me in the right direction please. Im unsure where to start.

                  推荐答案

                  您所描述的可以使用 WebView 轻松完成.

                  What you describe can be easily accomplished using a WebView.

                  WebView(来自 android 开发者) :显示网页的视图.这个类是你可以滚动你自己的网络浏览器或简单地在你的活动中显示一些在线内容的基础.它使用 WebKit 渲染引擎来显示网页,并包括在历史记录中向前和向后导航、放大和缩小、执行文本搜索等等的方法.

                  WebView (from android developers) : A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more.

                  这是一个简单的示例应用:

                  Here's a simple sample app:

                  public class WebActivity extends Activity {
                  
                      WebView mWebView;
                  
                      @Override
                      public void onCreate(Bundle savedInstanceState)
                      {
                          final Activity mActivity = this;
                          super.onCreate(savedInstanceState);
                  
                          // Adds Progrss bar Support
                          this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
                          setContentView(R.layout.main);
                  
                  
                          // Makes Progress bar Visible
                          getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
                  
                          mWebView = (WebView) findViewById( R.id.webview );
                          mWebView.getSettings().setJavaScriptEnabled(true);     
                          mWebView.loadUrl(http://your.url.com);
                  
                  
                          mWebView.setWebChromeClient(new WebChromeClient() 
                          {
                              public void onProgressChanged(WebView view, int progress)  
                              {
                                  //Make the bar disappear after URL is loaded, and changes string to Loading...
                                  mActivity .setTitle("Loading...");
                                  mActivity .setProgress(progress * 100); //Make the bar disappear after URL is loaded
                  
                                  // Return the app name after finish loading
                                  if(progress == 100)
                                  {
                                      financialPortalActivity.setTitle(R.string.yourWebSiteName);
                                  }
                              }
                          });
                      }
                  }
                  

                  还有一个非常简单的布局文件:main.xml

                  and a very simple layout file: main.xml

                  <?xml version="1.0" encoding="utf-8"?>
                  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent"
                      android:orientation="vertical">
                  
                      <WebView 
                          android:id="@+id/webview"
                          android:layout_width="fill_parent"
                          android:layout_height="fill_parent"
                      />
                  </LinearLayout>
                  

                  当然,您必须在清单中设置权限:

                  Of course you will have to set a permission in your Manifest:

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

                  这篇关于将网站转换为 Android 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Android - Is it possible to get install referrer programmatically(Android - 是否有可能以编程方式安装引荐来源网址)
                  How to sign an APK with more than one certificate?(如何使用多个证书签署 APK?)
                  versionCode vs versionName in Android Manifest(Android Manifest 中的 versionCode 与 versionName)
                  What does this Google Play APK publish error message mean?(这个 Google Play APK 发布错误消息是什么意思?)
                  Lost my keystore for uploaded app on android market(丢失了我在 android 市场上上传的应用程序的密钥库)
                  App on Google Play always shows quot;Updatequot; instead of open(Google Play 上的应用程序总是显示“更新;而不是打开)
                    <tfoot id='jIo7t'></tfoot>
                          <bdo id='jIo7t'></bdo><ul id='jIo7t'></ul>
                        • <legend id='jIo7t'><style id='jIo7t'><dir id='jIo7t'><q id='jIo7t'></q></dir></style></legend>
                          <i id='jIo7t'><tr id='jIo7t'><dt id='jIo7t'><q id='jIo7t'><span id='jIo7t'><b id='jIo7t'><form id='jIo7t'><ins id='jIo7t'></ins><ul id='jIo7t'></ul><sub id='jIo7t'></sub></form><legend id='jIo7t'></legend><bdo id='jIo7t'><pre id='jIo7t'><center id='jIo7t'></center></pre></bdo></b><th id='jIo7t'></th></span></q></dt></tr></i><div id='jIo7t'><tfoot id='jIo7t'></tfoot><dl id='jIo7t'><fieldset id='jIo7t'></fieldset></dl></div>
                              <tbody id='jIo7t'></tbody>

                            <small id='jIo7t'></small><noframes id='jIo7t'>