如何重新构建默认的“启动器”应用?
我的目标是修改Launcher应用程序并动态修改和更改主题。
我在 http://www.cyrket.com 上看到了几个“家庭”应用程序/p/android/com.stain46.taghome/。看来他们采用了默认的主页(启动器)并对其进行了修改。他们是怎么做到的?我需要修改什么才能达到同样的效果?
My goal is to modify the Launcher application and dynamically modify and change the theme.
I saw several 'home' apps at http://www.cyrket.com/p/android/com.stain46.taghome/. It looks like they took the default Home(Launcher) and modified it. How did they do that? What do I need to modify to achieve the same thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经使用 ICS 启动器完成了此操作。您还需要进行大量代码更改才能将其编译为普通应用程序,因为它使用了大量私有内部 API(尽管 Google 可能暗示了这一点)。您还需要更改包名称。我发现有两个限制:
有一个名为 TableMaskFilter 的过滤器不适用于普通应用程序。我认为这允许应用程序抽屉是半透明的,但我删除了它的使用,我认为它看起来不错。
更重要的是,似乎无法复制小部件添加体验,因为它需要只有系统应用程序才能拥有的权限。 查看这个问题。
无论如何,我把我的来源此处。它可以在官方 Galaxy S2 4.0.3 上编译并运行,但如果您尝试添加小部件,它会崩溃。
请注意,当您更改包名称时,Eclipse 的重构不会注意到某些地方(例如 XML 布局)。我建议您进行全局文本搜索/替换。
I have done this with the ICS launcher. You also need to do quite a number of code changes to get it to compile as a normal app because it uses a lot of private internal APIs (despite what Google may have implied). You also need to change the package name. There are two limitations I've found:
There's a filter called TableMaskFilter that isn't available to normal apps. I think this allows the app drawer to be semi-transparent, but I removed uses of it and it looks fine I think.
More critically, it appears there is no way to replicate the widget-adding experience because it requires a permission that only system apps can have. See this question.
Anyway, I put my source here. It compiles and works on the official Galaxy S2 4.0.3, but if you try to add widgets it will crash.
Note, when you're changing the package name, there are places that Eclipse's refactor doesn't notice (e.g. XML layouts). I recommend you do a global text search/replace instead.
标准的 Launcher 是开源的,因此您绝对可以获取并修改它你想要的方式。为了将您的应用程序用作主屏幕,您需要指定正确的 AndroidManifest.xml 中的意图过滤器,用户在按下主页按钮时必须选择您的应用程序。为什么不抓住该代码,使用它,当您有更多问题并且对要更改的内容有了更多了解时再回来。
The standard Launcher is open source so you can definitely grab it and modify it the way you want. For your app to be used as the Home Screen you will need to specify the correct Intent filter in your AndroidManifest.xml and the user will have to choose your app when they press the Home button. Why don't you grab that code, play with it and come back when you have more questions and more of an idea of what you want to change.
在这里,我找到了一个稳定版本 Launcher2,
我已经分享了 GitHub 存储库。 此处
此项目的 WIKI:
此项目包含 Android Jelly Bean 附带的 Launcher 应用程序的代码(API 16)。
需要对该源代码进行一些小的更改才能删除私有 API 的使用。这些更改已标记为“// AOSP Change”
Here i found one stable version Launcher2
I have sharing that GitHub repo. HERE
WIKI of this project :
This project contains the code for the Launcher app that ships with Android Jelly Bean (API 16).
Some minor changes were required from this source code to remove the use of private APIs. These changes have been marked by "// AOSP Change"