How android determines required permissions

If you still wind up with permissions that you do not want, then you will need to determine where the permissions are coming from. There should be a manifest merger report in build/outputs/logs/ of your module.


New AlertDialog library with appCampat v22.1


<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
     <item name="colorAccent">#5fa3d0</item>
     <item name="android:textColorPrimary">#000000</item>
     <item name="android:background">#FFFFFF</item>
AlertDialog.Builder builder = new AlertDialog.Builder(this,;
     builder.setMessage("Yap, Message");
     builder.setPositiveButton("OK", null);
     builder.setNegativeButton("Cancel", null);;

For this, make sure you have following (v22 or higher) in build.gradle

dependencies {
    compile ''

How to setup license verification library

  1. In Android Studio, Tools-Android-SDK Manager
  2. In SDK Manager, in the extras section choose Google Play Licensing Library
  3. Go back to Android Studio, and choose File-New-Import Module
  4. ADK Manager will have put the downloaded files under your SDK directory, in my case Desktop/android-sdk-macosx/extras/google/play_licensing/library
  5. Choose to import this directory as a module, and give it a name. I used ‘lvl’
  6. Optionally change targetSdkVersion in the lvl module’s build.gradle to match your project targetSdkVersion.
  7. Then in your projects build.gradle, add the line compile project(':lvl') inside the {dependencies{ section.
  8. Re-sync Gradle and everything should compile correctly.

Two Android Studio Projects, Library & Application – How to link them.

Prepare two projects as follows

1. Library

+ LibraryModule

2. Application

+ ApplicationModule

Set the dependency relations as follows

1. In LibraryProject

in “build.gradle” inside your LibraryModule folder,
make sure to set it as library using plugin and disable proguard

apply plugin: ''
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'

2. In ApplicationProject

in “settings.gradle”

include ':ApplicationModule', '..:LibraryProject:yourLibraryModule'

in “build.gradle” inside your ApplicationModule folder

apply plugin: ''
compile project(':..:LibraryProject:yourLibraryModule')