Select to view content in your preferred language

ANR/Crash in Geometry Editor insertVertex during Location Updates

201
3
Jump to solution
10-01-2025 01:21 PM
NicoleLeiva25
Emerging Contributor

Hi Community, 👋

We're experiencing an ANR and subsequent crash in our Android app, which appears to be triggered by a call to the geometry editor function insertVertex when we try to add a point during live location updates. In our use case, users could be driving, and their location is updated every 3 meters. Since we can't know how fast a user might be moving, we end up with many frequent location updates—each one triggering a call to insertVertex, which we suspect may be blocking the main thread and causing the ANR.

Has anyone encountered similar issues with geometry editor during frequent live location updates? Are there best practices or recommended approaches for handling high-frequency vertex insertion without risking UI freezes or crashes?

Any advice or suggestions would be greatly appreciated!

Thanks in advance!


SDK Version: 200.7.0

1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor

How many vertices does your resulting geometry have?

The geometry editor supports editing a geometry with a few thousand vertices, but the performance decreases when the number of vertices increases.

Your issue might be that you are trying to insert vertices faster than the editor can process them.

To ensure stability and maintain acceptable performance, you might limit the rate of vertex insertion by implementing a 1-second cooldown/timer between insertions.

Is limiting the vertex insertion frequency to approximately one per second an acceptable constraint for your specific use case?

View solution in original post

3 Replies
DominiqueBroux
Esri Frequent Contributor

How many vertices does your resulting geometry have?

The geometry editor supports editing a geometry with a few thousand vertices, but the performance decreases when the number of vertices increases.

Your issue might be that you are trying to insert vertices faster than the editor can process them.

To ensure stability and maintain acceptable performance, you might limit the rate of vertex insertion by implementing a 1-second cooldown/timer between insertions.

Is limiting the vertex insertion frequency to approximately one per second an acceptable constraint for your specific use case?

NicoleLeiva25
Emerging Contributor

Hi, @DominiqueBroux ! Thanks for getting back to me!

The resulting geometry ended up having more than 5,000 points before it crashed.
Yes, we’re aware of the performance impact as well.

While reviewing this issue, we also fixed our logic to ensure we respect the 1-second interval per point insertion. So I think we’re in good shape now and the user reported that it’s working better.

Thanks for your recommendation! 🙌

 

DominiqueBroux
Esri Frequent Contributor

Glad the workaround is working for you 👍

0 Kudos