Skip to content

How to add to porject

hamsterksu edited this page Oct 23, 2014 · 1 revision

#####How to add to porject Now available in maven central repo:

com.github.hamsterksu:android-annotatedsql-api:1.10.+
com.github.hamsterksu:android-annotatedsql-processor:1.10.+

Very easy way to add annotation processors to your andorid project - just use aptlibs

buildscript {
	repositories {
		mavenCentral()
	}
	dependencies {
		classpath 'com.github.hamsterksu:android-aptlibs-gradle-plugin:1.2.0'
	}
}

apply plugin: 'aptlibs'

configurations {
	apt
}

ext.asVersion = '1.10.+'

dependencies {
	compile "com.github.hamsterksu:android-annotatedsql-api:${asVersion}"
}

aptlibs {
	annotatedSql {
		version "${asVersion}"
	}
}

Schema and Provider

Define SQL Schema

  1. Declare schema - @Schema
  2. Define sql table - @Table
  3. Define sql view - @SimpleView
  4. Define raw sql query - @RawQuery

Define Content Provider

  1. Declare provider - @Provider
  2. Define provider uri - @URI
  3. Extra provider features - features
Clone this wiki locally