Android的:如何创建可重用的组件? [英] Android: How do I create reusable components?

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

问题描述

我已经花了,而淘净的某种这方面的资料,但都无济于事。

I've spent a while scouring the net for some sort of information on this, but to no avail.

我工作了,我需要创造一些组件,其中一些很可能有其他应用程序的应用程序,所以我想将它们放在自己的包或项目,但我不知道是什么要做到这一点,正确的做法是。

I'm working on an app for which I needed to create some components, some of which would be likely to have other applications, so I'd like to put them in their own package or project, but am not sure what the correct way to do this is.

所以我的主要项目被称为像...

So my main project is called something like...

<公司名称方式><&产品名称GT;

<companyname>.<productname>

和我叫包我的小部件

&LT;&公司名称GT; .widget

<companyname>.widget

我创建的小部件一个单独的项目,并提出相关的code,布局,资源等了。该项目似乎正确编译,但主要项目不再识别该部件的任何引用。

I created a separate project for the widgets and moved the relevant code, layout, resources etc over. That project seems to compile properly, but the main project no longer recognises any references to the widgets.

我添加了新的Widget项目,主要项目上的项目引用,但是这并没有区别。

I added the new widget project to the main project's Project References, but that made no difference.

任何意见或链接教程如何正确地做到这一点会更AP preciated。

Any ideas or links to tutorial on how to do this correctly would be much appreciated.

推荐答案

您是否尝试过建立一个库项目?
http://developer.android.com/intl/fr/guide /developing/eclipse-adt.html

Have you tried setting up a library project ? http://developer.android.com/intl/fr/guide/developing/eclipse-adt.html

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

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