EcoTrack SDK Documentation

Welcome to the EcoTrack SDK documentation. This guide will help you integrate EcoTrack into your application to monitor and manage environmental data efficiently.

Introduction

EcoTrack SDK provides tools and APIs to integrate environmental data tracking into your applications. With EcoTrack, you can monitor carbon emissions, track renewable energy usage, and generate sustainability reports.

Installation

Prerequisites

  • Unity 2019.4 or later

  • .NET Standard 2.0 or later

Download

Download the latest version of the EcoTrack SDK from the official website.

Importing the SDK

  1. Open your Unity project.

  2. Go to Assets > Import Package > Custom Package.

  3. Select the downloaded EcoTrack SDK package.

  4. Click Import to add the SDK to your project.

Getting Started

Initializing the SDK

To start using the EcoTrack SDK, you need to initialize it in your project. Add the following code to your main script:

using EcoTrack;

public class EcoTrackInitializer : MonoBehaviour
{
    void Start()
    {
        EcoTrackManager.Initialize("YOUR_API_KEY");
    }
}

Configuration

Configure the SDK according to your needs. You can set various parameters like data update intervals, tracking preferences, and more.

EcoTrackManager.SetUpdateInterval(60); // Update every 60 seconds
EcoTrackManager.EnableCarbonTracking(true);
EcoTrackManager.EnableEnergyTracking(true);

Features

Carbon Emission Tracking

Track carbon emissions generated by different activities in your application. Use the following API to log emissions:

EcoTrackManager.LogCarbonEmission(activity: "transport", amount: 50.5);

Renewable Energy Tracking

Monitor the usage of renewable energy sources in your application. Log energy usage with the following code:

EcoTrackManager.LogEnergyUsage(source: "solar", amount: 120.0);

Sustainability Reports

Generate sustainability reports based on the tracked data. You can customize the report parameters as needed:

SustainabilityReport report = EcoTrackManager.GenerateReport(startDate, endDate);
report.SaveAsPDF("sustainability_report.pdf");

API Reference

EcoTrackManager

Initialize

public static void Initialize(string apiKey)

Initializes the EcoTrack SDK with your API key.

SetUpdateInterval

public static void SetUpdateInterval(int seconds)

Sets the interval for data updates.

EnableCarbonTracking

public static void EnableCarbonTracking(bool enable)

Enables or disables carbon tracking.

LogCarbonEmission

public static void LogCarbonEmission(string activity, double amount)

Logs the amount of carbon emissions for a specific activity.

EnableEnergyTracking

public static void EnableEnergyTracking(bool enable)

Enables or disables renewable energy tracking.

LogEnergyUsage

public static void LogEnergyUsage(string source, double amount)

Logs the amount of energy used from a specific source.

GenerateReport

public static SustainabilityReport GenerateReport(DateTime startDate, DateTime endDate)

Generates a sustainability report for the specified date range.

Support

For any issues or questions, please visit our support page or contact us at support@ecotrack.com.