简体   繁体   English

如何从另一个Android项目访问库类

[英]how to access library class from another android project

Hi I am working with android.I had created a library project. 嗨,我正在使用android.I创建了一个库项目。 Now I integrated it with my new app. 现在,我将其与新应用程序集成在一起。 Now how can I access the library main class to my new project ??? 现在如何访问图书馆主类到我的新项目?

Its depend on your Library project. 它取决于您的图书馆项目。 How you have create it. 您如何创建它。 Mean pure java file or you have use some other resources also. 意味着纯Java文件,或者您还使用了其他资源。

Simply refer official document here. 只需在这里参考官方文件。 & Other reference link is here . &其他参考链接在这里

You can use that Class using importing package , Like i have one lib and i have added as lib project and i am importing that lib package as below. 您可以使用import package来使用该Class,就像我有一个lib并且我已经添加为lib project一样,并且我正在按如下方式导入该lib包。

import chintan.khetiya.android.my_custom_lib.*;

If you have use <activity>, <service>, <receiver>, <provider>, and so on, as well as <permission>, <uses-library>, any of these then you have to add all of these in your real project. 如果您使用过<activity>, <service>, <receiver>, <provider>, and so on, as well as <permission>, <uses-library>,则必须将所有这些添加到您的真实的项目。 See For More Details 查看更多详细信息

If you use eclipse; 如果您使用日食;

Right click your project in "Project Explorer" view, than open window select "Android" tab left side. 在“项目资源管理器”视图中右键单击您的项目,然后在打开的窗口左侧选择“ Android”选项卡。 At right side bottom container you will see "add button" click and select project. 在右侧底部的容器中,您将看到“添加按钮”单击并选择项目。

""Your library and project in same workspace."" “”您的库和项目在同一工作区中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从位于同一 android 项目的另一个文件夹中的另一个 class 访问变量? - How to access variables from another class that are in another folder of the same android project? 从库类访问主项目类 - Access the main project class from a library class Android-如何从另一个访问课程内容? - Android - How to access class content from another? 从另一个Android库项目引用Android库项目 - Reference Android Library project from another android library project android库项目中的类扩展了根项目中的另一个类 - Class in android library project extending another class in root project Android Eclipse:如何从另一个项目引用库项目的NDK库? - Android Eclipse: How to reference library project's NDK library from another project? 从另一个Android调用另一个项目类? - calling another project class from another android? Android Robolectric Library类支持。 如何从应用程序项目加载库类R引用 - Android Robolectric Library class support. How to have library class R references load from application project 从Android库项目覆盖类 - Overriding a Class from Android Library Project 如何从另一个图书馆访问图书馆? - How to access a library from another library?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM