Android的:如何创建启动 [英] Android: How to create a launcher

查看:150
本文介绍了Android的:如何创建启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有为Android开发之前,所以,当你回答,请考虑我100%哑:)

I've never developed for Android before, so please consider me 100% dumb when you answer :)

我想创建一个应用程序启动,这将打开默认的Web浏览器指定的URL。 换句话说,我想打一个图标与我的网站标志,当你点击它,它会打开该网站在默认Web浏览器。

I would like to create an application launcher that will open the default web browser to a given url. In other words, I want to make an icon with my website logo, and when you click on it, it opens the site in your default web browser.

可能有人直接我对一个教程/文档页面来实现这一目标? 或者,如果它真的很简单,也许能让我看看一些code在这里?

Could someone direct me towards a tutorial/documentation page to achieve this? Or if it's really simple, maybe show me some code here?

感谢您的时间!

P

推荐答案

如果我明白你需要正确的,你可以只创建一个简单的应用程序只有1活动,并在OnCreate坚持这样的:

If I understand what you need correctly, you could just create a simple app with just 1 activity and stick this in the onCreate:

Intent viewIntent = new Intent("android.intent.action.VIEW", Uri.parse("http://www.yourwebsite.com"));  
startActivity(viewIntent);

这是创建一个简单的应用程序的一些资源:

And here are some resources on creating a simple app:

<一个href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/HelloWorld.html">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/HelloWorld.html

这里是你如何设置你的应用程序图标的一些信息:

And here is some info on how you can set your app icon:

http://www.connorgarvey.com/blog/?p=97

这篇关于Android的:如何创建启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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