Android和iOS移动应用程序指向Web应用程序URL [英] Android and iOS mobile app that points to web app URL

查看:249
本文介绍了Android和iOS移动应用程序指向Web应用程序URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个完全响应的网络应用,例如, http://example.com

Let's say I have a fully responsive web app that's hosted at, say, http://example.com.

现在,我想为 Android 构建一个移动应用程序 iOS 只是指向 我的网络应用。即,当用户打开应用程序时,它会将它们导航到example.com,就是这样。

Now, I want to build a mobile app for Android and iOS that just points to my web app. i.e., When the user opens the app, it navigates them to example.com and that's it.


  • 执行此操作的步骤是什么?

  • 是否有任何工具可以解决这个问题?

此StackOverflow答案说


这就是你为Android做的事情:

This is how you do it for Android:



Intent browserIntent = new Intent(Intent.ACTION_VIEW,                                                         Uri.parse("http://www.google.com"));
context.startActivity(browserIntent);




这是你为iOS做的:

This is how you do it for iOS:



[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];

但这个问题是要求 简单程序 。也许用Cordova,Android SDK,Xcode等类似的CLI?

But this question is asking for a simple procedure. Perhaps with a simple CLI for Cordova, Android SDK, Xcode or something similar?

例如,此页表示您可以从以下命令行访问Android SDK工具: / Users /< user> / Library / Android / sdk /

For example, this page says you can access Android SDK tools from a command line at: /Users/<user>/Library/Android/sdk/.

推荐答案

这是一个很好的视频,通过进入Android SDK并手动完成所有操作来解释如何执行此操作

https://youtu.be/LzlNP9nS6fo?t=11m1s

以下是代码链接

http://bitly.com/1wZTLxK

这篇关于Android和iOS移动应用程序指向Web应用程序URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆