问题
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
- Native Application
- Web Application
- 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