Migrated project from Eclipse to Android Studio
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="uk.co.alt236.bluetoothlelib"
|
||||
android:versionCode="2"
|
||||
android:versionName="0.0.2" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="18" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" >
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
+3
-3
@@ -17,7 +17,7 @@ public class IBeaconDevice extends BluetoothLeDevice{
|
||||
* @param device the device
|
||||
* @param rssi the RSSI value
|
||||
* @param scanRecord the scanRecord
|
||||
* @throws IllegalArguementException if the passed device is not an iBecon
|
||||
* @throws IllegalArgumentException if the passed device is not an iBeacon
|
||||
*/
|
||||
public IBeaconDevice(BluetoothDevice device, int rssi, byte[] scanRecord) {
|
||||
super(device, rssi, scanRecord, 0);
|
||||
@@ -32,7 +32,7 @@ public class IBeaconDevice extends BluetoothLeDevice{
|
||||
* @param rssi the RSSI value of the RSSI measurement
|
||||
* @param scanRecord the scan record
|
||||
* @param timestamp the timestamp of the RSSI measurement
|
||||
* @throws IllegalArguementException if the passed device is not an iBecon
|
||||
* @throws IllegalArgumentException if the passed device is not an iBeacon
|
||||
*/
|
||||
public IBeaconDevice(BluetoothDevice device, int rssi, byte[] scanRecord, long timestamp){
|
||||
super(device, rssi, scanRecord, timestamp);
|
||||
@@ -45,7 +45,7 @@ public class IBeaconDevice extends BluetoothLeDevice{
|
||||
* iBeacon Device.
|
||||
*
|
||||
* @param device the device
|
||||
* @throws IllegalArguementException if the passed device is not an iBecon
|
||||
* @throws IllegalArgumentException if the passed device is not an iBeacon
|
||||
*/
|
||||
public IBeaconDevice(BluetoothLeDevice device){
|
||||
super(device);
|
||||
+1
-1
@@ -60,7 +60,7 @@ public final class IBeaconManufacturerData {
|
||||
/**
|
||||
* Instantiates a new iBeacon manufacturer data object.
|
||||
|
||||
* @param data the {@link #uk.co.alt236.bluetoothlelib.device.adrecord.AdRecord.TYPE_MANUFACTURER_SPECIFIC_DATA} data array
|
||||
* @param data the {@link uk.co.alt236.bluetoothlelib.device.adrecord.AdRecord#TYPE_MANUFACTURER_SPECIFIC_DATA} data array
|
||||
* @throws IndexOutOfBoundsException if the data array is shorter than expected
|
||||
*/
|
||||
public IBeaconManufacturerData(byte[] data){
|
||||
+4
-4
@@ -29,11 +29,11 @@ public class IBeaconUtils {
|
||||
/**
|
||||
* Calculates the accuracy of an RSSI reading.
|
||||
*
|
||||
* The code was taken from {@link http://stackoverflow.com/questions/20416218/understanding-ibeacon-distancing}
|
||||
* The code was taken from {@linktourl http://stackoverflow.com/questions/20416218/understanding-ibeacon-distancing}
|
||||
*
|
||||
* @param txPower the calibrated TX power of an iBeacon
|
||||
* @param rssi the RSSI value of the iBeacon
|
||||
* @return
|
||||
* @return the calculated Accuracy
|
||||
*/
|
||||
public static double calculateAccuracy(int txPower, double rssi) {
|
||||
if (rssi == 0) {
|
||||
@@ -54,7 +54,7 @@ public class IBeaconUtils {
|
||||
* Ascertains whether a {@link uk.co.alt236.bluetoothlelib.device.BluetoothLeDevice} is an iBeacon;
|
||||
*
|
||||
* @param device a {@link uk.co.alt236.bluetoothlelib.device.BluetoothLeDevice} device.
|
||||
* @return
|
||||
* @return true if the device is an iBeacon, false otherwise
|
||||
*/
|
||||
public static boolean isThisAnIBeacon(BluetoothLeDevice device){
|
||||
return isThisAnIBeacon(
|
||||
@@ -64,7 +64,7 @@ public class IBeaconUtils {
|
||||
/**
|
||||
* Ascertains whether a Manufacturer Data byte array belongs to an iBeacon;
|
||||
*
|
||||
* @param scanRecord a Bluetooth LE device's manufacturerData.
|
||||
* @param manufacturerData a Bluetooth LE device's raw manufacturerData.
|
||||
* @return
|
||||
*/
|
||||
public static boolean isThisAnIBeacon(byte[] manufacturerData){
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
@@ -0,0 +1,11 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme for API 11+. This theme completely replaces
|
||||
AppBaseTheme from res/values/styles.xml on API 11+ devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
|
||||
<!-- API 11 theme customizations can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,12 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme for API 14+. This theme completely replaces
|
||||
AppBaseTheme from BOTH res/values/styles.xml and
|
||||
res/values-v11/styles.xml on API 14+ devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
|
||||
<!-- API 14 theme customizations can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,5 @@
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Bluetooth LE Library</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,20 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme, dependent on API level. This theme is replaced
|
||||
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Light">
|
||||
<!--
|
||||
Theme customizations available in newer API levels can go in
|
||||
res/values-vXX/styles.xml, while customizations related to
|
||||
backward-compatibility can go here.
|
||||
-->
|
||||
</style>
|
||||
|
||||
<!-- Application theme. -->
|
||||
<style name="AppTheme" parent="AppBaseTheme">
|
||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user