Receive information shared by Google Maps

Asked

Viewed 24 times

1

I have an application where you can share links! I do this by taking information from meta og with Jsoup:

  final Document doc = Jsoup.connect(url).get();

            final Elements itens = doc.select("meta[property^=og:]");

            if (itens.size() <= 0) {
                return null;
            }

            final ObjectPreview objectPreview = new ObjectPreview();
            objectPreview.url = url;

            for (int i = 0; i < itens.size(); i++) {
                Element tag = itens.get(i);

                String text = tag.attr("property");
                if ("og:image".equals(text)) {
                    objectPreview.image = tag.attr("content");
                } else if ("og:description".equals(text)) {
                    objectPreview.description = tag.attr("content");
                } else if ("og:title".equals(text)) {
                    objectPreview.title = tag.attr("content");
                }
            } 

I would like to get this information through the Google Maps App:

  1. When shared with Maps in addition to the url, the name of the Location comes.

Ex.: Restaurante Come come \n https://url/mapa/c0009080

So far so good!

(I’ve done a beautiful trick: split in the http and good!)

  1. When I try to get the elements (code above) I cannot access this information!

How can I get this information (just like Whatsapp does) from a link coming from Google Maps?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.