为 Android 构建启动器

发布于 2024-11-29 09:04:51 字数 3410 浏览 1 评论 0原文

我目前正在尝试修改 Android 2.2 froyo Home 应用程序。首先,我必须获取原始版本,对其进行编译并部署。

我认为这个应用程序称为 Launcher2。

我首先得到它:

git clone git://android.git.kernel.org/platform/packages/apps/Launcher2.git

可用的标签:

$ git tag

android-2.0.1_r1
android-2.0_r1
android-2.1_r1
android-2.1_r2
android-2.1_r2.1p
android-2.1_r2.1p2
android-2.1_r2.1s
android-2.2.1_r1
android-2.2.1_r2
android-2.2.2_r1
android-2.2_r1
android-2.2_r1.1
android-2.2_r1.2
android-2.2_r1.3
android-2.3.1_r1
android-2.3.2_r1
android-2.3.3_r1
android-2.3.3_r1.1
android-2.3.3_r1a
android-2.3.4_r0.9
android-2.3.4_r1
android-2.3.5_r1
android-2.3_r1
android-adt-0.9.8
android-adt-0.9.9
android-cts-2.1_r2
android-cts-2.1_r3
android-cts-2.1_r4
android-cts-2.1_r5
android-cts-2.2_r1
android-cts-2.2_r2
android-cts-2.2_r3
android-cts-2.2_r4
android-cts-2.2_r5
android-cts-2.2_r6
android-cts-2.2_r7
android-cts-2.3_r1
android-cts-2.3_r2
android-cts-2.3_r3
android-cts-2.3_r4
android-cts-2.3_r5
android-sdk-2.0.1-docs_r1
android-sdk-2.0.1_r1
android-sdk-2.0_r1
android-sdk-2.1_r1
android-sdk-2.2_r1
android-sdk-2.2_r2
android-sdk-2.3.4_r1
android-sdk-adt_r12
android-sdk-tools_r12
android-sdk-tools_r3
android-sdk-tools_r4
android-sdk-tools_r5
android-sdk-tools_r6
android-sdk-tools_r7

我切换到 android-2.2_r1:

$ git checkout android-2.2_r1

Note: checking out 'android-2.2_r1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 279302e... Merge branch 'froyo' into froyo-release

现在,如果我尝试使用 Eclipse 构建代码,我会遇到很多错误。引起我注意的是,这个 Launcher2 使用的是“android.renderscript”,该脚本仅在 Api 级别 11 后可用(renderscript 参考) - Froyo 的 Api 级别为 8。

$ grep -R renderscript *

src/com/android/launcher2/AllApps3D.java:import android.renderscript.Allocation;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.Element;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.ProgramFragment;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.ProgramStore;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.ProgramVertex;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.RSSurfaceView;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.RenderScriptGL;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.RenderScript;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.Sampler;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.Script;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.ScriptC;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.SimpleMesh;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.Type;

我想我的结帐一定有问题。从Api-Levels,我猜我签出的版本一定是针对的安卓3.0!

任何帮助解决这个问题都会很棒!

I'm currently trying to modify Android 2.2 froyo Home app. To begin, I must get the original, compile it and deploy it.

I think that this app is called Launcher2.

I started by getting it:

git clone git://android.git.kernel.org/platform/packages/apps/Launcher2.git

The available tags:

$ git tag

android-2.0.1_r1
android-2.0_r1
android-2.1_r1
android-2.1_r2
android-2.1_r2.1p
android-2.1_r2.1p2
android-2.1_r2.1s
android-2.2.1_r1
android-2.2.1_r2
android-2.2.2_r1
android-2.2_r1
android-2.2_r1.1
android-2.2_r1.2
android-2.2_r1.3
android-2.3.1_r1
android-2.3.2_r1
android-2.3.3_r1
android-2.3.3_r1.1
android-2.3.3_r1a
android-2.3.4_r0.9
android-2.3.4_r1
android-2.3.5_r1
android-2.3_r1
android-adt-0.9.8
android-adt-0.9.9
android-cts-2.1_r2
android-cts-2.1_r3
android-cts-2.1_r4
android-cts-2.1_r5
android-cts-2.2_r1
android-cts-2.2_r2
android-cts-2.2_r3
android-cts-2.2_r4
android-cts-2.2_r5
android-cts-2.2_r6
android-cts-2.2_r7
android-cts-2.3_r1
android-cts-2.3_r2
android-cts-2.3_r3
android-cts-2.3_r4
android-cts-2.3_r5
android-sdk-2.0.1-docs_r1
android-sdk-2.0.1_r1
android-sdk-2.0_r1
android-sdk-2.1_r1
android-sdk-2.2_r1
android-sdk-2.2_r2
android-sdk-2.3.4_r1
android-sdk-adt_r12
android-sdk-tools_r12
android-sdk-tools_r3
android-sdk-tools_r4
android-sdk-tools_r5
android-sdk-tools_r6
android-sdk-tools_r7

I switched to android-2.2_r1:

$ git checkout android-2.2_r1

Note: checking out 'android-2.2_r1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 279302e... Merge branch 'froyo' into froyo-release

Now, if I try to building the code using Eclipse I get lots of erros. One that got my attention was that this Launcher2 is using the "android.renderscript" that is only available since Api level 11 (renderscript reference) - Froyo is Api level 8.

$ grep -R renderscript *

src/com/android/launcher2/AllApps3D.java:import android.renderscript.Allocation;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.Element;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.ProgramFragment;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.ProgramStore;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.ProgramVertex;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.RSSurfaceView;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.RenderScriptGL;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.RenderScript;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.Sampler;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.Script;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.ScriptC;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.SimpleMesh;
src/com/android/launcher2/AllApps3D.java:import android.renderscript.Type;

I guess that my checkout must have something wrong. From Api-Levels, I guess that the version I checkeout must be for Android 3.0!

Any help solving this would be great!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北城半夏 2024-12-06 09:04:51

实际上,RenderScript 存在于 2.2 中(Google 动态壁纸使用它,显然家庭应用程序也使用它),它只是不是公共(所以它不是 SDK 的一部分 - 它只能使用通过内部应用程序)。

他们用很多应用程序来做到这一点。例如,我曾经尝试从 AOSP 构建音乐应用程序,但因类似问题而失败(我缺少一些不在 SDK 中但在源代码中的包)。我没有时间去弄清楚,所以我停在那里。

不过,我有一些建议给您:

  1. 获取整个平台源代码并包含所有依赖项(RenderScript,以及此后您发现缺少的任何其他内容);
  2. 看一下 Home 示例 - 它并不像实际的 2.2 启动器,但它应该为您提供一个起点。

Actually, RenderScript is present in 2.2 (the Google live wallpapers use it, and apparently the home app as well), it's just not public (so it's not part of the SDK -- it can only be used by internal apps).

They do this with a lot of apps. For example, I once tried to build the Music app from the AOSP and failed with a similar issue (I was missing some package that was not in the SDK but was in the source). I didn't have the time to figure it out so I stopped there.

However, I have a couple of suggestions for you:

  1. Get the entire platform source code and include all dependencies (RenderScript, and whatever else you find missing after that);
  2. Have a look at the Home sample -- it's not as complete as the actual 2.2 launcher, but it should give you a starting point.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文