简体   繁体   English

IOS和Android应用程序是否只考虑Webview混合或Web应用程序?

[英]Are IOS & Android Apps with Webview Only Considered Hybrid, or Web Apps?

My confusion is whether an app created in Java or Swift with just a webview is considered a Hybrid, or Web App. 令我困惑的是,用Java或Swift创建的仅使用webview的应用程序是否被视为混合或Web应用程序。 I understand that a Web App use the web almost exclusively, but if it's a webview through a Java Webview is it really considered a Web App or is it a hybrid app because it has the potential to use both native and Web App features? 我知道Web应用程序几乎完全使用Web,但如果它是通过Java Webview的Webview,它真的被认为是Web应用程序,还是混合应用程序,因为它有可能同时使用本机和Web App功能? I get mixed definitions about this particular definition. 我对这个特定的定义有不同的定义。

Google says this about web app: 谷歌说这是关于网络应用程序:

There are essentially two ways to deliver an application on Android: as a client-side application (developed using the Android SDK and installed on user devices in an APK) or as a web application ( developed using web standards and accessed through a web browser—there's nothing to install on user devices ). 在Android上提供应用程序主要有两种方式:作为客户端应用程序(使用Android SDK开发并安装在APK中的用户设备上)或作为Web应用程序( 使用Web标准开发并通过Web浏览器访问 -用户设备上没有任何东西可以安装 https://developer.android.com/guide/webapps/index.html https://developer.android.com/guide/webapps/index.html

Apple says this about web apps: Apple说这是关于网络应用程序:

A web application is designed to look and behave in a way similar to a native application—for example, it is scaled to fit the entire screen on iOS. Web应用程序的设计外观和行为方式与本机应用程序类似 - 例如,它可以缩放以适应iOS上的整个屏幕。 You can tailor your web application for Safari on iOS even further, by making it appear like a native application when the user adds it to the Home screen. 您可以进一步为iOS上的Safari定制Web应用程序,方法是在用户将其添加到主屏幕时使其看起来像本机应用程序。 You do this by using settings for iOS that are ignored by other platforms. 您可以通过使用其他平台忽略的iOS设置来完成此操作。

https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html

Why is this important to me & why do I bother asking? 为什么这对我很重要?为什么我要打扰? I need to explain to people the differences and importance between these three when talking about future development of a new app I am creating. 在谈论我正在创建的新应用程序的未来发展时,我需要向人们解释这三者之间的差异和重要性。 I am new to the app world and don't quite understand the consensus on this and I want to sound competent when I explain it. 我是应用程序世界的新手,并不太了解对此的共识,我想在解释它时听起来很有能力。 I would consider an Java or Swift made App with a Webview just a Web App and not a Hybrid app. 我认为使用Webview的Java或Swift应用程序只是一个Web应用程序而不是混合应用程序。 But it could become a Hybrid App if more was added. 但如果添加更多内容,它可能会成为混合应用程序。 However I can see it being a Hybrid App from the start. 但是从一开始我就可以看到它是一个混合应用程序。

Since I worked on it, I could share my own understanding about this topic: 自从我开始研究以来,我可以分享自己对这个主题的理解:

Hybrid apps : These are developed using Web technologies like HTML5, CSS and typically Programmed using JavaScript. 混合应用程序 :这些应用程序是使用HTML5,CSS等Web技术开发的,通常使用JavaScript编程。 Next, in order for them to be able to distribute using Google Play store or App Store, they are build using mobile framework such as PhoneGap or Cordova . 接下来,为了使他们能够使用Google Play商店或App Store进行分发,他们使用PhoneGapCordova等移动框架进行构建。 This result in generation of apk file for android and ipa for iOS. 这导致为android生成apk文件,为iOS生成ipa These files then can be deployed and distributed through Google Play store or App Store. 然后,可以通过Google Play商店或App Store部署和分发这些文件。

So, it has things of both world : 所以,它有两个世界的东西:

  1. Same code base for both android and ios(as they are developed using HTML/CSS/JS) and 2. Native-app like distribution model which used Google Play store or App Store. android和ios的代码库相同(因为它们是使用HTML / CSS / JS开发的)和2.使用Google Play商店或App Store的Native-app类似的分发模型。 Hence the Name Hybrid. 因此名称混合。

Web Apps : These are essentially accessed through a web browser—there's nothing to install on user devices like a apk or ipa file. Web应用程序 :这些基本上是通过Web浏览器访问的 - 没有什么可以安装在用户设备上,如apkipa文件。 These are not distributed using Google Play store or Apple Store. 这些不是使用Google Play商店或Apple Store分发的。 Instead, can be accessed using the Device's Web browser and appropriate URLs 相反,可以使用设备的Web浏览器和相应的URLs

About WebView It is the widget provided by Operating system which allow apps to display the web pages within an app. 关于WebView它是操作系统提供的小部件,允许应用程序在应用程序中显示网页。

So, if you develop say, an Android app, using Standard Android SDK but it uses nothing but a WebView , it is considered as a Native app (and Not a Hybrid or web app) because it is using the Native SDK Component( WebView ). 所以,如果你开发一个Android应用程序,使用标准Android SDK但它只使用WebView ,它被认为是Native应用程序 (而不是混合或Web应用程序),因为它使用的是Native SDK Component( WebView ) 。 Also, it will be distributed through Google Play store or App Store. 此外,它将通过Google Play商店或App Store分发。

WEBVIEW Introduction WEBVIEW简介

Webview allows 3rd party apps to show content in an in-app browser or in an app screen that pulls from the web. Webview允许第三方应用在应用内浏览器或从网络中提取的应用屏幕中显示内容。

Android Webview is a component of Android where you can load HTML pages either from the local (assets directory) or from the web. Android Webview是Android的一个组件,您可以从本地(资产目录)或从Web加载HTML页面。

Android WebView allows you to convert a web page to your android application either by viewing URL or your own HTML markup page. Android WebView允许您通过查看URL或您自己的HTML标记页面将网页转换为您的Android应用程序。

Wep Apps Wep应用程序

In Android you using WebApps, when you don't want to integrate any functionality of Android . 在Android中你使用WebApps,当你不想集成Android的任何功能时。

You fully depend on your Web pages like (HTML,CSS , JAVASCRIPT ,etc). 您完全依赖于您的网页(HTML,CSS,JAVASCRIPT等)。

That means there is no diffenece in your Website and Mobile Apps. 这意味着您的网站和移动应用程序没有任何区别。

This is basic example of WebApps..... 这是WebApps的基本示例.....

Add these 2 permission in manifest file.... 在清单文件中添加这2个权限....

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

activity_web.xml activity_web.xml

<?xml version="1.0" encoding="utf-8"?>
<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/web"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />

</RelativeLayout>

WebActivity..... WebActivity .....

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

public class WebActivity extends AppCompatActivity {

    private WebView mWeb;

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

        mWeb = (WebView) findViewById(R.id.web);
        mWeb.setWebViewClient(new MyBrowser());         
        mWeb.getSettings().setLoadsImagesAutomatically(true);
        mWeb.getSettings().setJavaScriptEnabled(true);     
        mWeb.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        mWeb.loadUrl("https://www.google.co.in/");

    }

    @Override
    public void onBackPressed() {          //this is use for the accessing or impleament back button
        if (mWeb.canGoBack())
            mWeb.goBack();
        else
            super.onBackPressed();
    }
}

MyBrowser..... MyBrowser .....

import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MyBrowser extends WebViewClient {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        return true;
    }
}

Hybrid Apps 混合应用

In Hybrid Apps We can implement only specfic works of WebPages. 在混合应用程序中我们只能实现WebPages的特定工作。

Hybrid Apps Advantages.... 混合应用优势....

User Inteface is more attractive....... 用户界面更具吸引力.......

Work on offline mode......... 在离线模式下工作.........

Getting user more information (like Mobile informations). 获取用户更多信息(如移动信息)。

And more about the usage ........ 更多关于用法........

Storages of files (like :- images ,video,etc)............ 存储文件(如: - 图像,视频等)............

In Hybrid Apps we are implemented some specfic pages like... 在混合应用程序中,我们实现了一些特定页面,如...

Payment Gatways ...... 付款Gatways ......

Ours Own Advertisment (its takes lot of memory to store images and video in android)........ 我们自己的广告(它需要大量的内存来存储Android中的图像和视频)........

and more ......... 和更多 .........

That is all i know about WEBVIEW ........ 这就是我对WEBVIEW的了解........

enjoy coding........ 喜欢编码........

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

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