Estimote / Android-Indoor-SDK

Estimote Indoor SDK for Android
MIT License
63 stars 28 forks source link

Position Update Issues #11

Open mimminito opened 6 years ago

mimminito commented 6 years ago

Prerequisites

Basic information

Estimote SDK version: Indoor SDK 2.0.1

Android devices affected: Samsung Galaxy S8+

Android OS version affected: 7.0

Beacon hardware version: [Paste here your beacons hardware version (you can check that in Estimote Cloud).] I1.2

Description

When using the Estimote Indoor Location SDK I am not getting updates on Android properly. When I start positioning updates I first get an initial position which is roughly correct, but all updates after that are the same position no matter where I move the device. This occurs in both my custom app and when building the example in this repo.

Steps to reproduce:

  1. Load up example app
  2. Select a location
  3. Start positioning
  4. Updates are not correct

Expected behavior: The SDK should report back correct position updates like it does on iOS

Actual behavior: It does not report back correct position updates.

pawelDylag commented 6 years ago

Hey @mimminito

My first guess is that there is a scanning problem on Samsung Galaxy S8 - I will verify it, but you can help me by launching your app on any other Android 5.0+ phone and checking if it works correctly.

Cheers!

mimminito commented 6 years ago

@pawelDylag I have tried this on a Samsung Galaxy S6 and I am getting the same issues. The first callback reports a rough position and the rest of the reports are coming back as that same value. Stopping and starting the positioning service repeats this issue.

yushakareem commented 6 years ago

Hi guys! I've just recently started playing with the estimote beacons. I also tried running the example in this Repo. It worked on Samsung Galaxy S6 (Android version 7.0) It worked on Samsung Galaxy A5 (Android version 7.0) It did not work on Google Pixel 2 xl (Android version 8.1.0) It did not work on Google Pixel 1 (Android version 8.1.0)

The example works just as described by @mimminito. I was expecting it to work .. as it can be seen in this youtube video https://www.youtube.com/watch?v=9cH44pE1Fks. :)

P.S: Could test on different phones. Thanks to my family members having different ones :)

I am a beginner ... any tips or suggestions (for overall elegant working of Indoor location app) from you both (@pawelDylag @mimminito ) would be great for me :)

mimminito commented 6 years ago

@pawelDylag Any update on this? Could really do with an answer to this issue.

pawelDylag commented 6 years ago

Hey @mimminito and @yushakareem

I have tested the version 2.0.1 with our example app, on Google Pixel 2 (8.1.0), Samsung S6 (7.0.0), and Nexus 6P (7.0.0). Everything works fine with our office location. I am really curious about your problem, because I couldn't reproduce it on any phone. To sum things up:

  1. Your bluetooth is OK - the initial location is displaying, so it must be working properly.
  2. The algorithm is being updated every 1s with the new scan data, so if there is no change, I suspect there are problems either with new scans, or your location beacons are not properly set up.

Could you please let me know how many beacons does your location have? And also what are the distances between them?

We will figure it out, Paweł

mimminito commented 6 years ago

Hi @pawelDylag

Yes bluetooth is fine, and as you said we get the initial position back but from then on the same data comes back every time during the scan callbacks.

Are you able to access our location data on our account so you can view the setup yourself? This location works fine on iOS just not on Android.

It would be great if you could send me the APK you have tested so I can install that on my device to ensure there are no build issues?

Thanks, Adam

pawelDylag commented 6 years ago

Hey @mimminito

Could you check the version 2.1.0, please? If your problem still occurs, please enable debug logging like this:

// since version 2.1.0 there is a fourth parameter for enabling debug logging
val debugLogging = true
indoorLocationManager = 
        IndoorLocationManagerBuilder(appContext, location, cloudCredentials, debugLogging)
                .withScannerInForegroundService(notification)
                .build()

And send us logs from your scanning then :)

Regards, Paweł

yushakareem commented 6 years ago

Hey @pawelDylag @mimminito ! Here are some updates from my side.

Firstly, just as @pawelDylag tested, with version 2.0.1. The example app is working. I have tested on google pixel 2 xl (8.1.0) and an LG phone (5.0). Although, note that, the example-app is not using the inertial sensors for its localization algorithm, hence the value of orientation is always zero and the x,y coordinates just change their values in 'straight lines', ie, from one beacon to another. (@pawelDylag can correct me if I am wrong)

I have a new question though: Q. By comparing the android-example-app with the indoor-location-ios-app. I've noticed that, the android-example-app is working in a "standard" way (in the ios-app there are options of choosing "standard" or "with inertial-sensors included" or "with AR-kit included" in the localization algorithm). So :) .. my question is, Can I use some function in the indoor-location-sdk, that can enable the use of inertial sensors for localization in the example app?

Side Note: Oh! also @pawelDylag, In my 'build.gradle' file, I did, compile 'com.estimote:indoorsdk:2.1.0'. But the new class IndoorLocationManager does not show up. Its an Interface, as it was in 2.0.1.

Thank you Kind regards Yusha

P.S: @pawelDylag .. I read your entire "short" story on Medium. It was awesome ... very well written!! You have hooked me on the power of using Kotlin+RxJava ... Thank you!! :D

pawelDylag commented 6 years ago

Hey @yushakareem

  1. There is no inertial sensors in Android SDK unfortunately. This feature is yet to be added, but for now our SDK reports orientation as 0.0 no matter what. We got this task scheduled, but due to the large amount of work I can't say when it will be added. Probably when more people will ask about this, our product owners will put a priority on this and will let us work on it ^^

  2. No, there is no secret "switch" between modes in Android Indoor SDK. The iOS version is much more robust because it has been developed for much longer time than our Android stuff. We still need to catch up with all those features (orientation, location view rotation and scaling, improved algorithms, etc). We're be adding this over time in not-so-distant-future ;) Stay tuned!

  3. @yushakareem I pasted the wrong snipped by a mistake. I edited the post. This should obviously look like this:

// since version 2.1.0 there is a fourth parameter for enabling debug logging
val debugLogging = true
indoorLocationManager = 
        IndoorLocationManagerBuilder(appContext, location, cloudCredentials, debugLogging)
                .withScannerInForegroundService(notification)
                .build()

P.S: Thanks a lot for kind words! Kotlin + RxJava2 combo is super effective :) 🚀

Regards, Paweł

yushakareem commented 6 years ago

@pawelDylag Thank you!! Will stay tuned :D

Kind regards, Yusha

HubITgr commented 6 years ago

Hello, I also experience the same issue, even with the example. When my tablet (samsung galaxy tab 2, Android 7.0) locks the screen the onPositionUpdate starts working with new values, when I resume the app it works for 10 seconds and then I get the same results. The position gets updated after 10 seconds if I am near a beacon.

Fenetik commented 6 years ago

same issue with S5 with Android 6.0.1 while running the indoorsdk:2.1.0 When changing the location during runtime, this issue seems to "solve itself", because in the new location the positioning seems to work fine although it seems like multiple instances of indoorManager are working at the same time because updates are coming in faster than before (before they were coming every second and afterwards twice per second)

ghost commented 6 years ago

I was facing same issue. I fixed the issue by downgrading sdk version to 2.5.3 Also I have taken one textView to get x, y coordinates and updated method as below:

override fun onPositionUpdate(locationPosition: LocationPosition) { indoorLocationView.updatePosition(locationPosition) runOnUiThread { txtVwLocationCords.setText("x: " + df.format(locationPosition.x)+ "\n" +"y: "+ df.format(locationPosition.y)) } } Although it's not smooth as ios version. I am using samsung j7 device. Happy coding :-)