I made a bicycle GPS logger some time ago. As there was an SD card, I could record KML files directly.
You may be interested in having a look at: https://docs.fileformat.com/gis/kml/
Is it possible to download the google Maps ? if yes how to download it and what is the format ?
So apparently you don't want to implement only the tracker but also display google maps that you have
downloaded, right? That's certainly possible. There is an application allowing you to store data in you phone when you go to a region of the world without a proper SIM card, or if you want to save on your communication bill. You just download the country you want to go to and then you can access it when you are in that country, without having a realtime access.
That said, I haven't used it for a while. I just had a look at the net:
You can save an area from Google Maps to your phone or tablet and use it when you're offline. Tip: You’re unable to download offline maps in some countries or reg
support.google.com
I have never used it but I have used something similar on iPhone.
That said, I'm not sure if it's an open format. If not, there are probably open source alternatives.