Android and iOS mobile app that points to web app URL

落花浮王杯 提交于 2020-01-07 03:54:09

问题


Goal

Let's say I have a fully responsive web app that's hosted at, say, http://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.

Question

  • What is the procedure for doing this?
  • Are there any tools out there that make this simple?

Clarification

This StackOverflow answer says:

This is how you do it for Android:

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

This is how you do it for iOS:

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

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

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


回答1:


Summary from comments:

  1. $ cordova create myProject
  2. Open config.xml
  3. Change index.html to http://www.example.com

Here is the Cordova documentation.

Also, note that to use the CLI you must first install the SDKs for your target platforms. Click here for the platform guides documentation.

Breaking news: This doesn't work.




回答2:


Here is a good video that explains how to do this by going into Android SDK and doing everything manually.

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

Here is a link to the code.

http://bitly.com/1wZTLxK



来源:https://stackoverflow.com/questions/33624419/android-and-ios-mobile-app-that-points-to-web-app-url

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