Giter Club home page Giter Club logo

switch-android's Introduction

switch app

Android client for an Electric Imp-powered plugtop device.

Building and Configuration

Building with Android Studio/Gradle

  1. If you haven't already, install Android Studio from https://developer.android.com/sdk/installing/studio.html and the Android SDK tools from the "Get the SDK for an Existing IDE" section of https://developer.android.com/sdk/index.html.
  2. Using the Android SDK Manager, ensure you have the following packages:
    • SDK Version 21
    • Android Support Repository
    • Android Support Library
    • The latest version of Google Play Services
    • Google Repository
  3. Download and import the switch project into Android Studio. The Gradle build system will automatically download and import the following dependencies:

Required Configuration

Google Cloud Messenger

Google Cloud Messenger (GCM) must be configured for communication between the app and plugtop. If you have not already, follow the GCM "Getting Started" instructions and record both the project number and API key.

In api-keys.xml, replace the string "PUT_SENDER_ID_HERE" with your GCM project number.

plugtop Agent ID

If you have not already, make sure your plugtop device has been programming and configured with the API key recorded in the Google Cloud Messenger section by following the cloud and device setup instructions. Take note of the Agent ID found in this section.

Once the app is compiled and running on your device, click the menu icon in the upper right-hand corner of the screen. Select "Settings" and enter the agent ID in the dialog that appears.

The app will now be fully functional.

App Usage

Switch and Meter Readout

At the top of the screen is a large switch button that can be used to switch the outlet on and off.

If the app has successfully connected to the outlet, a list of statistics from the device will be displayed below. This list includes the name of the Wi-Fi network the device is connected to as well as current, power, and voltage readings from an internal meter. It will automatically refresh while the outlet is switched on, but the button on the right can force an update.

Timed Switcher

Near the bottom of the screen is a section labeled "timer". Tap on the time display to set a alarm and the app will switch the outlet at that time.

Widget Usage

When added to the home screen, the switch widget will indicate the status of the outlet and toggle its state.

Known Issues

  • Occasional loss of plugtop state when reconnecting to the internet

License

This project is licensed under the terms of the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.