Skip to content
nickelskevin edited this page Apr 3, 2014 · 6 revisions

Developing on a new platform can be challenging. In fact, that’s why we launched FatFractal. Building your mobile app together with your app’s powerful backend is easier than ever before. But like you, we believe the proof is in the pudding: it’s one thing to create little “hello world” tests and quite another to build an entire app.

Hoo.png

The purpose of this tutorial is to take you through every aspect of our platform from the point of view of an iOS or Android developer. Even there, we try to walk step-by-step through the process in the IDE (Xcode or Eclipse) and using native APIs too. If you haven’t done a lot of coding for iPhone or Android devices, you can learn a little bit about that as well. Side benefit.

The tutorial steps you through the creation of a mobile app (in iPhone, Android and HTML5/JS flavors) we’ve called Hoodyoodoo, from start to finish, to illustrate some of the capabilities of the FatFractal Platform.

The source code for this app can be downloaded: the whole app is divided into five, compilable chunks that can be run independently, in case you want to tackle the sections in order. If you want to just look through the final, complete application, you can do that as well. Download the complete tutorial files.

The app itself is, conceptually, a simple game. The end-user is presented with two, random pictures of celebrities (or whomever) and selects the one the end-user would, um, “do;” naturally, we mean “do dinner with.” Although the game is played by one individual at a time, per phone, it is really a multi-user experience because the app’s backend keeps track of everyone playing the game, tallying who’s chosen in each case and maintaining a bunch of stats. We think you will be pleasantly amazed at how quickly you can build the app, from start to finish, without ever dealing with the frustrating “backend nonsense.”

iOS Tutorial Android Tutorial HTML5/JS Tutorial
ios_off2.png android_off.png HTML5_Logo.png
Tutorial Part 1: Basic CRUD operations
In Part I, we define a class, write some unit tests to validate our app can perform all CRUD operations properly and then create the UI to add Celebrities to our app's datastore into our UI and prove we can retrieve them.

In Part I, we will accomplish the following:

  • Create our new project
  • Add the FatFractal Framework to the project
  • Add the Celebrity object model to the project
  • Store and Retrieve Celebrity objects
    • Create
    • Read
    • Update
    • Delete
  • Use CRUD with images
  • Create a UI to add a new celebrity
  • Create a UI to retrieve the new celebrity
Tutorial Part 2: How to Use Queries
In Part II, we  implement the methods to create the data collected during game-play. We define an object, WouldYa, to  store  end-user selections, create the UI to present two celebrities to choose from, write  queries to populate the UI and store the results on our app's backend.

In Part II, we will accomplish the following:

  • Write queries to retrieve single objects
  • Get random objects of a specified type
  • Write queries with parameters passed in
  • Write tests to validate retrieving multiple objects
  • Simplify the code to increase performance
Tutorial Part 3: Event Handlers
In Part III, we focus on data tracking, which includes keeping track of the most popular celebrity-of-the-moment. Using ever-available CRUD events on our app's backend, we will write a down-and-dirty event handler in JavaScript for use on the server-side (!). We could do this from the client side, but that would be inefficient and unreliable.

In Part III, we will accomplish the following:

  • Define an Event Handler in the FatFractal Definition Language (FFDL)
  • Create a JavaScript function to do the following:
    • Define a  model to be persisted on the back-end.
    • Lazily add two new members to our Celebrity model.
    • Initialize update data based on a CRUD event.
    • Update the TopCeleb object,  if a new celebrity-of-the-moment takes the lead.
Tutorial Part IV: Server Extensions
In Part IV, we will tackle trending data across all our end-users by extending our API. We will create a groovy API extension (i.e. "custom code") that will efficiently aggregate data across multiple resource types. Yes, we are showing off how the FatFractal Platform allows us to extend our API–but this is also far more efficient for the client code and to optimize performance.

In Part IV, we will accomplish the following:

  • Define an API extension in FFDL
  • Create a JavaScript server-side function that will:
    • Define a new model that will be generated on the fly and will not be persisted on our app's backend
    • Calculate metrics based on queries from various, persisted collections
    • Populate the StatsObject with the result
    • Return the result to the client
  • Add the UI  to the client code to present this information
  • Create the client code to retrieve this information from our app's backend and populate the UI.
Tutorial Part V: Push Notifications
Finally, in Part V, we will top off our app by adding something everybody loves to have but hates to code: push notifications! Using a server extension, we'll fire off a push notification to Hoodyoodoo users every time a new Top Celebrity is crowned, because we know you don't want to miss an event like that!

Let's Get Going: Preliminary SETUP