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
2 answers

how to add new library in android studio

I want add this library in Android Studio. I added this compile io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.1.1' into build.gradle section . But when sync android studio show me this error , please click on this…
0
votes
2 answers

How to embed ExoPlayer in android library?

I want to embed ExoPlayer to android library, how can I do it, is any ideas?
0
votes
1 answer

How to use TrueTime's withSharedPreferences to get cached time?

I am using a library 'TrueTime' for maintaining a constant time irrespective of user's device time. As it uses SNTP for synchronizing time, it suggests limiting multiple calls by caching the response. This is mentioned in the readme section and…
drishit96
  • 327
  • 1
  • 2
  • 18
0
votes
0 answers

Send data to library project from main project in android

I am not sure just trying to find out is there any way we can send data from main project to library project ? Below code giving me classnotfound exception here LockScreenActivity is my library project activity. I am calling this code from the main…
0
votes
0 answers

i am getting an error : import android.support cannot be resolved at the line:

import android.support.v4.app.NotificationCompatApi21; Any idea what I can do to resolve it NOTE: I have added the android-support-v4.jar to my project and i look through library, there is no class as NotificationCompatApi21.
0
votes
1 answer

Failed to resolve libraries: Android Studio 2.2.3

I am getting the following errors and the gradle build fails: Failed to resolve: com.facebook.android:facebook-android-sdk:4.+ Failed to resolve: de.hdodenhof:circleimageview:1.3.0 Failed to resolve: com.viewpagerindicator:library:2.4.1 I have…
manini
  • 358
  • 1
  • 4
  • 14
0
votes
0 answers

Add Android Beacon Library to cordova project

I am trying to make a hybrid app which will transmit as beacon, I am using https://github.com/petermetz/cordova-plugin-ibeacon plugin but transmission works only for iOS, for android I need to add Android Beacon Library to cordova project. I have…
Atul Verma
  • 361
  • 8
  • 22
0
votes
1 answer

How do I add a reference to a aar file in android studio using a URL to the aar file?

I have an aar file publicly available for use by clients. It is downloadable from a URL. How can I add a reference to the library in an android app? I understand I need to upload it to bintray/jcenter/mavencentral for it to work with versioning. But…
0
votes
1 answer

What is the default C++ version used in Android?

What is the default C++ version used in Android? there are posts like "Enable C++11 support on Android" but how to find default version. Android libraries are application programming or system programming?
augustus
  • 1
  • 1
0
votes
1 answer

Multi-layer / libraries architecture with dagger2: designing scopes, components, modules

I'm using dagger 2 in a multi-layered, multi-library Android SDK project. I'm developing many different libraries on different layers (data, business logic, presentation etc...) and using dagger to glue them together. My most important requirement…
Daniele Segato
  • 12,314
  • 6
  • 62
  • 88
0
votes
0 answers

Importing a jar which includes an android service and trying to start it with NoClassDefFoundError

Inside an Android Library project, I have a service which I need to use in other applications. That's why I have exported the library into a jar file and imported it successfully in new application, so that I can reuse my resources including the…
0
votes
0 answers

Android application conflicting INSTALL_FAILED_CONFLICTING_PROVIDER

I am designing one SDK for using in multiple applications. In my application, I am using ContentProvider. While I am using that SDK in two applications I am getting INSTALL_FAILED_CONFLICTING_PROVIDER error. First application does not have any…
Deepak
  • 1,669
  • 1
  • 18
  • 28
0
votes
1 answer

Transitive dependencies not getting reflected in android application

I have created an android library which has certain dependencies like volley, SqlCipher etc in its gradle file. When I use the aar file for this library in another project, I am getting the ClassNotFoundError w.rt. SqlCipher and Volley. I think it…
0
votes
0 answers

Android library dependencies

I'm doing an android library project. The library project has compile some 3rd party library such as Volley. When user use the library, user need to compile the volley too. If user do not compile, the app of user will not find the volley code. But I…
0
votes
1 answer

How to create custom library and add it on Gradle

I am about to create my first custom library. I googled, but unable to find the answer of these question. How to add my library on Gradle, so end user only need to write something like this; compile 'com.myapp.mylib:1.0.0' I have added library in…
dev90
  • 7,187
  • 15
  • 80
  • 153