New AlertDialog library with appCampat v22.1

http://stackoverflow.com/questions/26455919/material-design-not-styling-alert-dialogs

http://developer.android.com/reference/android/support/v7/app/AlertDialog.html

 

<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>
</style>
 
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
     builder.setTitle("Titttle");
     builder.setMessage("Yap, Message");
     builder.setPositiveButton("OK", null);
     builder.setNegativeButton("Cancel", null);
     builder.show();

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

dependencies {
    compile 'com.android.support:appcompat-v7:23.2.1'
}

How to setup license verification library

http://stackoverflow.com/questions/18449680/setting-up-the-licensing-verification-library-on-android-studio

  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.

How to use “productFlavors” in gradle

Main documentation

https://developer.android.com/tools/building/configuring-gradle.html

How to run specific buildvariant

http://stackoverflow.com/questions/19234499/how-to-build-product-flavors-from-android-studio

How to create Java root folder in favor folder

http://stackoverflow.com/questions/21697565/android-studio-project-with-flavors-sources-directory-not-shown-in-blue-color

How to override string resource

http://stackoverflow.com/questions/19296068/build-android-with-gradle-replace-string-each-product-flavor