Jquery Mobile Web: Is Calling Native Apps possible?

你。 提交于 2019-12-12 12:32:26

问题


I want to be able to touch a link on a mobile web page and have it launch a native mobile App, like Skype, for example. This seems like it would be a huge security problem, but I wonder if the mobile environment somehow allows this?

EDIT: YES! It works. a javascript call to document.window = "myapp://myparam" works great! Or for example, the following works:

document.window = "skype://";

The trick is knowing the name of the app.


回答1:


No a mobile web page will not allow this but there are some alternatives.

When building a mobile application, you have 3 choices

  1. Native Application
  2. Web Application
  3. Hybrid Application

The first option is not device agnostic as you would need to program specifically for each device.

The second option does not give you the ability to access the Native device controls (at least not yet with HTML5)

The final option is to write a simple wrapper application in the Native Language and render a browser within. This can allow for the best of both worlds. Majority of Content is built as a web app but certain features can use the native language.

Here are two of those Hybrid Approaches

  • PhoneGAP http://phonegap.com/
  • WoprkLight http://www.worklight.com


来源:https://stackoverflow.com/questions/10791961/jquery-mobile-web-is-calling-native-apps-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!