How do I Add Real-Time Timestamp and GPS Location Directly Onto Captured Image?

Hello everyone,

I am developing an Android app using MIT App Inventor and I want to implement a feature similar to a “TimeMark” camera.

My goal is:

  • When the user takes a photo using the Camera component
  • The saved image should automatically include:
    • Real-time timestamp (date and time)
    • GPS location (either full address or latitude/longitude)
  • The text should be embedded directly into the image file (not just overlayed on the screen)

I would like the final result to be a single image file with the timestamp and location permanently written onto it.

My questions:

  1. What is the best way to draw text (timestamp + GPS data) directly onto the captured image in App Inventor?
  2. Is using Canvas.DrawText after loading the image into Canvas the correct approach?
  3. Are there recommended extensions (e.g., image processing extensions) that handle this more reliably?
  4. What is the best practice to ensure the GPS location is accurate before capturing the photo?

I want the solution to be stable and reliable on modern Android versions.

Any guidance or recommended architecture would be greatly appreciated.

Thank you!

Use Canvas draw text.

is there any example of block?

All four things?

Nah, only for draw text (GPS and Timestamp) onto the captured image, by using Canvas

This will put the drawn text in the left bottom corner of the canvas ( Ihad a canvas of 300x300)

Use canvas save or saveas to output an image with the text.

Hi, I build a timestamp camera app so I've solved these exact problems. Canvas.DrawText is the right approach and TIMAI2's blocks will work, but a few things will bite you later. Draw the text after you scale the image, not before, or the font size will be wrong on different resolutions. Draw it twice, once in black offset by one pixel and once in white on top, otherwise the text disappears on bright surfaces like snow or white walls. For the GPS, don't read the location at the moment of capture. Start the LocationSensor when the camera screen opens and keep the last good reading, because a cold fix can take fifteen seconds and your user will have already taken the photo. Check the accuracy value and don't stamp anything if it's worse than about fifty metres, since a wrong location is worse than none. And if you want the street address rather than coordinates you'll need a reverse geocoding call, which needs a connection, so handle the offline case by stamping coordinates only. If you want to see how the output should look, mine is GeoProof.

iPhone: ‎GeoProof: GPS Timestamp Camera App - App Store
Android: https://play.google.com/store/apps/details?id=app.easygeostamp.com

You may also want to consider this when outputting the canvas to file...