The Android R1 Photo Effects SDK allows developers to include a suite of image effects in their applications.
The zip file includes the R1 Photo Effects SDK and an SDK demo app for installation reference.
- The SDK Manager can be accessed through the window menu option in eclipse
- Installation requires version 22 of the Android SDK Tools
- Installation requires version 17 of the Android SDK Platform-tools
- Installation requires version 17 of the Android SDK Build-tools
- SDK requires Android version 2.3 to run
- Updates can be downloaded and installed from the help menu tab
- Select File
- Select Import
- Select Android
- Select Existing Android Code Into Workspace
- Select Next
- Select Browse and locate the R1 Photo SDK [root] folder
- Verify that both r1-effects-sdk-library and sdk-demo are checked
- Select Finish
- Select the r1-effects-sdk-library project in the Package Explorer
- Select the Project menu tab
- Deselect Build Automatically
- Select the r1-effects-sdk-library project in the Package Explorer
- Select the Project menu tab
- Select Clean
- Select Clean projects selected below
- Verify that only the SDK project is checked
- Deselect Start a build immediately
- Select OK
- Right click the demo project in the Package Explorer
- Select Run As
- Select 1 Android Application
- The demo will build to a connected android device
- Double click the AndroidManifest.xml file under the demo project in the Package Explorer
- Select the farthest tab to the right below the open window to access the XML
// The following permissions must be inside of the manifest tag
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
// The following sdk reference must be inside of the manifest tag
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17"/>
// The following feature must be inside of the manifest tag
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
// The following activities must be inside of the application tag
<activity android:name="com.radiumone.effects_sdk.CropImage" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait" />
<activity android:name="com.radiumone.effects_sdk.EffectsChooserActivity" android:configChanges="orientation|keyboardHidden" android:launchMode="singleTop" android:screenOrientation="portrait" />
<activity android:name="com.radiumone.effects_sdk.EffectsStoreActivity" android:configChanges="orientation|keyboardHidden" android:screenOrientation="portrait" />
// The following service must be inside of the application tag
<service android:name="com.radiumone.effects_sdk.FilterDownloadManager"/>
// The following heap and hardware properties must be inside of the application tag
android:largeHeap="true"
android:hardwareAccelerated="false"
- Inside of the onCreate function for the activity that will call the R1 Photo Effects SDK add the following line for SDK initialization
- The R1 Photo Effects app token and Google Play app signature are required
R1PhotoEffectsSDK.getManager().init(this, "<Your R1 SDK APP TOKEN>", "<Your App Signature>");
- Add the following to your fragment, where imagebitmap is the photo bitmap to pass to the SDK. Use "this" for getActivity() when running directly from an activity.
R1PhotoEffectsSDK r1sdk = R1PhotoEffectsSDK.getManager();
r1sdk.launchPhotoEffects(
getActivity(),
imagebitmap,
true,
new R1PhotoEffectsSDK.PhotoEffectsListener() {
@Override
public void onEffectsComplete(Bitmap output) {
if( null == output ){
return;
}
// do something with output
}
@Override
public void onEffectsCanceled() {
// user canceled
}
}
);
Developers can enable paid packs for their application through Google Play. To add paid packs, contact your account manager for more information.
- Login at https://play.google.com/apps/publish/
- Select your application
- Select In-app Products from the left hand menu
- Select the + Add new product button
- Select the Managed Product tab
- Copy/paste the product ID into the form and select Continue
- Copy/paste the product name into the title field
- Copy/paste the product description into the description field
- Set a price (we suggest 99 cents)
- Select the Auto-convert prices now button
- Select the Save button
- Select activate in the drop down menu to the right of the save button
- Repeat for each additional paid package