Skip to content

Instantly share code, notes, and snippets.

@icastell
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icastell/0e429de6857bceb3c35b to your computer and use it in GitHub Desktop.
Save icastell/0e429de6857bceb3c35b to your computer and use it in GitHub Desktop.
ContentProvider authority renaming
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="package.name" >
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<provider android:name=".contentprovider.Provider" android:authorities="@string/authority" />
</application>
</manifest>
android {
...
productFlavors {
production {
packageName "package.name.production"
resValue "string", "authority", "package.name.production.provider"
buildConfigField "String", "AUTHORITY", "package.name.production.provider"
}
testing {
packageName "package.name.debug"
resValue "string", "authority", "package.name.debug.provider"
buildConfigField "String", "AUTHORITY", "package.name.debug.provider"
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment