0

I retrieve the lat & long for the event detail. And I want to send lat long to calendar using intent. I search it on google but didn't find any solution? Please help.

SMAG
  • 652
  • 6
  • 12
Rabindra Acharya
  • 1,868
  • 2
  • 18
  • 32

2 Answers2

0

You could attain this using CalendarContract class. Adding location is possible using this class; CalendarContract.Events.EVENT_LOCATION

More info here Adding event with reminders to calendar with 'Intent.putExtra()' way of doing

Community
  • 1
  • 1
Febi M Felix
  • 2,799
  • 1
  • 10
  • 13
  • Just sending the lat long via the CalendarContract.Events.EVENT_LOCATION would not, I think, be enough to answer the question. The best reason to have the lat long in the calendar event would be so that from inside calendar, an invited person could click on that location to see it on Google Map, get directions, etc. – James A Wilson Mar 23 '17 at 11:40
0

Using the Google API with other languages, I have been able to pass the Latitude and Longitude as a string and the map link in the Calendar Event drops a pin in the correct position. I would imagine that that API has the same behavior for all languages.

Source: Latitude and Longitude of the White House

C# psuedo code

var latitude = "38.8976763";
var longitude = "-77.0365298";

new Event
{
   // beginning parameters
   ...

   // The comma is optional and replaceable with a single space
   Location = $"{latitude}, {longitude}", 

   ... 
   // final parameters
}

image from Event detail added by Google API: Screen Snipit of adding Event with Google API

Resulting Link when clicking map from the Calendar Event:

map

SMAG
  • 652
  • 6
  • 12