You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mohsin Khan edited this page Feb 21, 2017
·
23 revisions
Let’s get started with ActiveAndroid. The first thing you need to do, if you haven’t already done so, is download the ActiveAndroid library. or the latest stable ActiveAndroid jar file. If you downloaded the library and not the jar, you'll have to build the jar file by running ant in the root folder. Your ActiveAndroid.jar, which is what we need, will be in the dist folder.
Adding The JAR
Now that you have the ActiveAndroid library you can add it to your project’s build path. If you’re using Eclipse:
If you haven’t done so already, create an Android project.
Copy ActiveAndroid.jar to the libs-folder of your new project.
Right click on your project and select Build Path > Configure Build Path…
Click the Add External Jars… button and choose the ActiveAndroid jar file.
If you're using Android Studio:
If you haven’t done so already, create an Android project.
Drag the jar to the libs folder of project.
Right click on the jar, and select "Add as a Library…"
Installing From Maven
First, clone the source from Git and install the package to your local repository: Note: Maven 3.1.1 or later is required
Now that you have ActiveAndroid added to you project, you can begin your two-step configuration process! The first thing we’ll need to do is add some global settings. ActiveAndroid will look for these in the AndroidManifest.xml file. Open the AndroidManifest.xml file located at the root directory of your project. Let’s add some configuration options.
AA_DB_NAME (optional)
AA_DB_VERSION (optional – defaults to 1)
The configuration strings for my project look like this
But what if you're already doing this to utilize another library? Simply initialize ActiveAndroid in the Application class. You may call ActiveAndroid.dispose(); if you want to reset the framework for debugging purposes. (Don’t forget to call initialize again.)