Using sendTrack() to send a track with more than 10,000 points fails.

Bob Kowalski shared this problem 8 months ago
Solved

I am using ActionDisplayTracks.sendTrack() to export tracks, cue information, and points of interest to Locus Map. I have set extraAction = ActionDisplayVarious.ExtraAction.IMPORT and startNavigation = false. If I create a route with more than 10,000 points the call to sendTrack(), the call returns true but does not launch Locus Map and display the import page as it does with routes created with less than 10,000 points.

Replies (10)

photo
1

Hello Bob,

may you please check logcat? Isn't there something suspicious? Current Android 'Intent' supports data up to 1 MB. So here is a question, if the track you try to send isn't bigger than this value.

Menion

photo
1

Hi Menion,

Thanks for the quick response. I don't see anything in Logcat that indicates a problem. The following is the total Logcat output from the point when I create the track to after calling sendTrack(), including the response I got, to when my application has control again.

sendTrack() returned true which I interpret as success.

Bob


I/Ride2LM: adding 18721 points to track
I/Ride2LM: adding 0 turn cues
    adding 0 points of interest
    Created track with 18721 points and 0 cuepoints and POIs
I/Ride2LM: adt.sendTrack() : true
I/OpenGLRenderer: Davey! duration=1104ms; Flags=0, IntendedVsync=1570624046878774, Vsync=1570625130212064, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1570625144072685, AnimationStart=1570625144253779, PerformTraversalsStart=1570625145433050, DrawStart=1570625145841227, SyncQueued=1570625146728987, SyncStart=1570625146801019, IssueDrawCommandsStart=1570625146910133, SwapBuffers=1570625150233258, FrameCompleted=1570625151071800, DequeueBufferDuration=224000, QueueBufferDuration=260000, 
D/ViewRootImpl@825b937[ExportRouteToLPActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView@e2b3e9[ExportRouteToLPActivity]
    getNavigationBarColor() -855310
D/ViewRootImpl@825b937[ExportRouteToLPActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView@e2b3e9[ExportRouteToLPActivity]
    getNavigationBarColor() -855310

photo
1

That was an extreme example. I have seen tracks with just over 10,000 (approximately 10,300) fail the same way.

I expected a return value of "false" or an exception to be thrown but not just a return of "true".

photo
1

Hello Bob,

I'm just testing it with API sample app. With a track with 30k trackpoint, I receive the following error in the log

/1396c8dc36b8ef960ceecdf9951c8e6f

As you may see, this track is too big and even if "sendTrack()" returns true, the system is unable to send an intent with a bundle bigger then 1MB. The correct solution is, like in the case of points, to create a method "sendTrackFile" that will store the track into the filesystem and send to Locus Map only for reference on this file.

Little more work for now. So I suggest keeping the final track Storable below this 1MB limit. Seems that with max. 15k trackpoints, you should be save. Is it acceptable for now?

Menion

photo
1

Menion,

I understand the intent 1MB limit and understand there is nothing you can do to work around that. I was assuming that there would be some sort of error indication rather than just a return to my application.

In any case, if I use sendTrackFile() I am forced to convert my data to some file format importable by Locus Map (KML, KMZ, GPZ, TCX, GeoJSON). While generating a GPX file (or any others) is not a problem, I am concerned that I will loose some of the route fidelity I can achieve with sendTrack(). Is there an import format that you feel allows me to achieve the maximum route and point descriptive capability (turn-by-turn nav, segment colors, custom icons, etc)?


For instance, if I selected GPX, is there someplace I can get documentation on the locus extensions?

I've included an example below:


<wpt lat="35.7369480" lon="-79.0003330">

<ele>87.30</ele>

<time>2021-04-04T09:47:54.728Z</time>

<name>Rest Stop - Cruizers</name>

<cmt>Rest Stop - Cruizers</cmt>

<sym>50</sym>

<extensions>

<locus:icon>navig:50</locus:icon>

<locus:rteDistance>6372.0356</locus:rteDistance>

<locus:rtePointAction>pass_place</locus:rtePointAction>

</extensions>

</wpt>


Thanks again

Bob

photo
1

Hello Bob,

In the end, I spend almost a day creating a new system for sending tracks to the Locus Map app. Unfortunately, seems that jCenter repository is ending and I have to convert the whole API to MavenCentral. It will take some time (few days) as I already spend too much time on this just before the release of the new version.

Sending over GPX or other format does not make sense. The solution is prepared so count on it. I'll let you know once the new API version will be published.

Menion

photo
1

Menion,

That's great news. I'll be waiting. Please keep in mind that I am willing to help test before it is released if you want to share with me.

Bob

photo
1

Hello Bob,

so new API + latest app Beta version should work. Check mainly new method how to send tracks here.

Let me know if new methods make sense to you and are working as expected. It is a new system, so nobody uses it yet and we may improve it.

Jiří M. aka Menion

photo
1

Menion,


Looks like the new call works as advertised. I was able to use the old calls with routes of less than 10,000 points and everything worked as before. I have new routes with in excess of 20,000 points and calls to the new API these now transition as expected. Thanks. Will continue to test and will advise if I find any issues.


BJ

photo
1

Hello Bob,

perfect. You probably noticed that you may use a new system to prepare the track for send and just use `send` or `sentOverFile` methods. This first one uses the old API in the background so it will work on all Locus Map apps out there.

Jiří M. aka Menion

Leave a Comment
 
Attach a file