Proximity App via SDK

From ESE205 Wiki
Revision as of 04:57, 4 May 2018 by KelvinXie (talk | contribs)
Jump to navigation Jump to search

Steps

  1. Prerequisites
    1. 1 x computer with android studio
    2. 1 x Android phone with android 5.0
    3. 1 x Estimote proximity beacon
  2. Proximity Beacon Setup
    1. Download estimote app
      1. Configure ->find beacons -> login -> enable Estimote monitoring
  3. Download Estimote Example App
    1. https://github.com/Estimote/Android-Proximity-SDK
    2. Import SDK into Android Studio
    3. Estimote will automatically import their basic Methods and app interface
  4. Add Permissions to build.Gradle
    1. In your build.gradle tab add estimote SDK lines that will grab your necessary permissions
      1. general-SDK
      2. perimeter-SDK
      3. Estimote-mustard
  5. Add Proximity Observer to Activity class
    1. Set up Cloud Credentials inside generated onCreate method
      1. Credentials will give your app the ability recognize specific beacon ID’s
    2. Add Proximity Observer Object
      1. To add the Proximity Object you will need to create a builder inside your onCreate method underneath your Credentials
  6. Define Proximity Zones
    1. Log onto Estimote app and select your beacon, in edit, select beacon attachments
      1. In beacon attachments define location and ownership of beacon
    2. Creating Proximity Zone Objects
      1. Add a Proximity Zone beneath your Proximity Observer Builder
        1. If desired, it is possible to create multiple zones for different beacons
  7. Start Proximity Observing
    1. Requires location permissions in your build.gradle
      1. ACCESS_FINE_LOCATION
    2. At the end of your onCreate Method define a new proximity zone “proximityObserver”
      1. Proximity observer will have 3 cases
        1. Requirements fulfilled - proximityObserver.start
        2. Requirements missing - log error message
        3. Requirements error - log error message
      2. Each case will return null.
  8. POST Requests
    1. You will need to create a post request so your app can talk to Amazon Web Services
    2. Need two instances of request
      1. 1st POST request will be under your proximity observer
        1. A generic POST template found online works perfectly
      2. Paste code in and modify parameters ensuring that they match up with the AWS side
        1. Username
        2. Password
        3. beaconID
        4. Open
          1. Set open to TRUE or 1
      3. 2nd POST request will be entered beneath onExit action
        1. 1st POST request will be under your proximity observer
          1. A generic POST template found online works perfectly
        2. Paste code in and modify parameters ensuring that they match up with the AWS side
          1. Username
          2. Password
          3. beaconID
          4. Open
            1. Set open to False or 0

You should be good to go!

Example Code for Each Part