/fh-android-sdk

FeedHenry Android Native SDK

Primary LanguageJavaApache License 2.0Apache-2.0

FeedHenry Android SDK Build Status

This SDK should provide you with all you'll need to start developing cloud-connected apps with the FeedHenry platform. The SDK provides access to cloud action calls, app authentication and authorization.

Build

Prereqs

Building

This library is built as an aar project using Maven, but Google does not ship all the required libraries to Maven Central. You must locally deploy them using the maven-android-sdk-deployer.

Run the following commands outside the FeedHenry Android SDK directory to avoid polluting the repo:

git clone git://github.com/mosabua/maven-android-sdk-deployer.git
cd $PWD/maven-android-sdk-deployer/platforms/android-23
mvn install -N --quiet
cd -
cd $PWD/maven-android-sdk-deployer/repositories/google-m2repository
mvn install -N --quiet

Now let's build the library.

In the base repo directory:

cd $PWD/fh-android-sdk
mvn clean package

This will compile the source code, generating an aar and a jar file in the target directory.

Deploy

Until we don't have it released in Maven Central we are hosting it in a Github repo

To deploy it, you need to follow the instructions below:

Snapshots

mvn -DaltDeploymentRepository=snapshot-repo::default::file:[your repo dir]/snapshots clean deploy

Releases

mvn -DaltDeploymentRepository=releases-repo::default::file:[your repo dir]/releases clean deploy

After that, commit it in the fh-android-sdk-repository and send a PR on it

Usage

Gradle Projects (Recommended)

Add our Github host repo in your gradle.build project file

allprojects {
	repositories {
   	jcenter()
   		// for snapshots
		maven { url "https://github.com/feedhenry/fh-android-sdk-repository/raw/master/snapshots" }
		// for released
		maven { url "https://github.com/feedhenry/fh-android-sdk-repository/raw/master/releases" }
	}
}

Add the FH Android aar library in your build.gradle project

dependencies {
	compile 'com.feedhenry:fh-android-sdk:3.0.0'
}

For more detail about our API, See FH Android SDK Guide.

Ant Projects

To use the Android SDK in Ant-based Android projects, the following files need to be added as the dependencies:

  • The fh-android-sdk jar file (e.g. 3.0.0 Jar File)
  • All the jar files in the deps directory

Example

The example directory contains an example to demonstrate how to use all the Android native APIs. You can import it into Eclipse and run it on an emulator or device.

If building in Android Studio, you will need to manually add the jar as a library, as well as the Android Asynchronous Http Client.

Links