How to distribute a location like Whatsapp?

I want to share some fixed lat, long and text through ACTION_SENDwith Intent. I can pass url like String shareBody = "http://maps.google.com?q="+lat+","+lng;Image like

sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("android.resource://" + context.getPackageName()
                        + "/drawable/" + "ic_launcher"));
sharingIntent.setType("image/*")

but I can't find a way to use whatsapp to share location. Is there a way to share a location like whatsapp? OR transfer some kind of static image, and by clicking on this image, the map should be opened by default at the choice of the user @user. Is there any way to implement this scenario?

Thank.

+4
source share
1 answer

github, yowsup, whatsapp. ,

<message t="{{TIME_STAMP}}" from="{{CONTACT_JID}}" 
    offline="{{OFFLINE}}" type="text" id="{{MESSAGE_ID}}" notify="{{NOTIFY_NAME}}">
        <media 
            latitude="52.52393" 
            type="location"
            longitude="13.41747"
            name="Location Name"
            url="http://www.foursquare.com/XXXX"
            encoding="raw"
        >{{THUMBNAIL_RAWDATA}}</media>
    </message>
+1

Source: https://habr.com/ru/post/1529928/


All Articles