Reputation: 7415
I wanna share some fixed lat,long & text via ACTION_SEND
using Intent. I can share 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 cant find the way which whatsapp using to share location. Is there any way to share location like whatsapp did? OR pass some static image & by clicking on that image, map should be open in default chooser @ user side.Is there any way to implement that scenario?
Thanks.
Upvotes: 5
Views: 5684
Reputation: 2737
there's an really awesome github project called yowsup who reverse engineered whatsapp protocol. here's the location sharing layer from it, you might find it handy
<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>
Upvotes: 1