Setting up SDKs

  1. If you didn’t download the iOS SDK already, you can find it here.
  2. Unzip the downloaded file and move it to the directory of your choice.
  3. In Xcode, open the project you’d like the use FatFractal with, or create a new one. Be sure to enable Automatic Reference Counting (ARC) in your project.
  4. Open the project settings by selecting your project in the Project Navigator (⌘1) on the left side of the project window.
  5. Choose your application target in the list, then click the Build Phases tab.
  6. Expand the Link Binaries With Libraries section, the click the + to add a new library.
  7. Click Add Other…, then navigate to and choose the FFEF.framework file you unzipped above.
  8. To start using the FatFractal Platform in your code, all you need to do is instantiate a FatFractal object when your app launches, and save it somewhere. On iOS, a convenient place to save the object is in your app delegate object:
    #import <UIKit/UIKit.h>
    #import <FFEF/FatFractal.h>
    
    @interface AppDelegate : UIResponder <UIApplicationDelegate>
    
    @property (strong, nonatomic) UIWindow *window;
    @property (strong, nonatomic) FatFractal *ff;
    
    @end
    

    and a convenient place to instantiate it is the application:didFinishLaunchingWithOptions: method:

    @synthesize ff = _ff;
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        NSString *baseUrl = @"http://my_domain.fatfractal.com/my_app";
        self.ff = [[FatFractal alloc] initWithBaseUrl:baseUrl];
    
        ...
    
        return YES;
    }
    

    where you should replace my_domain with the domain you added above, and my_app with your application name. Alternatively, replace my_domain.fatfractal.com with localhost to target your local engine.

  9. Your code is now ready to start accessing your backend using FatFractal API calls, using the [FatFractal main]class method to get your instance whenever necessary.To store data, one additional step is necessary: login. To log in, use the loginWithUserName:andPassword: method:
    [[FatFractal main] loginWithUserName:@"user_name" andPassword:@"password"];
    

    By default, the FatFractal backend will automatically register a user if they attempt to login with an unknown username, so this call is all you need. See Manage Users for more information.

    For an in-depth tutorial on using the FatFractal Platform, see here.

  1. If you didn’t download the Android SDK already, you can find it here.
  2. Download the Jackson Core and Jackson Mapper libraries.
  3. In your IDE, open the project you’d like the use FatFractal with, or create a new one. Step will be shown for Eclipse, but should be easily adapted to other IDEs.
  4. Drag the FF-Android-1.0.jar from the above directory of your FatFractal installation into the libs directory of your project.
  5. Likewise, drag the Jackson libraries from step 2 in the libs directory.
  6. To start using the FatFractal Platform in your code, all you need to do is instantiate a FatFractal object when your app launches, save it somewhere, and declare your object types that you want to store to the backend. On Android, a convenient place to save the object is in your Application subclass object:
    import com.fatfractal.ffef.FatFractal;
    import com.fatfractal.ffef.impl.FFPrefsAndroid;
    import com.fatfractal.ffef.impl.FatFractalHttpImpl;
    import com.fatfractal.ffef.json.FFObjectMapper;
    
    ...
    
    public class YourApplication extends Application {
        public static FatFractal ff = null;
    
        @Override
        public void onCreate() {
            super.onCreate();
    
            String baseUrl = "http://my_domain.fatfractal.com/my_app";
            String sslUrl = "https://my_domain.fatfractal.com/my_app";
            try {
                ff = FatFractal.getInstance(new URI(baseUrl), new URI(sslUrl));
                FFObjectMapper.registerClassNameForClazz(Class1.class.getName(), "Class1");
                FFObjectMapper.registerClassNameForClazz(Class2.class.getName(), "Class2");
                ...
            }
            catch (Exception e) { ... }
            FFPrefsAndroid.setContext(this.getApplicationContext());
        }
    
        ...
    }
    

    where you should replace my_domain with the domain you added above, and my_app with your application name. Alternatively, replace my_domain.fatfractal.com with localhost to target your local engine.

  7. Your code is now ready to start accessing your backend using FatFractal API calls, using the FatFractal.getMain()class method to get your instance whenever necessary.To store data, one additional step is necessary: login. To log in, use the login method:
    FatFractal.getMain().login("user_name", "password");
    

    By default, the FatFractal backend will automatically register a user if they attempt to login with an unknown username, so this call is all you need. See Manage Users for more information.

    For an in-depth tutorial on using the FatFractal Platform, see here.

  1. If you didn’t download the HTML5/JS SDK already, you can find it here.
  2. Unzip the downloaded file and move it to the directory of your choice.
  3. Copy the unzipped file (FatFractal.js) and move it to the directory in your project that holds your javascript files. For example, if you put javascript files in a js directory, then just import as follows:
  4. <script src="lib/FatFractal.js"></script>
    
  5. To start using the FatFractal Platform in your code, all you need to do is instantiate one or more FatFractal objects when your page loads:
    var ff = new FatFractal();
    

    For an in-depth tutorial on using the FatFractal Platform, see here.