Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Project Overview

UtilityAPI is an api that automatically downloads bill and usage data from electric utilities.

Challenge Overview

In this challenge you are building an Android Mobile SDK for UtilityAPI.

Challenge Requirements

You will address the following in this challenge :

The SDK will be an android studio project with following requirements :

  1. We would like to follow the structure of forcedotcom project :

    • libs folder includes the core SDK projects that communicate with the UtilityAPI

    • external folder should be added to your solution if we need to use a 3rd party frameworks and libraries that need to referenced by the core SDK framework.

    • gradle related folders and configurations.

    • You are recommended to suggest an improvements.

  2. README file, read below about its content details 

  3. The SDK should support Android 4.1 Jelly Bean (API level 16) and up..

  4. Here's the list of API endpoints to be covered in the SDK :

    • GET /accounts - get a list of accounts

    • GET /accounts/add - get the options for adding an account (i.e. what utilities are available)

    • POST /accounts/add - add an account

    • GET /accounts/<uid> - get an account object

    • GET /accounts/<uid>/auth.zip - get the account authorization file (if not direct authorization)

    • GET /accounts/<uid>/modify - get options for modifying the account

    • POST /accounts/<uid>/modify - modify the account

    • GET /accounts/<uid>/delete - get a deletion code for the account

    • POST /accounts/<uid>/delete - delete the account and all services and data for that account

    • GET /services - get a list of utility services (i.e. list of meters)

    • GET /services/<uid> - get a specific service object

    • GET /services/<uid>/bills - get the bills for a service

    • GET /services/<uid>/bills.zip - get the raw bills for a service

    • GET /services/<uid>/bills/<filename> - get a specific raw bill

    • GET /services/<uid>/intervals - get the intervals for a service

    • GET /services/<uid>/modify - get options for modifying a service

    • POST /services/<uid>/modify - modify a service (i.e. activate or deactivate)

    • GET /services/<uid>/reset - get a deactivate-and-forget-data code for a service

    • POST /services/<uid>/reset - deactivate and forget data for a service

  5. Notes about the Wrapper SDK :

    • Your solution should support future extensibility, adding/removing api should not result in too much effort and code refactoring.

    • So we recommend also following the Salesforce sdk structure :

      • Build generic REST classes that handle the logic to communicate with the API : RESTAPI, RESTRequest, and RESTResponse .. etc.

      • Each endpoint group should have its own Class that delegate the API calls to the generic REST classes :

        • AccountsAPI

        • ServicesAPI

      • The API Based URL is https://www.utilityapi.com/api/  (make it configurable)

  6. Additional SDK Functionality - Add a function in new class (AccountsUtilities) for “Create Account”

    • This function should combine all the calls provided by the API to set up a new account.

    • It should be able to run asynchronously, as the creation process will involve some waiting.

    • It should accept a callback function because certain call outs will take a little while to return response.

    • The function should export/save the current state of the function execution so it is possible to save the state, close the app, reopen the app, then initialize the state back to where it was. As an example, if first steps were executed, and we have an account id, then when app is closed the state would have (1) current step the function is on, (2) the account id, and (3) the callback function parameter.

    • Input to the function are user credentials used to create account, and a callback function parameter.

    • The flow will execute each one of these endpoints (sequential execution) :

      • POST /accounts/add

      • GET /accounts/{id}

        • It may take a while to have Account [“latest”][“type”] != “pending” so you need to wait until it becomes ‘updated’ then move to next endpoint execution.

      • GET /services?accounts=123

      • POST /services/456/modify (change “active_until”)

      • GET /services/456

        • It may take a while to have Service [“latest”][“type”] != “pending” so you need to wait until it becomes ‘updated’ then move to next endpoint execution.

      • GET /services/456/bills

      • When complete, execute callback function passing back relevant data

  7. Write Unit tests for all Core SDK Code.

    • You must cover at least 85% of the code.

    • You must verify accuracy of returned results.

  8. Write a detailed README.md file (using markdown language) that covers the following :

    • What is this? - An overview of the project and the SDK

    • Prerequisites - This section should detail the steps and setup needed to be done before starting using the SDK. i.e. obtain API keys, setup sandbox, or setup/install a 3rd party software/library .. etc

    • Building the SDK - This should details the steps needed to build the core, and native libraries.

    • Including the SDK in your project - This section should explain how to include the SDK in developer IDE, and how to install it. i.e. download SDK, include path in environment variables, update project configurations, execute specific commands from terminal ..etc

    • Sample Usage of OAuth - This should talk about how to create access token, and how to pass it in the SDK calls.       

    • Usage (Snippet code) - This section should show usage snippet of different parts of the SDK, we should cover the main parts. one endpoint of each API endpoints group.

  9. Make sure all API calls are consistent. Either append .json to all requests (the api default returns .html) or set the content type in the header request to be of type json.

  10. You must follow the coding standards for the java language.

Documentation

Get Started in Utility API

  1. Create Account using the Invite Code posted in challenge forums https://www.utilityapi.com/api/users/new.html

  2. Login.

  3. Go to settings (Use top right corner gear to navigate to settings page)

  4. In Tokens table add new token of type API

  5. In services page add new service of type demo https://www.utilityapi.com/api/services.html

  6. Verify that you can call the API properly https://www.utilityapi.com/api/accounts/add.json?access_token=<ACCESS_TOKEN>

 



Final Submission Guidelines

Deliverables

  • Android Studio Workspace that includes all the projects that implement the above requirements

  • README.md (Markdown formatting) file as detailed above.

  • Install and Build scripts

ELIGIBLE EVENTS:

2015 topcoder Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30048728