创建Android应用程序,作为快捷方式,我们的移动网站快捷方式、应用程序、网站、Android

2023-09-04 23:38:37 作者:带沵去俬逩

我们有专门的手机版我们网站,我们希望推动Android市场。在应用程序将有效地成为该网站的快捷方式,但你可以下载它,并有一个图标它,就像任何其他应用程序。

We have a special mobile version of our site that we would like to promote in the android marketplace. The "app" would effectively be a shortcut to the website, but you would be able to download it and have an icon for it, just like any other app.

这可能吗?如果是这样,你能联系我的指令?我无法找到任何信息,谷歌搜索。

Is this possible? If so, can you link me to instructions? I was not able to find any info searching google.

谢谢, 约拿

推荐答案

这是可能的,相当容易的。

This is possible and fairly easy.

您的应用程序将是一个单独的活动。这项活动将创建一个基于信息这里对谷歌的意图了新的意图。中的意图将是类型VIEW_ACTION和你给它一个URL作为值。然后,你会简单地做:

Your application would be a single Activity. That activity would create a new intent based on the info here on the google intents. The intent would be of type VIEW_ACTION and you'd give it an url as a value. Then you'd simply do:

onCreate(Bundle bundle){
 Intent myIntent = new Intent(Intent.VIEW_ACTION, Uri.parse("http://www.google.com"));
 startActivity(myIntent); 
}

演习剩下的就是包装,与AndroidManifest.xml中,并把它推向市场。

The rest of the exercise is just wrapping that with the AndroidManifest.xml and putting it into the market.

另一种方法是提供一个web视图,但,这就是pretty的毫无意义的,如果你的网站的目的是在移动浏览器中已经发挥作用。

The alternative would be to provide a webview, but, thats pretty pointless if your website is designed to function in a mobile browser already.