Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add your application to the "share this place" list in Google maps

Google maps now offers a way to "share a place" with what appears to be a predefined list of sources. When users search for a place on Google Maps, whether it's a specific address, cross-street, or restaurant name, there's a new button called "share this place" that posts the location info to Google Buzz, Facebook, Twitter, or via e-mail or SMS. I would like to either have my application included in this list or determine how to obtain the lat/lon of that selected location. Does anyone have any ideas?

like image 280
stanlick Avatar asked Aug 19 '10 22:08

stanlick


People also ask

How do I get permission to share a location on Google Maps?

Go to “Location sharing” in your Maps app. Select the person you want to share your location with. The person you're sharing with will now be listed at the bottom of the “Location sharing” screen. They will be notified that they now have access to your location.


1 Answers

I figured it out. Here's a sample manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.yourapp" android:versionCode="1"
    android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".YourApp" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND"></action>
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="4" />
</manifest> 

Simply add the SEND intent filter just as it is above to your activity. The "share this place" simply performs a "SEND" intent with the mime type of "text/plain". If you register an intent filter for that type, then your app will show up in the list. Mine did. =)

like image 182
HenryAdamsJr Avatar answered Oct 14 '22 10:10

HenryAdamsJr