Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test with Android Emulator? #753

Open
tsuga opened this issue Jun 5, 2021 · 1 comment
Open

How to test with Android Emulator? #753

tsuga opened this issue Jun 5, 2021 · 1 comment

Comments

@tsuga
Copy link

tsuga commented Jun 5, 2021

Your Environment

  • Plugin version: 3.1.0
  • Platform: Android (on Emulator)
  • OS version: Android 11.0 (on Emulator, with API 30)
  • Device manufacturer and model: Google Pixel 4 (on Emulator)
  • Running in Simulator: Yes
  • Cordova version (cordova -v):
  • Cordova platform version (cordova platform ls):
  • Plugin configuration options:
  • Link to your project:

Context

I'm testing the code on the README with Android Emulator.

Expected Behavior

It should update locations when the app goes into the background.

Actual Behavior

I can see following outputs in the Logcat when I put my app into the background.

D/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Location change: Location[gps 33.340862,132.278377 hAcc=5 et=+18783d11h13m43s367ms etAcc=+1ms alt=0.0 vel=0.0 bear=0.0 vAcc=1 sAcc=1 bAcc=30 {Bundle[mParcelledData.dataSize=96]}] isMoving=false
I/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: startMonitoringStationaryRegion: lat=33.34086166666666 lon=132.27837666666666 acy=5.0
D/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Entering stationary region
D/AudioTrack: createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by server; frameCount 882 -> 1956
D/com.marianhello.bgloc.service.LocationServiceImpl: New stationary BGLocation[gps 33.340862,132.278377 id=null acc=5 t=1622891622366 et=+ë83d11h13m42s366ms alt=0.0 vel=0.0 bear=0.0 radius=5.0 {Bundle[mParcelledData.dataSize=96]} locprov=0]
D/com.marianhello.bgloc.BackgroundGeolocationFacade: Received MSG_ON_STATIONARY

However, after this, I don't see any updates even if I change the location by Emurator's Extended control.

Possible Fix

I assume that the location update is not fired because the device's accelerometer metrics remain the same. But it is the limitation by the Emulator. Is there any way to test without a physical android device?

@crhistianramirez
Copy link

If you're using android studio you can emulate location
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants