本文介绍了在Android上,渐进式Web应用程序与本机应用程序具有哪些功能,反之亦然的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

2015年,Google推出了开发适用于Android的网络应用程序的新方法:

硬件访问包括




  • - 支持绝大多数浏览器
  • 通过与
  • 相机和麦克风即将推出 APIs

  • 设备

  • screen



  • 即将到来的硬件访问



    这些功能正在实施中,或者已经在某些浏览器中有效: / p>


    • 蓝牙通过 API


    • ( +)

    • (在Firefox 48 +)

    • ,和传感器访问




    另外需要注意的是,框架(
  • 出现在应用程序列表中,感谢 - 渐进式Web应用程序现在可以打包成实际可安装的Android软件包!

  • 启动全屏

  • 或 - 检查一些,或的基准测试比较了本机和WebGL渲染性能,

    用户在任何浏览器中选择的文件

  • b

    >这些功能涵盖了很多用例,现在很多流行的本地应用程序都可以重写为PWA。以松弛为例。它的开源替代品,。有关更多PWA演示,请参见。



    来自PWA的本地特征




    • - 例如,或者成为,例如一个PWA聊天应用程序,接收图像设置为用户的头像


    ,PWA目前缺乏


    • 联系人,日历和浏览器书签访问权限(缺少对这些访问权限的访问权限可以视为由隐私意识的用户)

    • 闹钟

    • - 截取短信或电话,发送短信/彩信,获取用户的电话号码,阅读语音邮件,拨打电话,而无需拨号对话框
    • 低级访问某些硬件功能和传感器:手电筒,大气压力传感器

    • 系统访问:任务管理,修改系统设置,日志

      $ b渐进式网络应用程序提供了以下功能:本机应用程序缺少 可以很容易地被搜索引擎找到,但是像StackOverflow这样以内容为中心的原生应用程序不会在应用程序商店的搜索结果中显示它提供访问的内容,例如pwa vs. native。对于像Reddit这样的社区来说,这是一个问题,它不能将他们众多的子社区作为单独的应用展示给应用商店。
    • 页面/屏幕可以有一个直接的链接,可以很容易地共享
    • bookmarkability - 保存该链接直接访问应用程序的视图
    • 永远都是新鲜的 - 无需通过应用商店推送更新

    • 通用访问 - 不受应用程序限制商店或(无意)。

    • 发行的低摩擦力 - 如果您的渐进式网路应用程式在线,则Android(及其他手机)使用者。





    In 2015 Google introduced a new approach for developing web apps for Android: progressive web apps. One can create an application that will look like a native application, will be able to use device's hardware like camera and accelerometers, receive push notifications, have a launcher icon, work in offline, store local data, etc.

    On Android, what features do native apps provide that progressive web apps do not support, and vice versa.

    解决方案

    TL;DR - As of Feb 2017, Progressive Web Apps are a sufficiently powerful platform that Twitter has moved all of their mobile web traffic to a React PWA.

    As of August 2016, Progressive Web Apps actually offer more hardware access than commonly thought. Here's a screenshot of whatwebcando.today from my Chrome 52 stable on Android:

    Hardware access includes

    Upcoming hardware access

    These features are being implemented or already work in some browsers:

    Another important point to note is that the Origin Trials Framework (implemented in Chrome) enables manufacturers to expose and test hardware (or software) capabilities without having to go through the standardization process. For example, a phone maker could expose an API for reading the values of a pressure sensor, refine it, then submit it for consideration to the W3C.

    Besides hardware access, there are also software features traditionally employed by native apps that are now available to web apps.

    Traditionally native features that PWAs can also use

    These features cover a lot of use cases, and many popular native apps nowadays could be rewritten as PWAs. Take Slack, for example. Its open source alternative, Rocket.Chat, is building a PWA version. For more PWA demos, see https://pwa.rocks.

    Native-like features coming to PWAs

    Native Android features that PWAs currently lack

    • contacts, calendar and browser bookmarks access (lack of access to these could be viewed as a feature by privacy-conscious users)
    • alarms
    • telephony features - intercept SMSes or calls, send SMS/MMS, get the user's phone number, read voice mail, make phone calls without the Dialer dialog
    • low-level access to some hardware features and sensors: flashlight, atmospheric pressure sensor
    • system access: task management, modifying system settings, logs

    Progressive Web Apps offer features that native apps lack

    • discoverability - content in progressive web apps can easily be found by search engines but a content-centric native app like StackOverflow won't show among app store search results for content that it does offer access to, such as "pwa vs. native". This is a problem for communities like Reddit, which can't expose their numerous sub-communities to the app store as individual "apps".
    • linkability - any page/screen can have a direct link, which can be shared easily
    • bookmarkability - save that link to access an app's view directly
    • always fresh - no need to go through the app stores to push updates
    • universal access - not subject by app stores sometimes arbitrary policies or (unintended) geographic restrictions
    • large data savings, extremely important in emerging markets with expensive and/or slow Internet access. For example, e-commerce website Konga cut data usage by 92% for the first load by migrating to a PWA.
    • low friction of distribution - if your progressive web app is online, it's already accessible for Android (and other mobile) users.

    这篇关于在Android上,渐进式Web应用程序与本机应用程序具有哪些功能,反之亦然的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 00:23