Questions tagged [library-project]

A project that will be compiled as a library

A project that will be compiled as a library.

In Android:

A library project is a standard Android project, so you can create a new one in the same way as you would a new application project.

To create a new library project:

1 - Select File > New > Project.
2 - Select Android > Android Application Project, and click Next.
3 - Enter the basic settings for the project, including Application Name, Project Name, Package Name, and SDK settings.
4 - In the Configure Project page, select the Mark this project as a library option to flag the project as a library.
5 - Set the other options as desired and click Next.
6 - Follow the instructions to complete the wizard and create a new library project.

You can also convert an existing application project into a library. To do so, simply open the Properties for the project and select the is Library checkbox

182 questions
73
votes
7 answers

Could not find Library.apk!

I managed to restructure my application pretty nicely so that, except for a few methods in a derived Activity class, everything is in a Library Project. It works beautifully, except that Eclipse's Console (not LogCat!) issues the following error…
an00b
  • 11,338
  • 13
  • 64
  • 101
54
votes
7 answers

how to reference an asset in a library project

In a class belonging to a Library project I call: webview.loadUrl("file:///android_asset/info.html", null); Unfortunately, this only works if I duplicate the file info.html into the Application's project asset folder as well. Is there a way to tell…
an00b
  • 11,338
  • 13
  • 64
  • 101
53
votes
3 answers

How to add a Library Project to a android project?

I have created a new android project. I want to have a action bar at the top so I downloaded the Action Bar for Android Library because I want to support devices from android 2.1. The description says The action bar component is an Library Project.…
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
53
votes
7 answers

Open source Android libraries? Reusable Views, ViewGroups, Adapters etc?

Here's what I really want: a site collecting re-usable components for Android. I have found various small lists, the biggest being the Open Intents library list. Mark Murphy (hi, Mark) also lists the library projects he publishes. None of this is of…
jamesh
  • 19,863
  • 14
  • 56
  • 96
46
votes
3 answers

Gradle: add dependency for a specific flavour of the library

I have a library project and a application. I'd like to have 2 product flavours (store, dev) for both library and application. When I build the store flavour for the application I want to use the store flavour from the library. Also when I build the…
amarkovits
  • 776
  • 1
  • 10
  • 17
26
votes
4 answers

How to use a library project in android studio

I have been trying to add this library project to my existing project in Android Studio. It's the first time I am going to use a library project and I am having tough time. I have looked around for many ways to do this from tutorials and posts…
dmSherazi
  • 3,743
  • 5
  • 37
  • 62
22
votes
6 answers

Build variants in Gradle for a Library Project in Android

I am trying to configure with Gradle a project which contains some external libraries. With Gradle I can setup different Environmental Configuration (with a class inside a config file) for the main application using the Build Variants so I can…
21
votes
2 answers

How to Convert an Android Library Project to an External JAR?

I have an Android library project that has been working for me pretty well, but now I am interested in "converting" it to an external JAR. How do I do that? Can any Android library project be converted to an external JAR? If not, what are the…
uTubeFan
  • 6,664
  • 12
  • 41
  • 65
21
votes
2 answers

Intermodule (library projects) communication in android application

In the below shown diagram, I am having 3 modules(as android library) which extends the base "common components module" and all this 3 modules will be added to a single android application. All 3 modules are independent modules but when it comes as…
Dinash
  • 3,027
  • 4
  • 32
  • 45
20
votes
3 answers

Cannot override library's xml resource with png resource in application?

I have an Android library MyLib containing everything I need for my app (targeting Android 2.2). This library has an XML resource: drawable/main_background.xml In my Application MyApp project I reference MyLib. Here I want to override specific…
l33t
  • 18,692
  • 16
  • 103
  • 180
17
votes
3 answers

Android Studio Library project error

I have imported a module into my project. When i rebuilt the project , AS gave me an error saying Warning:Dependency Lib:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. I searched and changed…
David
  • 906
  • 3
  • 11
  • 23
16
votes
5 answers

Using Activities from Library projects

I have a Library project set up and a project which depends on this library project - Everything compiles fine and I've had the Dependent project running fine however; I'm have an intermittent problem however while using an Activity from the Library…
Graeme
  • 25,714
  • 24
  • 124
  • 186
12
votes
2 answers

Starting Activity from Android-Library-Project

after a long search I couldn't find any appropriate solution. I have a Android-Library Project with nearly all code for the application. From the main activity in the library project I start an Intent to en explicit Activity A. In my derived…
11
votes
4 answers

How to Import Module without creating copy in Android Studio

I am using Android Studio 1.3.1 and trying to add library module to an existing android application. The library module is available in a git repository. I am able to import the module, but it creates a copy inside the existing app. Hence I am not…
Nirmalkumar
  • 251
  • 3
  • 12
10
votes
5 answers

ActivityNotFoundException (YES, this activity is declared in AndroidManifest.xml)

I found a few threads reporting a similar problem but none of them really offers something that I haven't tried already. An innocent such call: mActivity.startActivity(new Intent(mActivity, MyEditPreferences.class)); with the following in…
an00b
  • 11,338
  • 13
  • 64
  • 101
1
2 3
12 13