update: 2016/07/20
reference:
1. Beacon Tech Overview - Estimote Developer
Part 1: Setting up
A. Create a beacon project
1. Start a new Android Studio project
> Next
B. Add Estimote SDK
1. 查詢 Estimote Android SDK 最新的版本:
Releases · Estimote/Android-SDK
目前:
dependencies {
compile 'com.estimote:sdk:0.10.8@aar'
}
2. 加入 Estimote SDK:
> 開啟 Gradle Script > build.gradle (Module: app), 修改如下:
....
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.0'
//@add ########################
// add the following line, and replace "0.10.4" with the latest version
// of Estimote Android SDK; you'll find the latest version number on:
// https://github.com/Estimote/Android-SDK/releases
compile 'com.estimote:sdk:0.10.8@aar'
}
3. 接著右上方出現訊息: Gradle files have changed since last project sync …
> 按下 Sync Now
C. Runtime permissions (Android 6.0)
1. 開啟 MainActivity.java 修改如下:
package myhome.airport;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.estimote.sdk.SystemRequirementsChecker;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
//@add ########################
@Override
protected void onResume() {
super.onResume();
//@add ########################
// Runtime permissions (Android 6.0)
SystemRequirementsChecker.checkWithDefaultDialogs(this);
}
}
2. 執行:
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。