<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>activity &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/tag/activity/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Sun, 19 Sep 2010 06:48:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>activity &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Android: Create your own sharing app</title>
		<link>https://blog.sephiroth.it/2010/09/18/android-create-your-own-sharing-app/</link>
					<comments>https://blog.sephiroth.it/2010/09/18/android-create-your-own-sharing-app/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Sat, 18 Sep 2010 21:44:59 +0000</pubDate>
				<category><![CDATA[android]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[activity]]></category>
		<category><![CDATA[share]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=1377</guid>

					<description><![CDATA[One of the first applications I did for Android was a very simple application which simply takes a picture using Camera and then send it to a remote server. Very simple, but it introduced to me into the android world and the notion of activities and communication between different applications. A little addition to this &#8230; <a href="https://blog.sephiroth.it/2010/09/18/android-create-your-own-sharing-app/" class="more-link">Continue reading <span class="screen-reader-text">Android: Create your own sharing app</span></a>]]></description>
										<content:encoded><![CDATA[<p>One of the first applications I did for Android was a very simple application which simply takes a picture using Camera and then send it to a remote server. Very simple, but it introduced to me into the android world and the notion of activities and communication between different applications.<br />
 A little addition to this application I wanted to make was the possibility to share any of the pictures already taken. To do that I wanted to add the application to the list of the choices which appear when an user click on the &#8220;share&#8221; button when view an image using the default Gallery application.</p>
<p><span id="more-1377"></span></p>
<p>Nothing easier than that! It was just a matter of a couple of tags to be added to the AndroidManifest.xml and the trick was done!<br />
 Here the manifest:</p>
<p><code lang="xml"><br />
< ?xml version="1.0" encoding="utf-8"?><br />
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
	package="com.aviary.app.AviaryPhoto" android:versionCode="1"
	android:versionName="1.0"><br />
	<application android:icon="@drawable/icon" android:label="@string/app_name"
		android:debuggable="true"><br />
		<activity android:name=".MainActivity" android:label="@string/app_name"
			android:theme="@android:style/Theme.NoTitleBar"
			android:screenOrientation="landscape"><br />
			<intent -filter><br />
				<action android:name="android.intent.action.MAIN" /><br />
				<category android:name="android.intent.category.LAUNCHER" /><br />
			</intent><br />
		</activity></p>
<p>		<activity android:name=".MainActivity" android:label="@string/app_name"
			android:theme="@android:style/Theme.NoTitleBar"
			android:screenOrientation="landscape" android:icon="@drawable/icon"><br />
			<intent -filter><br />
				<action android:name="android.intent.action.SEND" /><br />
				<category android:name="android.intent.category.DEFAULT" /><br />
				<data android:mimeType="image/*" /><br />
			</intent><br />
		</activity></p>
<p>		<activity android:name=".MainActivity" android:label="@string/app_name"
			android:theme="@android:style/Theme.NoTitleBar"
			android:screenOrientation="landscape" android:icon="@drawable/icon"><br />
			<intent -filter><br />
				<action android:name="android.intent.action.CHOOSER" /><br />
				<category android:name="android.intent.category.DEFAULT" /><br />
				<data android:mimeType="image/*" /><br />
			</intent><br />
		</activity><br />
	</application><br />
	<uses -sdk android:minSdkVersion="7" /><br />
	<uses -permission android:name="android.permission.CAMERA" /><br />
	<uses -permission android:name="android.permission.INTERNET" /><br />
	<uses -permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><br />
</manifest><br />
</code></p>
<p>The tricky part is to add the two <a href="http://developer.android.com/guide/topics/manifest/action-element.html">actions</a> android.intent.action.SEND and android.intent.action.CHOOSER to the manifest, and the system will do the rest. In this way, when a user will select the application from the sharing list a new activity will be launched and it will just a matter of checkin which intent has been sent to get the image uri which has to be shared:</p>
<p>[cc]intent.getAction().equals( Intent.ACTION_SEND )[/cc]</p>
<p>This is a screenshot of the device when the &#8220;share&#8221; button has been pressed</p>
<p><a href="https://blog.sephiroth.it/wp-content/uploads/2010/09/device.png"><img fetchpriority="high" decoding="async" class="aligncenter size-medium wp-image-1378" title="sharing app screenshot" src="https://blog.sephiroth.it/wp-content/uploads/2010/09/device-180x300.png" alt="" width="180" height="300" srcset="https://blog.sephiroth.it/wp-content/uploads/2010/09/device-180x300.png 180w, https://blog.sephiroth.it/wp-content/uploads/2010/09/device.png 480w" sizes="(max-width: 180px) 100vw, 180px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2010/09/18/android-create-your-own-sharing-app/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
