Skip to content

Embedding our SDK (API V2)

andrewtremblay edited this page Apr 29, 2013 · 1 revision

There are two ways to include AppBlade in your project, directly using the source code or including an AppBlade binary. We officially suggest that you compile from source, preferably as a git submodule, but for programmers less familiar with using external sources we have also provided our own builds of the AppBlade SDK.

##Add AppBlade to your project# This guide is for our Android and iOS native code. If you're looking for our Plugins, they can be found in their own repositories.


- [Android](https://github.com/AppBlade/SDK/wiki/Embedding-our-SDK#android-sdk) - [Embedding the Source](https://github.com/AppBlade/SDK/wiki/Embedding-our-SDK#adding-android-source) - [Embedding the Binary](https://github.com/AppBlade/SDK/wiki/Embedding-our-SDK#adding-android-binary)

#iOS SDK#

Before starting, confirm that you have the latest version of Xcode installed.

###Including AppBlade Source### Some prefer to include the AppBlade source code directly to their project, either as a submodule for easier code updates or for development on new AppBlade features. AppBlade binaries should not be included if the source code is being used directly instead. Integrating source is a slightly more advanced process and not recommended for beginners.

Note: The AppBlade framework is ARC-agnostic (It is compatible with ARC-enabled projects, but does not use ARC itself.)

  1. Clone the AppBlade master branch off of github, then drag the AppBlade project file into the left-hand File Navigator of your application's Xcode project.
    • NOTE: If you are also sharing this project with others (through github, for example) it is highly suggested that you use a copy of the AppBlade Framework in a subdirectory into your project instead of an external one. You may either simply copy iOS/Framework into your project folder or add AppBlade as a Submodule.
  2. Select the following options in the add file options panel and before clicking "Finish":
    • Make sure that "Copy items" is checked for "Destination".
    • Check each of your app targets in "Add to targets".
  3. Add the Apple Security.framework to your project.
    • Click your project file from the File Navigator and then select your app target from the list on the right.
    • Select the "Build Phases" tab and expand "Link Binary With Libraries" and click the "+" button to add a library.
    • Select Security.framework from the list and click "Add".
  4. Add the Appblade library to your Target Dependencies
    • From the "Build Phases" tab, expand "Target Dependencies" and click the "+" button to add a library.
    • Select the AppBlade target under your AppBlade subproject in the dropdown.
  5. Link the Appblade binary to your Link Binary With Libraries
    • From the "Build Phases" tab, expand "Link Binary With Libraries" and click the "+" button to add a binary.
    • Select the AppBlade.a binary under your Workspace folder in the appearing dropdown.
  6. Link the Appblade header files to your Project
    • In your Project Build Settings (Not your Target Build Settings), scroll down to Header Search Paths.
    • Add the path of your AppBlade iOS/Framework folder to your Header Search Paths. Make sure it is marked recursive.
  7. The AppBlade library will now build and link to your project on each build of this target. You can use the SDK features in your project now. Find out how to do that in our Feature Implementation Guide.

###Including AppBlade Binary## Video Demonstration You can either download the compiled version from our website, or build the AppBlade library from downloaded source (directions for which can be found in the Building AppBlade Binary From Source section).

  1. After downloading AppBlade or building it locally, navigate to the folder containing the libAppBladeUniversal.a binary and header file.
  2. Open your Xcode project.
  3. For a universal build, simply drag the libAppBladeUniversal.a and AppBlade.h files from the folder into your project, ensure that "Copy items" is checked and that it is linked to your build target.
  4. Click your project file from the File Navigator and then select your app target from the list on the right.
  5. Select the "Build Phases" tab and expand "Link Binary With Libraries" and click the "+" button to add a library.
  6. Select Security.framework from the list and click "Add".
  7. Make sure libAppBladeUniversal.a is also added to the list if it hasn't been added by Xcode.
  8. Configure the framework using the instructions in the Configure AppBlade section.

####Building An AppBlade Binary From Source####

  1. Download the source. Open AppBlade.xcodeproj located in iOS/Framework/.
  2. Select AppBladeUniversal from the Scheme dropdown.
  3. Build.
  4. On the completion of our custom shell script, a finder window will open to the location of the built binaries (the name of the folder will be "Release_Production-universal").
  5. For universal build, simply copy that libAppBladeUniversal.a file, and AppBlade.h from the folder into your project, exactly how you would if you had downloaded the prebuilt binary from appblade.com.
  6. Add the built binary to your project by following the instructions in the Including AppBlade Binary section above.

######A Note on Xcode 4.5 and Above### Starting on iOS 6 and Xcode 4.5, Apple has officially dropped support for armv6 processors (And, subsequently, the ability to exclusively publish to iPhone 3G and below). Here at AppBlade we have been forced to follow suit, and now support armv7 and armv7s processors for iOS 4.3 and above. For those who would like to continue to use older versions of Xcode or iOS for legacy purposes, the source (not the compiled binaries) will still work.


#Android SDK# Before starting, know that our minimum supported Android API is 9 and our target API is 17.
The Android AppBlade SDK has only one dependent jar, httpmime-4.1.2.jar, (org.apache.http.entity.mime) for its network calls which may conflict with certain projects. Compiling from source and controlling the dependencies manually will resolve most issues.
Currently we only provide directions for the Eclipse environment because that is what we use everyday. Ensure you have Google's ADT plugin for Eclipse (Google provides documentation on how to add their Eclipse plugin).

###Adding Android Source###

  1. First have our source copied locally, either with a git clone call or a tag download from github.
    Make sure you also start with an existing android project in your workspace.
  2. Import the android source code into your project workspace.
  • In your Eclipse Package Explorer, Right click and select Import...
  • In the import selection window Select Android -> Existing Android Code Into Workspace
  • On the next screen, navigate your browser to the local AppBlade Framework location. (In our source this is located under /Android/AppBlade Framework).
  • Select the project named "AppBlade Framework" in the list and click Finish.
  • A project named "AppBlade Framework" will now be in your Package Explorer alongside your Android project.
  1. Set the AppBlade Framework to compile as a Library.
  • Right click your new "AppBlade Framework" project in the package explorer and select "Properties"
  • In the Properties window, select Android from the left navigation list.
  • Make sure the project is pointing to a valid Build Target on your machine and the Is Library check box is checked. Then hit apply.
  1. Attach the AppBlade Framework Library to your android project.
  • Right click your project in the package explorer and select "Properties"
  • In the Properties window, select Android from the left navigation list.
  • Under the Library panel, click Add... and select the AppBlade Framework project in the pop-up window.
  • The AppBlade Framework should now appear as a library for your project.
  1. The SDK should now be embedded! Confirm this by importing the AppBlade class in your Main Activity. (import com.appblade.framework.AppBlade;)
  2. You'll need to register the app with AppBlade before using any of its features, though. Read more on how to implement the SDK features here.

###Adding Android Binary###

  1. Add a "libs" folder to your project (if one does not already exist) and include the latest AppBlade jar file (downloadable here: SDK v0.3.0). Make sure you have the asset set to "copy"

    Make sure you have "Copy files" selected.

  2. Add a library reference to the AppBlade jar file in your project. If you are using Eclipse with the ADT plugin, you can right-click on your project file and select Properties, navigate to Java Build Path - Libraries - Add JARs _

  3. And select the AppBlade jar by browsing to the libs folder (and confirming your selection). _

  4. The SDK should now be embedded! Confirm this by importing the AppBlade class (import com.appblade.framework.AppBlade;) in your Main Activity or your custom Application class (where your api keys will be declared). _

  5. You'll need to register the app with AppBlade before using any of its features, though. Read more on how to implement the SDK features here.

Clone this wiki locally