Matrix API and Google TTS Integration with location tracker in android app

Oct 13, 2021
Reaction score
I am developing an app based on JavaScript. There's a certain process I want but am not sure how to move forward with it. The following is the process if anyone could help me with the code for the idea.

So the person clicks a button on the main home page after which another activity is opened. Here, the app quickly takes the location of the person and gives the Matrix Api the coordinates. Along with a coordinate previously chosen in the login screen saved on the firebase database, the coordinates apply to the Matrix API and find the time taken to reach. Over here for an example:-

$curl ";curb&access_token=YOUR_MAPBOX_ACCESS_TOKEN"
where c is for the current location taken and h for the location from the login screen.

This returns a JSON file for example:-

"code": "Ok",
"durations": [
[ 0, 573],
[ 573, 0],

where I'll take 573 secs from the JSON file and convert it to minutes in the code and then apply it to the following text:- "The car will reach you in 'a' minutes" where 'a' is the time and then this text is spoken through google TTS.

The official documentation of the Matrix API that I was thinking of taking:- and the above code is based on it itself

Can someone tell me how to code this part of my app out... I think this is a bit based on my python development skills as I have used the same logic but I'm not sure how to add that into my app as I'm new to Android Development so if anyone could help it would be great. Pls, Help

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Latest member

Latest Threads