Skip to content

Commit

Permalink
Merge pull request #242 from xamarin/updates/estimote-android-1.0.3
Browse files Browse the repository at this point in the history
[Estimote] Update the Android binding to 1.0.3
  • Loading branch information
Redth authored Oct 19, 2017
2 parents ba13b56 + b74ef44 commit e524ae9
Show file tree
Hide file tree
Showing 27 changed files with 560 additions and 226 deletions.
38 changes: 38 additions & 0 deletions XPlat/Estimote/Android/External-Dependency-Info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do not translate or localize

Xamarin Components for Estimote SDK for Android incorporates
third party material from the projects listed below. The original copyright
notice and the license under which Microsoft received such third party
material are set forth below. Microsoft reserves all other rights not
expressly granted, whether by implication, estoppel or otherwise.

########################################
# Estimote SDK for Android
# https://github.com/Estimote/Android-SDK
########################################

The MIT License (MIT)

Copyright (c) 2013 Estimote, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

########################################
# end - Estimote SDK for Android
########################################
23 changes: 23 additions & 0 deletions XPlat/Estimote/Android/License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
The MIT License (MIT)

Copyright (c) .NET Foundation Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

20171017
14 changes: 3 additions & 11 deletions XPlat/Estimote/Android/build.cake
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#tool nuget:?package=XamarinComponent

#addin nuget:?package=Cake.XCode
#addin nuget:?package=Cake.Xamarin
#addin nuget:?package=Cake.Xamarin.Build
#addin nuget:?package=Cake.FileHelpers
#load "../../../common.cake"

var NUGET_VERSION = "0.11.0.1";
var NUGET_VERSION = "1.0.3";

var ESTIMOTES_VERSION = "0.11.0";
var ESTIMOTES_VERSION = "1.0.3";
var ESTIMOTES_SDK_URL = "http://search.maven.org/remotecontent?filepath=com/estimote/sdk/" + ESTIMOTES_VERSION + "/sdk-" + ESTIMOTES_VERSION + ".aar";
var ESTIMOTES_DOC_URL = "http://search.maven.org/remotecontent?filepath=com/estimote/sdk/" + ESTIMOTES_VERSION + "/sdk-" + ESTIMOTES_VERSION + "-javadoc.jar";

Expand Down Expand Up @@ -44,11 +40,7 @@ Task ("externals")
.Does (() =>
{
CreateDirectory ("./externals/");

DownloadFile (ESTIMOTES_SDK_URL, "./externals/estimotes.aar");
DownloadFile (ESTIMOTES_DOC_URL, "./externals/javadocs.jar");

Unzip ("./externals/javadocs.jar", "./externals/javadocs/");
});

Task ("clean")
Expand Down
2 changes: 1 addition & 1 deletion XPlat/Estimote/Android/component/Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Beacon is only a piece of hardware broadcasting radio signal. On top of that, th

# Estimote SDK for Android

The Estimote SDK for Android is a library that allows interaction with Estimote beacons & stickers. The SDK system works on Android 4.3 or above and requires device with Bluetooth Low Energy (SDK's min Android SDK version is 9).
The Estimote SDK for Android is a library that allows interaction with Estimote beacons & stickers. The SDK system works on Android 4.3 or above and requires device with Bluetooth Low Energy.

It allows for:

Expand Down
168 changes: 85 additions & 83 deletions XPlat/Estimote/Android/component/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ The system requirements are Android 4.3 and Bluetooth Low Energy.

## Quick start for beacon ranging

The `BeaconManager` class is the primary means of interating with Estimotes. Create an instance of this class, and use the `.Connect` method, passing it `BeaconManager.IServiceReadyCallback` object. When the BeaconManager is up and running, it will notify clients by call `BeaconManager.IServiceReadyCallback.OnServiceReady()`. At this point the client can start ranging or monitoring for the Estimotes.
The `BeaconManager` class is the primary means of integrating with Estimotes. Create an instance of this class, and use the `.Connect` method, passing it `BeaconManager.IServiceReadyCallback` object. When the BeaconManager is up and running, it will notify clients by call `BeaconManager.IServiceReadyCallback.OnServiceReady()`. At this point the client can start ranging or monitoring for the Estimotes.

The following code shows an example of how to use the `BeaconManager`.

```csharp
using Estimote;
using EstimoteSdk.Service;
using EstimoteSdk.Observation.Region.Beacon;

namespace Estimotes.Droid
{
Expand All @@ -17,7 +18,7 @@ namespace Estimotes.Droid
static readonly int NOTIFICATION_ID = 123321;

BeaconManager _beaconManager;
Region _region;
BeaconRegion _region;

protected override void OnCreate(Bundle bundle)
{
Expand All @@ -30,10 +31,10 @@ namespace Estimotes.Droid
// Default values are 5s of scanning and 25s of waiting time to save CPU cycles.
// In order for this demo to be more responsive and immediate we lower down those values.
_beaconManager.SetBackgroundScanPeriod(TimeUnit.Seconds.ToMillis(1), 0);
_beaconManager.EnteredRegion += (sender, e) => {
_beaconManager.BeaconEnteredRegion += (sender, e) => {
// Do something as the device has entered in region for the Estimote.
};
_beaconManager.ExitedRegion += (sender, e) => {
_beaconManager.BeaconExitedRegion += (sender, e) => {
// Do something as the device has left the region for the Estimote.
};

Expand Down Expand Up @@ -69,45 +70,45 @@ namespace Estimotes.Droid
public class NearableActivity : Activity, BeaconManager.IServiceReadyCallback
{
BeaconManager beaconManager;
string scanId;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

// Create beacon manager
beaconManager = new BeaconManager(this);

// Wearables will be triggered when nearables are found
beaconManager.Nearable += (sender, e) =>
{
ActionBar.Subtitle = string.Format("Found {0} nearables.", e.Nearables.Count;
};

//Connect to beacon manager to start scanning
beaconManager.Connect(this);
}

protected override void OnStop()
{
base.OnStop();
if (!isScanning)
return;
isScanning = false;
beaconManager.StopNearableDiscovery(scanId);
}

public void OnServiceReady()
{
isScanning = true;
scanId = beaconManager.StartNearableDiscovery();
}

protected override void OnDestroy()
{
base.OnDestroy();
beaconManager.Disconnect();
}
string scanId;
protected override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);

// Create beacon manager
beaconManager = new BeaconManager (this);

// Wearables will be triggered when nearables are found
beaconManager.Nearable += (sender, e) =>
{
ActionBar.Subtitle = string.Format ("Found {0} nearables.", e.Nearables.Count);
};

//Connect to beacon manager to start scanning
beaconManager.Connect (this);
}

protected override void OnStop ()
{
base.OnStop ();
if (!isScanning)
return;

isScanning = false;
beaconManager.StopNearableDiscovery ();
}

public void OnServiceReady ()
{
isScanning = true;
beaconManager.StartNearableDiscovery ();
}

protected override void OnDestroy ()
{
base.OnDestroy ();
beaconManager.Disconnect ();
}
}
```

Expand All @@ -116,6 +117,7 @@ public class NearableActivity : Activity, BeaconManager.IServiceReadyCallback
[Eddystone](https://developers.google.com/beacons) is an open protocol BLE protocol from Google. Estimote Beacons can broadcast the Eddystone packet.

With Estimote SDK you can:

- find nearby Eddystone beacons
- configure Eddystone ralated properties:
- URL property of `Eddystone-URL`
Expand All @@ -132,45 +134,45 @@ Following code snippet shows you how you can start discovering nearby Estimote b
public class NearableActivity : Activity, BeaconManager.IServiceReadyCallback
{
BeaconManager beaconManager;
string scanId;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);

// Create beacon manager
beaconManager = new BeaconManager(this);

// Wearables will be triggered when nearables are found
beaconManager.Eddystone += (sender, e) =>
{
ActionBar.Subtitle = string.Format("Found {0} eddystones.", e.Eddystones.Count;
};

//Connect to beacon manager to start scanning
beaconManager.Connect(this);
}

protected override void OnStop()
{
base.OnStop();
if (!isScanning)
return;
isScanning = false;
beaconManager.StopEddystoneScanning(scanId);
}

public void OnServiceReady()
{
isScanning = true;
scanId = beaconManager.StartEddystoneScanning();
}

protected override void OnDestroy()
{
base.OnDestroy();
beaconManager.Disconnect();
}
string scanId;
protected override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);

// Create beacon manager
beaconManager = new BeaconManager (this);

// Wearables will be triggered when nearables are found
beaconManager.Eddystone += (sender, e) =>
{
ActionBar.Subtitle = string.Format ("Found {0} eddystones.", e.Eddystones.Count);
};

//Connect to beacon manager to start scanning
beaconManager.Connect (this);
}
bool isScanning = false;
protected override void OnStop ()
{
base.OnStop ();
if (!isScanning)
return;

isScanning = false;
beaconManager.StopEddystoneScanning ();
}

public void OnServiceReady ()
{
isScanning = true;
beaconManager.StartEddystoneScanning ();
}

protected override void OnDestroy ()
{
base.OnDestroy ();
beaconManager.Disconnect ();
}
}

```
Expand Down
17 changes: 0 additions & 17 deletions XPlat/Estimote/Android/component/License.md

This file was deleted.

9 changes: 6 additions & 3 deletions XPlat/Estimote/Android/component/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
name: Estimote SDK for Android
id: estimotesdkandroid
publisher: "Xamarin Inc."
license: License.md
license: ../License.md
icons:
- icons/estimotesdk_128x128.png
- icons/estimotesdk_512x512.png
publisher-url: "https://www.xamarin.com"
summary: "Estimote SDK for Xamarin.Android to actively scan for Bluetooth Beacons, Nearables, and Eddystones."
details: Details.md
getting-started: "GettingStarted.md"
version: "0.11.0.1"
version: "1.0.3"
is-shell: true
libraries:
android: ../output/Xamarin.Estimote.Android.dll
packages:
android:
- Xamarin.Estimote.Android, Version=0.11.0.1
- Xamarin.Estimote.Android, Version=1.0.3
src-url: "https://www.xamarin.com"
samples:
- name: "Estimote Sample"
Expand All @@ -31,4 +31,7 @@ samples:
packages:
- Xamarin.Estimote.Android
local-nuget-repo: ../output
additional-files:
- source: "../External-Dependency-Info.txt"
destination: "THIRD-PARTY-NOTICES.txt"
no_build: true
7 changes: 4 additions & 3 deletions XPlat/Estimote/Android/nuget/Xamarin.Estimote.Android.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
<title>Estimote SDK for Xamarin.Android</title>
<authors>Xamarin</authors>
<owners>Xamarin</owners>
<licenseUrl>https://github.com/xamarin/XamarinComponents/blob/master/XPlat/Estimote/Android/component/License.md</licenseUrl>
<licenseUrl>https://github.com/xamarin/XamarinComponents/blob/master/XPlat/Estimote/Android/License.md</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Estimote SDK for Xamarin.Android to actively scan for Bluetooth Beacons, Nearables, and Eddystones.</description>
<copyright>Copyright 2016 Xamarin</copyright>
<language>en-US</language>
<iconUrl>https://xamarin-component-icons.s3.amazonaws.com/Xamarin.Estimote.png</iconUrl>
<iconUrl>https://github.com/xamarin/XamarinComponents/raw/master/XPlat/Estimote/Android/component/icons/estimotesdk_128x128.png</iconUrl>
<tags>Xamarin Xamarin.Android Estimote</tags>
</metadata>
<files>
<file src="output/Xamarin.Estimote.Android.dll" target="lib/MonoAndroid43" />
<file src="output/Xamarin.Estimote.Android.dll" target="lib/MonoAndroid50" />
<file src="External-Dependency-Info.txt" target="THIRD-PARTY-NOTICES.txt" />
</files>
</package>
Loading

0 comments on commit e524ae9

Please sign in to comment.