简体   繁体   English

Android / iOS:如何使用本机组件创建Web应用程序?

[英]Android/iOS: How to create a web-app, using native componentes?

I've a responsive designed web-project. 我有一个响应式设计的Web项目。 Everything works fine on mobile devices, but I'd like to create apps (Android/iOS) to use the native components like: 一切在移动设备上都可以正常运行,但是我想创建应用程序(Android / iOS)以使用本机组件,例如:

  • Camera 相机
  • GPS 全球定位系统
  • local storage 本地存储
  • Calendar 日历
  • push/pull 推拉

Is there any way to combine the web-app with native components without re-writing the entire existing project? 有什么方法可以将Web应用程序与本机组件结合起来,而无需重写整个现有项目?

Idea : 主意

  • create a native app 创建一个本机应用
  • use the native browser-component 使用本机浏览器组件
  • store the contents (HTML/CSS/Images/API-data) local 将内容(HTML / CSS / Images / API数据)存储在本地
  • show the local contents, if there's no connection 显示本地内容(如果没有连接)
  • store the made changes local (json) 将所做的更改存储在本地(json)
  • use native componentes (eg: make a photo, save it to a temp-folder, upload via browser onSync()) 使用本机组件(例如:制作照片,将其保存到临时文件夹,通过浏览器onSync()上传)
  • sync when internet-connection available 互联网连接可用时同步

I've not that much experience in app-development and would like to know the best-practices. 我在应用程序开发方面经验不足,并且想了解最佳实践。 Maybe there's a common framework that solves this problem? 也许有一个通用的框架可以解决这个问题?

Thanks a lot in advance! 在此先多谢!

B. B.

You can make a cross-platform app using framework like phoneGap for example. 您可以使用例如phoneGap之类的框架制作跨平台应用程序。

With his java script methods you can use the device native components. 使用他的Java脚本方法,您可以使用设备本机组件。

This is a tutorial for that. 这是一个教程

Hope that helps 希望能有所帮助

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

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