Questions tagged [android-library]

An Android library project is a development project that holds shared Android source code and resources. Other Android application projects can reference the library project and, at build time, include its compiled sources in their .apk files.

An Android library project is a development project that holds everything needed to build an app, including source code, resource files, and an Android manifest. However, instead of compiling into an APK that runs on a device, an Android library compiles into an Android Archive (AAR) file that can be used as a dependency for an Android app module.

Android Team started revamping the whole design of Android library project since SDK r14 and is going to move from source-based mechanism to compiled-code based library mechanism, in order to support distributing Android library project as a single self-contained jar file. More details in their official blog.

A library module is useful in the following situations:

  • When you're building multiple apps that use some of the same components, such as activities, services, or UI layouts.
  • When you're building an app that exists in multiple APK variations, such as a free and paid version and you need the same core components in both.

Useful links

1883 questions
0
votes
1 answer

Send an image with MultipartEntityBuilder and HttpURLConnection

I am trying to send an image to a server using MultipartEntityBuilder and HttpURLConnection, and then recieve a String answer (nowadays it uses http protocol but then I will do it with https using this code, or something very similar). But when I…
0
votes
2 answers

Using activities from library

I'm creating my first library to use in some future projects, on it I'm creating some Activities that are the same on every project. Right now I'm working with a test project and on my library I have this LoginActivity. It has it's own layout and…
Rafael
  • 1,437
  • 6
  • 23
  • 41
0
votes
0 answers

How to solve the error of Error(25,13) in android studio?

I have tried to add a dependency in the gradle.build file :- compile 'com.prolificinteractive:material-calendarview:1.4.2' but i am constantly getting the Error(25,13) :failed to resolve . I have tried solving it using a few techniques like adding…
lmgguy
  • 89
  • 2
  • 8
0
votes
1 answer

Creating new module as android library. New seeing package R cannot be resolved

My objective is to create multiple modules for my existing application. So I created a new module --> android library and separated out all the files and folders into the appropriate java and res folder Now I am seeing that there is no R.java being…
Katakam Nikhil
  • 1,375
  • 4
  • 14
  • 22
0
votes
0 answers

Is fabric CrashLytics appropriate for released Applications?

I am developping an Application that manipulates a lot of images and i am using Fabric Crashlytics (a library that report App bugs using internet) in debug mode. I want to know if i have to compile Crashlytics in the release version too. is it…
0
votes
1 answer

Why does an Android app project have to include a package used by a library

An Android app uses a library (aar module) that uses "com.google.gson.Gson". The library has the following in its build.gradle: compile 'com.google.code.gson:gson:2.6.2' The app builds fine, but generates the following error when it starts: Failed…
Hong
  • 17,643
  • 21
  • 81
  • 142
0
votes
1 answer

I can't use Dart and Henson on android studio 2.2.3v

When i use https://github.com/f2prateek/dart i already added to gradle dependencies { annotationProcessor 'com.google.dagger:dagger-compiler:2.4' compile 'com.f2prateek.dart:henson:2.0.1' provided…
0
votes
0 answers

How to import PouchDroid library into android studio from github?

I am new to PouchDroid. I am developing and offline android application. I want to add PouchDroid to my project. I have already followed this steps How do I add a library project to Android Studio?. But every time I will get below error.…
Mohammad Alfaz
  • 152
  • 1
  • 2
  • 13
0
votes
1 answer

How to create library with modules?

I want to create few library (core and modules), add all this libraries to application and call methods from modules in core library. All modules should be optional. For example, as I see it: Application…
BArtWell
  • 4,176
  • 10
  • 63
  • 106
0
votes
1 answer

Converting Android application to android library gives Error: constant expression required

I have an Android application which I wish to convert to a library to use in another application. I have changed com.android.application to com.android.library in the apply plugin section in gradle file. Removed application id. Removed the Launcher…
Arka Prava Basu
  • 2,366
  • 3
  • 18
  • 34
0
votes
1 answer

Is it possible to override resource file from Android's Library Module?

I have two Android Libraries: A and B. B has an EditText that receives a custom attr app:themewhich is a XML file from rawres directory. A supplies B with this file. I have an app C that uses A. Is it possible from C override the file present in raw…
E. Fernandes
  • 3,889
  • 4
  • 30
  • 48
0
votes
2 answers

Android Volley Library Works on Genymotion Emulator But always return timeouterror on device

Recently I just built an android application using volley library. It works really fine in Genymotion emulator, but somehow when I try to run it on my phone (samsung galaxy s4 Api 21) everyhting changes. Not even a single request was sent and volley…
0
votes
1 answer

Add Material Design Library In Android Studio

I'm very very new to Android Studio, and I can't understand how to use the Android Design Library, can someone help me guiding me in each passage? Please
0
votes
1 answer

Defining Rules for My Library in android

I'm relatively new to this library making the segment. I've a library and that has some limitation like Min API level of my library is 17. And When someone tries to use my library with his App min API level lesser than mine. Then I just want to warn…
MohanRaj
  • 662
  • 1
  • 6
  • 21
0
votes
1 answer

How to inherit style from library style?

I want to use NumberProgressBar library in my project. I added it in gradle in this way: dependencies { compile 'com.daimajia.numberprogressbar:library:1.2@aar' } It have predefined styles, and it is said that you can easily use it like that: …