How to do Beacon Analytics in Android?

Hi as clear in my question title How to implement Beacon Analytics in Android?

Already refered Official Page but still confused.

How to do in Android?

Mi there,

Currently, analytics are only supported in the iOS version of our SDK. Support for Android is in plans but it’s hard to say when exactly it will be publicly available.

Cheers.

1 Like

Ok thanks for your replay.

Any news about Android analytics?

1 Like

Yes, they’re here! (:

For setup, you can pretty much follow the same tutorial as for iOS:

http://developer.estimote.com/ibeacon/analytics/

… except use the Android SDK ranging/monitoring, plus enable analytics via:

1 Like

I get this response when trying this:

E/EstimoteSDK: com.estimote.sdk.cloud.internal.analytics.AnalyticsManager$2.failure:260 Unable to obtain owned devices for Analytics
               com.estimote.sdk.exception.EstimoteServerException: 503 Service Unavailable
                   at com.estimote.sdk.cloud.internal.InternalEstimoteCloud$7.failure(InternalEstimoteCloud.java:467)
                   at com.estimote.sdk.repackaged.retrofit_v1_9_0.retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
                   at android.os.Handler.handleCallback(Handler.java:746)
                   at android.os.Handler.dispatchMessage(Handler.java:95)
                   at android.os.Looper.loop(Looper.java:148)
                   at android.app.ActivityThread.main(ActivityThread.java:5443)
                   at java.lang.reflect.Method.invoke(Native Method)
                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
                Caused by: com.estimote.sdk.repackaged.retrofit_v1_9_0.retrofit.RetrofitError: 503 Service Unavailable
                   at com.estimote.sdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:387)
                   at com.estimote.sdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler.access$000(RestAdapter.java:219)
                   at com.estimote.sdk.repackaged.retrofit_v1_9_0.retrofit.RestAdapter$RestHandler$1.obtainResponse(RestAdapter.java:277)
                   at com.estimote.sdk.repackaged.retrofit_v1_9_0.retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                   at com.estimote.sdk.repackaged.retrofit_v1_9_0.retrofit.Platform$Android$2$1.run(Platform.java:134)
                   at java.lang.Thread.run(Thread.java:818)

My name is Vu in Vietnamese.

Thank you very much for your support.
I want to enable Beacon Analytics in Android and i follow your guide.
But it can not enable Beacon Analytics.
please help me to give your opinion.
My Code:

public class MyApplication extends Application {

    private boolean beaconNotificationsEnabled = false;

    private BeaconManager beaconManager;
    private Region mRegion;
    private String text;

    @Override
    public void onCreate() {
        super.onCreate();
        beaconManager = new BeaconManager(this);
        beaconManager = new BeaconManager(getApplicationContext());
        EstimoteSDK.initialize(getApplicationContext(), "beaconnotificationinout-13l", "fd055c02d294cbf74482b5ad3b5a5998");
        mRegion = new Region("ranged region", UUID.fromString("CA9EFD85-F465-298A-B277-A6A9DE442E13"), 14165, 31220);
        //setMonitoringListeners();
       // setRangingListener();
        beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
            @Override
            public void onServiceReady() {
                // Ready to start scanning!
                beaconManager.startMonitoring(mRegion);
                // beaconManager.startRanging(defaultUUIDRegion);
                beaconManager.startRanging(mRegion);
            }
        });

        //beaconManager.startRanging(region);
        EstimoteSDK.enableRangingAnalytics(true);
        EstimoteSDK.enableMonitoringAnalytics(true);
        EstimoteSDK.enableGpsPositioningForAnalytics(true);

        beaconManager.startRanging(mRegion);
        beaconManager.startMonitoring(mRegion);
        // uncomment to enable debug-level logging
        // it's usually only a good idea when troubleshooting issues with the Estimote SDK
//        EstimoteSDK.enableDebugLogging(true);

        setMonitoringListeners();
        setRangingListener();
    }

    public void enableBeaconNotifications() {
        if (beaconNotificationsEnabled) { return; }

        BeaconNotificationsManager beaconNotificationsManager = new BeaconNotificationsManager(this);
        beaconNotificationsManager.addNotification(
                new BeaconID("CA9EFD85-F465-298A-B277-A6A9DE442E13", 14165, 31220),
                "Hello, world.",
                "Goodbye, world.");
        beaconNotificationsManager.startMonitoring();
        beaconNotificationsEnabled = true;
    }

    public boolean isBeaconNotificationsEnabled() {
        return beaconNotificationsEnabled;
    }

    public void setMonitoringListeners() {
        beaconManager.setMonitoringListener(new BeaconManager.MonitoringListener() {
            @Override
            public void onEnteredRegion(Region region, List<Beacon> list) {
                if (region.getIdentifier().equals(mRegion.getIdentifier())) {
                    beaconManager.startMonitoring(region);
                }
                  //beaconManager.startMonitoring(region);
          
            }

            @Override
            public void onExitedRegion(Region region) {

                text="Out";
                //beaconManager.stopMonitoring(region);
                if (region.getIdentifier().equals(mRegion.getIdentifier())) {
                    beaconManager.stopMonitoring(region);
                }
            
            }
        });
      
    }

    public void setRangingListener(){
        beaconManager.setRangingListener(new BeaconManager.RangingListener() {
            @Override
            public void onBeaconsDiscovered(Region region, List<Beacon> beacons) {
                if (beacons.size() != 0) {
                    Beacon beacon = beacons.get(0);
                   }
            }
        });

I’ve had the same problem with this, would like to know that have you solved this yet and how?
Thanks a lot!