将 Android 应用 (.apk) 集成到现有的 Android 项目中 [英] Integrate an Android app (.apk) into an existing Android project

查看:65
本文介绍了将 Android 应用 (.apk) 集成到现有的 Android 项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用例如下:

我和一个朋友正在构建一个 Android 应用程序,并希望与它集成一个游戏.该应用程序的核心已在 Eclipse 中构建,但我们正在考虑使用 Google AppInventer 等应用程序构建工具构建游戏(http://appinventor.googlelabs.com/about/) 或 Corona(http://www.anscamobile.com/corona/).我们希望我们构建的现有应用有一个像玩游戏"这样的按钮,该按钮将启动我们使用这些实用程序之一构建的游戏.

A friend and I are building an Android app and along with it want to integrate a game. The core of the app has been built in Eclipse but we are looking into building the game with an app building tool like Google AppInventer (http://appinventor.googlelabs.com/about/) or Corona (http://www.anscamobile.com/corona/). We'd like the existing app we've built to have a button like "Play Game" which will launch the game we build using one of these utilities.

但是,当我使用 Google App Inventor 时,我注意到我只能将项目导出为 .apk,它们是二进制文件.理想情况下,我会在 AppInventor 中构建应用程序,导出源代码并将包添加到我们在 Eclipse 中的现有项目中.嗯,这并不容易,因为我们只能访问 .apk 文件.所以我的问题是这可以做到吗?怎么样?

However when I messed around with Google App Inventor I noticed that I could only export the project as a .apk, which are binary files. Ideally, I'd build the app in AppInventor, export the source code and add the package to our existing project in Eclipse. Well, it's not that easy since we only have access to a .apk file. So my question is can this be done? How?

有些人建议使用 apk 反编译器,但这是否值得?是否有任何好的 apk 反编译器可以让我们访问一些源代码(java 文件、xml 文件、资源)而不会太头疼?有没有其他工具可以导出源代码?还有其他方法可以集成 2 个单独的 .apk 吗?

Some have suggested using an apk decompiler, but would this even be worth it? Are there any good apk decompilers that will give us access to some source code (java files, xml files, resources) without too big of a headache? Is there another tool out there that can export source code? Any other way to integrate 2 separate .apks?

或者我们需要构建 2 个单独的应用程序吗?:(

Or will we need to build 2 separate apps? :(

推荐答案

在 App Inventor 中编写的项目无法导出到 Eclipse.

A project written in App Inventor cannot be exported into Eclipse.

创建的 .apk 文件不是二进制文件.它是几个文件和文件夹的 ZIP 存档,但它们都不是 java 代码.

The created .apk file is not a binary file. It is a ZIP archive of several files and folders, but none of them is java code.

将 App Inventor 应用程序与使用 Android SDK 创建的应用程序结合起来的方法是利用 App Inventor 中的 ActivityStarter 组件.详细信息在这里:http://appinventor.googlelabs.com/learn/reference/other/activitystarter.html

What can be done to combine an App Inventor app with an app created with Android SDK is to make use of the ActivityStarter component inside App Inventor. Details on that are here: http://appinventor.googlelabs.com/learn/reference/other/activitystarter.html

最后,请记住 App Inventor 应用不能直接上传到市场.然而,一些用户创建了一个允许这样做的过程,它被称为 Marketizer.

Finally, keep in mind that App Inventor apps cannot be uploaded directly to the Market. However, some users have created a process that allows to do that, it is called Marketizer.

如果您花一些时间阅读以下论坛的帖子:programming-with-app-inventor(这是一个 Google Groups 论坛),您可能会得到更好的想法.

If you spend some time reading posts from this forum: programming-with-app-inventor (it is a Google Groups forum), you might get even better ideas.

这篇关于将 Android 应用 (.apk) 集成到现有的 Android 项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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