<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CUMEQXo5fCp7ImA9WhRWEUU.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163</id><updated>2011-12-29T19:30:00.424+01:00</updated><category term="SharedPreferences" /><category term="HelloTabWidget" /><category term="main.xml" /><category term="TabHost" /><category term="Market" /><category term="ADT" /><category term="AndroidManifest" /><category term="appEngine" /><category term="action_send" /><category term="TabHost.Spec" /><category term="ddms" /><category term="version 2" /><category term="BroadcastReceiver" /><category term="strings.xml" /><category term="AirPush" /><category term="publicidad" /><category term="gráfica" /><category term="TabHost.TabSpec" /><category term="Loan" /><category term="email" /><category term="layout" /><category term="Notepad" /><category term="purposes2012" /><category term="Hipoteca" /><category term="HelloWorld" /><category term="Android Fundamentals" /><category term="Preferences" /><category term="ListView" /><category term="linux" /><category term="EuriborRates" /><category term="Android Developer Labs" /><category term="Intent" /><category term="IntentFilter" /><category term="ContentProvider" /><category term="ADV" /><category term="TabWidget" /><category term="TableLayout" /><category term="ListAdapter" /><category term="Nexus One" /><category term="GridView" /><category term="RelativeLayout" /><category term="propositos2012" /><category term="AdMob" /><category term="XML" /><category term="action_chooser" /><category term="chart" /><category term="SDK" /><category term="beta" /><category term="Mobile World Congress" /><category term="truco" /><category term="main.out.xml" /><category term="LinearLayout" /><category term="Euribor" /><category term="HelloListView" /><category term="Donate" /><category term="FrameLayout" /><category term="Eclipse" /><category term="Widget" /><category term="Ubuntu" /><title>Blog de SBC</title><subtitle type="html">Blog personal para aprender a programar en Android desde cero.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://desbc.blogspot.com/" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/BlogDeSbc" /><feedburner:info uri="blogdesbc" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CUMEQXo9fCp7ImA9WhRWEUU.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-950197618836298259</id><published>2011-12-29T19:30:00.002+01:00</published><updated>2011-12-29T19:30:00.464+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-29T19:30:00.464+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="purposes2012" /><category scheme="http://www.blogger.com/atom/ns#" term="Market" /><category scheme="http://www.blogger.com/atom/ns#" term="propositos2012" /><title>Propositos2012 - Purposes2012</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9C3OUPdxeSnp-q15eRZ0hnhqShU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9C3OUPdxeSnp-q15eRZ0hnhqShU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9C3OUPdxeSnp-q15eRZ0hnhqShU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9C3OUPdxeSnp-q15eRZ0hnhqShU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-0My-iYdhuxY/TvyAjr8ywQI/AAAAAAAACE0/tMdqfCS54Vc/s1600/promo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-0My-iYdhuxY/TvyAjr8ywQI/AAAAAAAACE0/tMdqfCS54Vc/s1600/promo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style="background-color: white; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; font-size: 13px; line-height: 19px; text-align: left;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; font-size: 13px; line-height: 19px; text-align: left;"&gt;Escribe y comparte tus propósitos para el año nuevo 2012.&lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; font-size: 13px; line-height: 19px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;"&gt;
Con esta aplicación podrás escribir tus propósitos u objetivos para el nuevo año. Verás tus progresos a medida que los vayas cumpliendo.&lt;br /&gt;Además, podrás compartir tus propósitos en las redes sociales y ver el hashtag #proposito2012 (en la versión española, #purpose2012 en las demás versiones) de todo el mundo.&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; font-size: 13px; line-height: 19px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;"&gt;
Aquí os dejo el enlace del market y algunas capturas.&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;"&gt;
&lt;span style="color: #666666; font-family: 'Droid Sans', Arial, sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;&lt;a href="https://market.android.com/details?id=es.desbc.objectives2012"&gt;https://market.android.com/details?id=es.desbc.objectives2012&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;"&gt;
&lt;span style="color: #666666; font-family: 'Droid Sans', Arial, sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 19px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-bS5YFX820L0/TvyAA5tcyqI/AAAAAAAACEQ/rxrxcB1DOMY/s1600/device-2011-12-29-112924.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-bS5YFX820L0/TvyAA5tcyqI/AAAAAAAACEQ/rxrxcB1DOMY/s320/device-2011-12-29-112924.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-WmuPoNaKNZs/TvyABmOZH9I/AAAAAAAACEY/CHkQB-UAWSc/s1600/device-2011-12-29-112958.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-WmuPoNaKNZs/TvyABmOZH9I/AAAAAAAACEY/CHkQB-UAWSc/s320/device-2011-12-29-112958.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-HXpTR3J9Z2Y/TvyACX7qoGI/AAAAAAAACEc/xcEiRuJMATc/s1600/device-2011-12-29-113016.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-HXpTR3J9Z2Y/TvyACX7qoGI/AAAAAAAACEc/xcEiRuJMATc/s320/device-2011-12-29-113016.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-TRpqpc_r16E/TvyACvk2nAI/AAAAAAAACEo/IzCC4lUkzVw/s1600/device-2011-12-29-113139.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-TRpqpc_r16E/TvyACvk2nAI/AAAAAAAACEo/IzCC4lUkzVw/s320/device-2011-12-29-113139.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; font-size: 13px; line-height: 19px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #666666; font-family: 'Droid Sans', Arial, sans-serif; font-size: 13px; line-height: 19px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left;"&gt;
Espero que os guste!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-950197618836298259?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/mhHTCzkTbMs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/950197618836298259/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2011/12/propositos2012-purposes2012.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/950197618836298259?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/950197618836298259?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/mhHTCzkTbMs/propositos2012-purposes2012.html" title="Propositos2012 - Purposes2012" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-0My-iYdhuxY/TvyAjr8ywQI/AAAAAAAACE0/tMdqfCS54Vc/s72-c/promo.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2011/12/propositos2012-purposes2012.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUFRHw5eip7ImA9WhRRFkg.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-869699266271117524</id><published>2011-11-30T14:03:00.000+01:00</published><updated>2011-11-30T14:03:35.222+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-30T14:03:35.222+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="EuriborRates" /><category scheme="http://www.blogger.com/atom/ns#" term="AirPush" /><category scheme="http://www.blogger.com/atom/ns#" term="Hipoteca" /><category scheme="http://www.blogger.com/atom/ns#" term="AdMob" /><category scheme="http://www.blogger.com/atom/ns#" term="Loan" /><category scheme="http://www.blogger.com/atom/ns#" term="Euribor" /><title>EuriborRates y CalculaHipoteca</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/biZI6KbII65DreS3KSInCJwYxdI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/biZI6KbII65DreS3KSInCJwYxdI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/biZI6KbII65DreS3KSInCJwYxdI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/biZI6KbII65DreS3KSInCJwYxdI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Ahora puedes comprobar la cuota de tu hipoteca desde la aplicación EuriborRates. En el ActionBar en la parte superior verás el siguiente botón:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-2ZWGmlUMy98/TtTcKaMhURI/AAAAAAAABaY/lf-G7x4YiUI/s1600/loan.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-2ZWGmlUMy98/TtTcKaMhURI/AAAAAAAABaY/lf-G7x4YiUI/s1600/loan.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
que al pulsarlo te llevará a la pantalla que te permitirá calcular la cuota de tu hipoteca. Todos los campos son de escritura libre, pero además en el campo 'interés' se puede rellenar automáticamente con la media del mes actual, o con el valor del último mes ya acabado:&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-P_lu87OgS3Y/TtTct47ug3I/AAAAAAAABag/RdO83l_m7U4/s1600/device-2011-11-11-085125.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-P_lu87OgS3Y/TtTct47ug3I/AAAAAAAABag/RdO83l_m7U4/s320/device-2011-11-11-085125.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
Recuerda que la aplicación se puede encontrar en dos versiones, una gratis y con publicidad (ahora con publicidad en forma de banners -&lt;a href="http://www.admob.com/"&gt;admob&lt;/a&gt;- y en mensajes push -&lt;a href="http://www.airpush.com/"&gt;AirPush&lt;/a&gt;-), y otra de pago por solo 0,50 euros sin publicidad.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;a href="https://market.android.com/details?id=es.desbc.donate.euriborrates"&gt;https://market.android.com/details?id=es.desbc.donate.euriborrates&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;a href="https://market.android.com/details?id=es.desbc.euriborrates"&gt;https://market.android.com/details?id=es.desbc.euriborrates&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
Recuerda que toda sugerencia o duda será bienvenida.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-869699266271117524?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/uNtMA-LQsfo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/869699266271117524/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2011/11/euriborrates-y-calculahipoteca.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/869699266271117524?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/869699266271117524?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/uNtMA-LQsfo/euriborrates-y-calculahipoteca.html" title="EuriborRates y CalculaHipoteca" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-2ZWGmlUMy98/TtTcKaMhURI/AAAAAAAABaY/lf-G7x4YiUI/s72-c/loan.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2011/11/euriborrates-y-calculahipoteca.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQDQHw4fSp7ImA9WhdaEkw.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-5944211786347302209</id><published>2011-10-21T17:43:00.001+02:00</published><updated>2011-10-21T17:52:51.235+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-21T17:52:51.235+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="EuriborRates" /><category scheme="http://www.blogger.com/atom/ns#" term="Euribor" /><title>Nueva version EuriborRates para Android</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9sAAWvjR-BUZP_uL1fkVTFWFj-k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9sAAWvjR-BUZP_uL1fkVTFWFj-k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9sAAWvjR-BUZP_uL1fkVTFWFj-k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9sAAWvjR-BUZP_uL1fkVTFWFj-k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Desde hace unos días está publicada la nueva versión de EuriborRates para Android.&lt;br /&gt;
&lt;br /&gt;
Las nuevas características son:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Nueva interfaz de usuario&lt;/li&gt;
&lt;li&gt;Se han añadido más valores y ahora están disponibles los 12 meses y la media del mes actual, en el listado principal.&lt;/li&gt;
&lt;li&gt;Widgets de diferentes tamaños&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
No dudes en probarla, y si te gusta, puedes comprar la versión "donate" por solo 50 céntimos!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Aquí os paso algunas capturas y los enlaces del Market para descargarla.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-eZ-rjTZcnNQ/TqGQ9X-iLbI/AAAAAAAABPM/uHpbQrfldc0/s1600/SC20111013-192705.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-eZ-rjTZcnNQ/TqGQ9X-iLbI/AAAAAAAABPM/uHpbQrfldc0/s320/SC20111013-192705.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/-loZfjvmbrPA/TqGQ9uKQTQI/AAAAAAAABPU/Q9_WO7BTo8c/s1600/SC20111013-192718.png" imageanchor="1" style="clear: right; display: inline !important; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-loZfjvmbrPA/TqGQ9uKQTQI/AAAAAAAABPU/Q9_WO7BTo8c/s320/SC20111013-192718.png" width="192" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; color: black;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-3pPDTnOrqbM/TqGQ-CuFZvI/AAAAAAAABPc/ISuti-5k5q8/s1600/SC20111013-192722.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-3pPDTnOrqbM/TqGQ-CuFZvI/AAAAAAAABPc/ISuti-5k5q8/s320/SC20111013-192722.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;a href="http://4.bp.blogspot.com/-IqFgHuM-rzs/TqGQ-qHuO7I/AAAAAAAABPk/ewdR-YhCIcA/s1600/SC20111013-192759.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-IqFgHuM-rzs/TqGQ-qHuO7I/AAAAAAAABPk/ewdR-YhCIcA/s320/SC20111013-192759.png" width="192" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-4pZV1NmouAE/TqGQ_BCA25I/AAAAAAAABPs/_cCFCFV4V4g/s1600/SC20111013-192849.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-4pZV1NmouAE/TqGQ_BCA25I/AAAAAAAABPs/_cCFCFV4V4g/s320/SC20111013-192849.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/-H-GhCMDS0Hc/TqGQ_h560vI/AAAAAAAABP0/boV6MOWXg4I/s1600/SC20111013-213319.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-H-GhCMDS0Hc/TqGQ_h560vI/AAAAAAAABP0/boV6MOWXg4I/s320/SC20111013-213319.png" width="192" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-bFzTqHo8Dqw/TqGRAzqRFzI/AAAAAAAABP8/TvyAK3_nlhg/s1600/SC20111013-214245.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-bFzTqHo8Dqw/TqGRAzqRFzI/AAAAAAAABP8/TvyAK3_nlhg/s320/SC20111013-214245.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;a href="http://2.bp.blogspot.com/-4XrW0bw0oNY/TqGRBaGAZ7I/AAAAAAAABQE/aRO437shLk4/s1600/SC20111013-215044.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-4XrW0bw0oNY/TqGRBaGAZ7I/AAAAAAAABQE/aRO437shLk4/s320/SC20111013-215044.png" width="192" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Versión normal:&amp;nbsp;&lt;a href="https://market.android.com/details?id=es.desbc.euriborrates"&gt;https://market.android.com/details?id=es.desbc.euriborrates&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
Donate Version:&amp;nbsp;&lt;a href="https://market.android.com/details?id=es.desbc.donate.euriborrates"&gt;https://market.android.com/details?id=es.desbc.donate.euriborrates&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hasta los próximos cambios!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-5944211786347302209?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/Tv5GSj9kO5k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/5944211786347302209/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2011/10/nueva-version-euriborrates-para-android.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/5944211786347302209?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/5944211786347302209?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/Tv5GSj9kO5k/nueva-version-euriborrates-para-android.html" title="Nueva version EuriborRates para Android" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-eZ-rjTZcnNQ/TqGQ9X-iLbI/AAAAAAAABPM/uHpbQrfldc0/s72-c/SC20111013-192705.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2011/10/nueva-version-euriborrates-para-android.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4FSHszeCp7ImA9WhZSFEo.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-8621072319254799887</id><published>2011-03-30T11:21:00.001+02:00</published><updated>2011-03-30T11:21:59.580+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-30T11:21:59.580+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="EuriborRates" /><category scheme="http://www.blogger.com/atom/ns#" term="gráfica" /><category scheme="http://www.blogger.com/atom/ns#" term="beta" /><category scheme="http://www.blogger.com/atom/ns#" term="appEngine" /><category scheme="http://www.blogger.com/atom/ns#" term="chart" /><category scheme="http://www.blogger.com/atom/ns#" term="version 2" /><category scheme="http://www.blogger.com/atom/ns#" term="Euribor" /><title>Euribor Rates 2 Beta</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4WfjipfnnD7Z6HrPE2me2yh2f_g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4WfjipfnnD7Z6HrPE2me2yh2f_g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4WfjipfnnD7Z6HrPE2me2yh2f_g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4WfjipfnnD7Z6HrPE2me2yh2f_g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Desde hace unas semanas está disponible en el market la versión 2 Beta de EuriborRates. En esta nueva versión se incluyen las siguientes características y mejoras:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://ssl.gstatic.com/android/market/es.desbc.euriborrates/ss-0-320-480-160-1-346ebf10f2d0543b60811fac0d0c48014cdd5122" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="https://ssl.gstatic.com/android/market/es.desbc.euriborrates/ss-0-320-480-160-1-346ebf10f2d0543b60811fac0d0c48014cdd5122" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Nueva interfaz&lt;/li&gt;
&lt;li&gt;Más valores. Ahora se pueden ver los valores de 12, 9, 6 y 3 meses, así como la media mensual&lt;/li&gt;
&lt;li&gt;Se puede configurar el widget para mostrar los valores deseados e identificarlos con una cadena de dos carácteres&lt;/li&gt;
&lt;li&gt;Se puede visualizar una gráfica por tipo de valor de hasta 50 valores&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://ssl.gstatic.com/android/market/es.desbc.euriborrates/ss-1-320-480-160-1-0f7ee181ddb2fe46a373c87f1382875490994d3c" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="213" src="https://ssl.gstatic.com/android/market/es.desbc.euriborrates/ss-1-320-480-160-1-0f7ee181ddb2fe46a373c87f1382875490994d3c" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Para suministrar los datos también se ha migrado a AppEngine.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Estoy pendiente de publicar una nueva versión mejorando el tiempo de carga de la primera ejecución. Para las siguientes versiones tengo pensado las siguientes mejoras:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Añadir más valores&lt;/li&gt;
&lt;li&gt;Mejorar la gráfica&lt;/li&gt;
&lt;li&gt;Incluir enlace a donaciones&lt;/li&gt;
&lt;li&gt;Mejorar la parte del servidor&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Os dejo los enlaces y QR del market de las dos versiones (Free y Donate).&lt;/div&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;Free:&amp;nbsp;&lt;a href="https://market.android.com/details?id=es.desbc.euriborrates&amp;amp;feature=search_result"&gt;https://market.android.com/details?id=es.desbc.euriborrates&amp;amp;feature=search_result&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Donate:&amp;nbsp;&lt;a href="https://market.android.com/details?id=es.desbc.donate.euriborrates&amp;amp;feature=search_result"&gt;https://market.android.com/details?id=es.desbc.donate.euriborrates&amp;amp;feature=search_result&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-lmszqGwLfbU/TGGJhjmHqvI/AAAAAAAAAWQ/sDbKWERGYGM/s1600/qrcode_donate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-lmszqGwLfbU/TGGJhjmHqvI/AAAAAAAAAWQ/sDbKWERGYGM/s200/qrcode_donate.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-lpdqb--1e2A/TGGCwJDAx5I/AAAAAAAAAWA/mFOU6SOqv_4/s1600/qrcode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-lpdqb--1e2A/TGGCwJDAx5I/AAAAAAAAAWA/mFOU6SOqv_4/s200/qrcode.png" width="200" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Y ya sabéis, SE ACEPTAN SUGERENCIAS.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-8621072319254799887?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/S6proDIE41k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/8621072319254799887/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2011/03/euribor-rates-2-beta.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/8621072319254799887?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/8621072319254799887?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/S6proDIE41k/euribor-rates-2-beta.html" title="Euribor Rates 2 Beta" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-lmszqGwLfbU/TGGJhjmHqvI/AAAAAAAAAWQ/sDbKWERGYGM/s72-c/qrcode_donate.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2011/03/euribor-rates-2-beta.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4MR34-fSp7ImA9Wx5SFEs.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-7046991296822474739</id><published>2010-08-10T19:19:00.001+02:00</published><updated>2010-08-10T19:23:06.055+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-10T19:23:06.055+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="EuriborRates" /><category scheme="http://www.blogger.com/atom/ns#" term="Donate" /><category scheme="http://www.blogger.com/atom/ns#" term="Euribor" /><title>EuriborRates - Más cambios y Donate Version</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8KWp7jYWskes4CbHEiJiTIsKTCs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8KWp7jYWskes4CbHEiJiTIsKTCs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8KWp7jYWskes4CbHEiJiTIsKTCs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8KWp7jYWskes4CbHEiJiTIsKTCs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;He publicado otra versión de EuriborRates con la siguiente mejora:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Búsqueda de valores publicados desde el año 2000. Funciona seleccionando el mes y el año que queremos buscar. El resultado se muestra en un dialogo de alerta.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/TGGDExHmA6I/AAAAAAAAAWI/SKtSCHXrmEE/s1600/captura_menu_free.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/_C574F3Iy4U0/TGGDExHmA6I/AAAAAAAAAWI/SKtSCHXrmEE/s320/captura_menu_free.png" width="192" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/TGGKtTNjZ2I/AAAAAAAAAWY/d9NIcPiGFVY/s1600/captura_historico.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_C574F3Iy4U0/TGGKtTNjZ2I/AAAAAAAAAWY/d9NIcPiGFVY/s320/captura_historico.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
Código QR:&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/TGGDExHmA6I/AAAAAAAAAWI/SKtSCHXrmEE/s1600/captura_menu_free.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/TGGCwJDAx5I/AAAAAAAAAWA/yNlmx3r9oRc/s1600/qrcode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/_C574F3Iy4U0/TGGCwJDAx5I/AAAAAAAAAWA/yNlmx3r9oRc/s200/qrcode.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Además he publicado una versión de donación por 0,50€. Es igual que la aplicación gratis pero sin publicidad. Se puede buscar directamente en el market o desde el menú de la aplicación gratis. Este es el QR:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/TGGJhjmHqvI/AAAAAAAAAWQ/PAxQGYSkrQQ/s1600/qrcode_donate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/_C574F3Iy4U0/TGGJhjmHqvI/AAAAAAAAAWQ/PAxQGYSkrQQ/s200/qrcode_donate.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-7046991296822474739?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/QYkR-HGm9UU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/7046991296822474739/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/08/euriborrates-mas-cambios-y-donate.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7046991296822474739?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7046991296822474739?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/QYkR-HGm9UU/euriborrates-mas-cambios-y-donate.html" title="EuriborRates - Más cambios y Donate Version" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_C574F3Iy4U0/TGGDExHmA6I/AAAAAAAAAWI/SKtSCHXrmEE/s72-c/captura_menu_free.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/08/euriborrates-mas-cambios-y-donate.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEGQH45fip7ImA9Wx5SEkQ.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-4335073963706454745</id><published>2010-08-08T20:53:00.000+02:00</published><updated>2010-08-08T20:53:41.026+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-08T20:53:41.026+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="EuriborRates" /><category scheme="http://www.blogger.com/atom/ns#" term="AdMob" /><title>Cambios en EuriborRates</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1a5AtJcova6dpsXofeN9Ko8zSpg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1a5AtJcova6dpsXofeN9Ko8zSpg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1a5AtJcova6dpsXofeN9Ko8zSpg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1a5AtJcova6dpsXofeN9Ko8zSpg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;En la versión 1.2 se ha cambiado lo siguiente:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Se puede acceder desde el menú de aplicaciones por si no quieres utilizar el widget&lt;/li&gt;
&lt;li&gt;Se ha añadido el valor de media mensual del mes actual&lt;/li&gt;
&lt;li&gt;Se ha añadido un menú. Cuando pulsamos en la tecla de menú podemos ver 3 opciones:&lt;/li&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Blog: para visitar este blog&lt;/li&gt;
&lt;li&gt;Info: podemos ver la información que se muestra la primera vez que instalamos la aplicación&lt;/li&gt;
&lt;li&gt;Exit: para salir de la configuración del widget.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;li&gt;Multidioma para inglés y español, dependiendo del idioma del teléfono. Si el idioma no es ninguno de los dos anteriores, el idioma por defecto es el inglés.&lt;/li&gt;
&lt;li&gt;Botón de sugerencias&lt;/li&gt;
&lt;li&gt;Pequeños cambios en la interfaz gráfica&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/TF778Ly3TxI/AAAAAAAAAVo/tQupGBV9ZMQ/s1600/market_home.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/_C574F3Iy4U0/TF778Ly3TxI/AAAAAAAAAVo/tQupGBV9ZMQ/s320/market_home.png" width="180" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/TF78AyGGK0I/AAAAAAAAAVw/Hj97VUJ2spg/s1600/market_loading.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/_C574F3Iy4U0/TF78AyGGK0I/AAAAAAAAAVw/Hj97VUJ2spg/s320/market_loading.png" width="180" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/TF78F41EApI/AAAAAAAAAV4/90TdmVZKNGM/s1600/qrcode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/_C574F3Iy4U0/TF78F41EApI/AAAAAAAAAV4/90TdmVZKNGM/s200/qrcode.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;/ul&gt;
¿Alguna pregunta o sugerencia?&lt;br /&gt;
&lt;br /&gt;
PD: Parece que la publicidad de AdMob no se muestra siempre, alguien me lo puede confirmar? Gracias&lt;br /&gt;
&lt;ul&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-4335073963706454745?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/VtVbtSp8Lyc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/4335073963706454745/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/08/cambios-en-euriborrates.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/4335073963706454745?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/4335073963706454745?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/VtVbtSp8Lyc/cambios-en-euriborrates.html" title="Cambios en EuriborRates" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C574F3Iy4U0/TF778Ly3TxI/AAAAAAAAAVo/tQupGBV9ZMQ/s72-c/market_home.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/08/cambios-en-euriborrates.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIHRHY4fSp7ImA9WxFXGUQ.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-8679773707193933319</id><published>2010-05-28T00:06:00.001+02:00</published><updated>2010-05-28T00:15:35.835+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-28T00:15:35.835+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="EuriborRates" /><category scheme="http://www.blogger.com/atom/ns#" term="publicidad" /><category scheme="http://www.blogger.com/atom/ns#" term="Market" /><category scheme="http://www.blogger.com/atom/ns#" term="AdMob" /><category scheme="http://www.blogger.com/atom/ns#" term="Euribor" /><title>Añadido AdMob a EuriborRates</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uWn7kip3pU1tae6wpriF-BZW3Yc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uWn7kip3pU1tae6wpriF-BZW3Yc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uWn7kip3pU1tae6wpriF-BZW3Yc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uWn7kip3pU1tae6wpriF-BZW3Yc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;A partir de hora, en la pantalla de configuración del widget, aparecerá publicidad en la parte inferior:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/S_7qoTFfkPI/AAAAAAAAAJo/W3KxynL9kA0/s1600/admob.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S_7qoTFfkPI/AAAAAAAAAJo/W3KxynL9kA0/s320/admob.png" /&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_C574F3Iy4U0/S_7rJtD0RcI/AAAAAAAAAJw/_AsFrGUAvj4/s1600/qrcode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/_C574F3Iy4U0/S_7rJtD0RcI/AAAAAAAAAJw/_AsFrGUAvj4/s200/qrcode.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
La publicidad es de &lt;a href="http://es.admob.com/"&gt;Admob&lt;/a&gt;. Es bastante sencillo agregar la publicidad, los pasos explicados a groso modo son:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Tenemos que tener la aplicación ya publicada en el market para obtener un código (&lt;i&gt;publisher id&lt;/i&gt;) cuando nos registremos en&amp;nbsp;&lt;a href="http://es.admob.com/"&gt;Admob&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Descargarnos la librería&amp;nbsp;&lt;a href="http://es.admob.com/"&gt;Admob&lt;/a&gt;&amp;nbsp;y agregarla a nuestro proyecto&lt;/li&gt;
&lt;li&gt;Modificar el Manifest utilizando el &lt;i&gt;publisher id&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Añadir permisos de conexión a internet si nos tenemos, y opcionalmente de localización&lt;/li&gt;
&lt;li&gt;Declarar el estilo de la publicidad (viene dado en el manual) en &lt;i&gt;res/values/attrs.xml&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Probar!&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Una vez nos registremos e indiquemos cual es nuestra aplicación, podremos acceder a un manual en pdf dónde se explican detalladamente los pasos a seguir.&lt;br /&gt;
&lt;br /&gt;
Ahora, a esperar que la gente pulse en la publicidad ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-8679773707193933319?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/TfDu7gCKuVk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/8679773707193933319/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/05/anadido-admob-euriborrates.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/8679773707193933319?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/8679773707193933319?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/TfDu7gCKuVk/anadido-admob-euriborrates.html" title="Añadido AdMob a EuriborRates" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_C574F3Iy4U0/S_7qoTFfkPI/AAAAAAAAAJo/W3KxynL9kA0/s72-c/admob.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/05/anadido-admob-euriborrates.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMNRno9cCp7ImA9WxFXGUQ.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-1988248894960181283</id><published>2010-05-24T23:58:00.000+02:00</published><updated>2010-05-28T00:14:57.468+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-28T00:14:57.468+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="EuriborRates" /><category scheme="http://www.blogger.com/atom/ns#" term="Market" /><category scheme="http://www.blogger.com/atom/ns#" term="Widget" /><category scheme="http://www.blogger.com/atom/ns#" term="Euribor" /><title>EuriborRates - Primer widget en el Market</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eAu8QOYqOX0ZDEIbnRyRF2bm3_4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eAu8QOYqOX0ZDEIbnRyRF2bm3_4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eAu8QOYqOX0ZDEIbnRyRF2bm3_4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eAu8QOYqOX0ZDEIbnRyRF2bm3_4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Por fin he publicado en el Market!&lt;br /&gt;
&lt;br /&gt;
Es un widget en el que se puede ver el valor diario del Euribor.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/S_rxTqIdHmI/AAAAAAAAAJY/zx6ZtKbxbmk/s1600/euribor2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_C574F3Iy4U0/S_rxTqIdHmI/AAAAAAAAAJY/zx6ZtKbxbmk/s320/euribor2.png" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/S_rxRmU752I/AAAAAAAAAJQ/i3X4m1n9KNw/s1600/euribor1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_C574F3Iy4U0/S_rxRmU752I/AAAAAAAAAJQ/i3X4m1n9KNw/s320/euribor1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Para todos aquellos que tenemos hipoteca y depende del Euribor, ya podemos ver su valor diario.&lt;br /&gt;
&lt;br /&gt;
Para descargarla:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/_C574F3Iy4U0/S_r2NhdQXsI/AAAAAAAAAJg/qlEU_Jkacb0/s1600/qrcode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_C574F3Iy4U0/S_r2NhdQXsI/AAAAAAAAAJg/qlEU_Jkacb0/s320/qrcode.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
Espero que os guste. Y no dudéis en dejar comentarios y sugerencias.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
GRACIAS&lt;/div&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-1988248894960181283?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/HF0se3J2nKg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/1988248894960181283/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/05/euriborrates-primer-widget-en-el-market.html#comment-form" title="2 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1988248894960181283?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1988248894960181283?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/HF0se3J2nKg/euriborrates-primer-widget-en-el-market.html" title="EuriborRates - Primer widget en el Market" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C574F3Iy4U0/S_rxTqIdHmI/AAAAAAAAAJY/zx6ZtKbxbmk/s72-c/euribor2.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/05/euriborrates-primer-widget-en-el-market.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IDSHs6eSp7ImA9WxFXF0U.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-1607710724479339785</id><published>2010-04-22T18:40:00.097+02:00</published><updated>2010-05-25T11:59:39.511+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-25T11:59:39.511+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="Notepad" /><title>Notepad Tutorial - Ejercicio 2</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xP8_t2Fs8r4fCZ0blDzbCyh5CrI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xP8_t2Fs8r4fCZ0blDzbCyh5CrI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xP8_t2Fs8r4fCZ0blDzbCyh5CrI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xP8_t2Fs8r4fCZ0blDzbCyh5CrI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;Ejercicio 2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;En este ejercicio añadiremos una segunda &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;para crear, editar y eliminar notas.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/S9C5TUfQo-I/AAAAAAAAAIk/iyMtrSRxSjQ/s1600/notepad2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_C574F3Iy4U0/S9C5TUfQo-I/AAAAAAAAAIk/iyMtrSRxSjQ/s320/notepad2.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;
Paso 1&lt;/i&gt;&lt;br /&gt;

&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Abrimos el proyecto &lt;i&gt;Notepadv2&lt;/i&gt; en &lt;i&gt;Eclipse&lt;/i&gt;. El punto de inicio de este proyecto es la solución del &lt;a href="http://desbc.blogspot.com/2010/03/notepad-tutorial-ejercicio-1.html"&gt;ejercicio 1&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman';"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;File &amp;gt; New &amp;gt; Android Project&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Seleccionamos &lt;i&gt;Create project from existing source&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Seleccionamos el directorio &lt;i&gt;Notepadv2&lt;/i&gt; que nos hemos descargado antes&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;La mayoría de propiedades del proyecto se rellenan automáticamente. Seleccionamos el &lt;i&gt;Target&lt;/i&gt;, en &lt;i&gt;Android Labs&lt;/i&gt; nos recomiendan seleccionar la versión del sdk menor para que sea compatible con la mayor cantidad de dispositivos.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Pulsamos en &lt;i&gt;Finish&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;
&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Como veis son los mismo pasos que para el &lt;a href="http://desbc.blogspot.com/2010/03/notepad-tutorial-ejercicio-1.html"&gt;ejercicio 1&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;
Paso 2&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;En primer lugar, vamos a crear el menú contextual que permitirá a los usuarios borrar las notas una a una. Miramos la clase &lt;i&gt;Notepadv2&lt;/i&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
Para que cada elemento de la lista en el ListView sea accesible desde el menú de contexto, llamamos al método &lt;a href="http://developer.android.com/reference/android/app/Dialog.html#registerForContextMenu(android.view.View)"&gt;registerForContextMenu()&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;pasándole el &lt;a href="http://developer.android.com/reference/android/widget/ListView.html"&gt;ListView&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;registerForContextMenu (getListView ());&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;
Como nuestra&amp;nbsp;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;hereda de la clase &lt;a href="http://developer.android.com/reference/android/app/ListActivity.html"&gt;ListActivity&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;, &lt;i&gt;&lt;a href="http://developer.android.com/reference/android/app/ListActivity.html#getListView()"&gt;getListView()&lt;/a&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;nos devuelve el objeto local &lt;a href="http://developer.android.com/reference/android/widget/ListView.html"&gt;ListView&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;. Ahora, cada elemento del &lt;a href="http://developer.android.com/reference/android/widget/ListView.html"&gt;ListView&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;activa el menú contextual.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;
Ahora completamos el método &lt;a href="http://developer.android.com/reference/android/view/View.OnCreateContextMenuListener.html#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo)"&gt;onCreateContextMenu()&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;, que será similar al menú de opciones. Añadiremos una línea para poder eliminar una nota desde el menú:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;public boolean onCreateContextMenu(Menu menu, View v&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ContextMenuInfo menuInfo) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;super.onCreateContextMenu(menu, v, menuInfo);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;menu.add(0, DELETE_ID, 0, R.string.menu_delete);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;



&lt;br /&gt;&lt;i&gt;
Paso 3&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
Ahora tenemos que controlar lo que hacemos cuando seleccionamos la opción del menú contextual. El método que tenemos que implementar es:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public boolean onContextItemSelected(MenuItem item) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;switch(item.getItemId()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case DELETE_ID:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mDbHelper.deleteNote(info.id);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fillData();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return super.onContextItemSelected(item);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
Para saber que ítem tenemos que eliminar lo hacemos con un objeto de tipo &lt;a href="http://developer.android.com/reference/android/widget/AdapterView.AdapterContextMenuInfo.html#AdapterView.AdapterContextMenuInfo(android.view.View, int, long)"&gt;AdapterContextMenuInfo&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;, que obtenemos con el método &lt;a href="http://developer.android.com/reference/android/view/MenuItem.html#getMenuInfo()"&gt;getMenuInfo()&lt;/a&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;


&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;br /&gt;&lt;i&gt;
Paso 4&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
Todavía en la clase &lt;i&gt;Notepadv2&lt;/i&gt; creamos el siguiente método:&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;i&gt;&amp;nbsp;private void createNote() {&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Intent i = new Intent(this, NoteEdit.class);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; startActivityForResult(i, ACTIVITY_CREATE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;
El método &lt;a href="http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)"&gt;startActivityForResult()&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;lanza el Intent devolvuendo un valor, en este caso un &lt;i&gt;int&lt;/i&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;



&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;
Paso 5&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
Rellenamos el método:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;@Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;protected void onListItemClick(ListView l, View v, int position, long id) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onListItemClick(l, v, position, id);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Cursor c = mNotesCursor;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.moveToPosition(position);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intent i = new Intent(this, NoteEdit.class);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.putExtra(NotesDbAdapter.KEY_ROWID, id);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.putExtra(NotesDbAdapter.KEY_TITLE, c.getString(&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.putExtra(NotesDbAdapter.KEY_BODY, c.getString(&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;startActivityForResult(i, ACTIVITY_EDIT);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
Este método se invoca cada vez que seleccionamos un elemento de la lista. Con &lt;a href="http://developer.android.com/reference/android/content/Intent.html#putExtra(java.lang.String, android.os.Bundle)"&gt;Intent.putExtra()&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;añadimos la información de la nota, para así poderla editar más tarde.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;
Paso 6&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
Los métodos anteriores &lt;i&gt;createNote()&lt;/i&gt; y o&lt;i&gt;nListItemClick() &lt;/i&gt;se llaman de manera asíncrona. Para controlar el retorno de la llamada lo haremos sobreescribiendo el método &lt;a href="http://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)"&gt;onActivityResult()&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;. Esto lo podemos hacer ya que hemos lanzado el Intent con &lt;a href="http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)"&gt;startActivityForResult()&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;i&gt;@Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected void onActivityResult(int requestCode, int resultCode, Intent intent) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onActivityResult(requestCode, resultCode, intent);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Bundle extras = intent.getExtras();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch(requestCode) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case ACTIVITY_CREATE:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String title = extras.getString(NotesDbAdapter.KEY_TITLE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String body = extras.getString(NotesDbAdapter.KEY_BODY);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mDbHelper.createNote(title, body);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fillData();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case ACTIVITY_EDIT:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Long rowId = extras.getLong(NotesDbAdapter.KEY_ROWID);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (rowId != null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String editTitle = extras.getString(NotesDbAdapter.KEY_TITLE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String editBody = extras.getString(NotesDbAdapter.KEY_BODY);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mDbHelper.updateNote(rowId, editTitle, editBody);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fillData();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;
Diferenciamos entre la modificación o creación de una nota. En la creación recogemos del &lt;a href="http://developer.android.com/reference/android/os/Bundle.html"&gt;Bundle&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;el &lt;i&gt;title&lt;/i&gt; y el &lt;i&gt;body&lt;/i&gt;, y llamamos a &lt;i&gt;mDbHelper.createNote()&lt;/i&gt;. En la modificación primero tenemos que conseguir el Id de la fila, después también conseguimos el &lt;i&gt;title&lt;/i&gt; y el &lt;i&gt;body&lt;/i&gt; del&amp;nbsp;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/os/Bundle.html"&gt;Bundle&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;y llamamos a &lt;i&gt;mDbHelper.updateNote()&lt;/i&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;


&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;br /&gt;&lt;i&gt;
Paso 7&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
En este paso simplemente echamos un vistazo al fichero &lt;i&gt;note_edit.xml&lt;/i&gt;. Es el &lt;i&gt;layout&lt;/i&gt; más complejo del ejercicio pero únicamente vemos que de nuevo sólo está &lt;i&gt;layout_weight=1&lt;/i&gt;. Este parámetro nos indica la "importancia" o peso del elemento en la vista. Por defecto el valor es 0.&lt;br /&gt;
Este es el &lt;i&gt;layout&lt;/i&gt; de la pantalla de edición de una nota.&lt;/span&gt;

&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;br /&gt;&lt;i&gt;
Paso 8&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
Para poder la pantalla de edición de las notas, creamos un clase que llamamos &lt;i&gt;NoteEdit&lt;/i&gt; que herede de&amp;nbsp;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;y sobreescribimos el método &lt;a href="http://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)"&gt;onCreate(Bundle)&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;i&gt;@Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setContentView(R.layout.note_edit);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mTitleText = (EditText) findViewById(R.id.title);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mBodyText = (EditText) findViewById(R.id.body);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Button confirmButton = (Button) findViewById(R.id.confirm);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mRowId = null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bundle extras = getIntent().getExtras();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (extras != null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String title = extras.getString(NotesDbAdapter.KEY_TITLE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String body = extras.getString(NotesDbAdapter.KEY_BODY);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mRowId = extras.getLong(NotesDbAdapter.KEY_ROWID);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (title != null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mTitleText.setText(title);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (body != null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mBodyText.setText(body);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;confirmButton.setOnClickListener(new View.OnClickListener() {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onClick(View view) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// TODO&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;/span&gt;




&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;br /&gt;&lt;i&gt;
Paso 9&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
Ahora completamos el método &lt;i&gt;onClick()&lt;/i&gt; que nos faltaba por rellenar:&lt;br /&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;public void onClick(View view) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bundle bundle = new Bundle();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bundle.putString(NotesDbAdapter.KEY_TITLE, mTitleText.getText().toString());&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bundle.putString(NotesDbAdapter.KEY_BODY, mBodyText.getText().toString());&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (mRowId != null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bundle.putLong(NotesDbAdapter.KEY_ROWID, mRowId);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intent mIntent = new Intent();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mIntent.putExtras(bundle);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setResult(RESULT_OK, mIntent);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;finish();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;/span&gt;


&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;
Paso 10&lt;/i&gt;&lt;br /&gt;

&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;
El último paso es añadir nuestra&amp;nbsp;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;al &lt;i&gt;AndroidManifest.xml&lt;/i&gt; para que la&amp;nbsp;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;sea visible para &lt;i&gt;Android&lt;/i&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;ol&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Doble click en el fichero &lt;i&gt;AndroidManifest.xml&lt;/i&gt; para abrirlo.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Click en la pestaña &lt;i&gt;Application&lt;/i&gt; del editor de &lt;i&gt;Manifest&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;En la sección &lt;i&gt;Application Nodes&lt;/i&gt; pulsamos en &lt;i&gt;Add&lt;/i&gt;...&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Nos aseguramos que tenemos seleccionado&amp;nbsp;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;y click en OK.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;De nuevo en la sección &lt;i&gt;Application Nodes&lt;/i&gt; pulsamos en la nueva&amp;nbsp;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;, y a la derecha escribimos &lt;i&gt;.NoteEdit &lt;/i&gt;en el campo &lt;i&gt;Name*&lt;/i&gt;. Pulsamos Intro.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/S9C5ac9JxtI/AAAAAAAAAIs/feRumR8x8WE/s1600/manifest-notepad2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="329" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S9C5ac9JxtI/AAAAAAAAAIs/feRumR8x8WE/s640/manifest-notepad2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;
También podemos añadirlo manualmente en el fichero &lt;i&gt;AndroidManifest.xml&lt;/i&gt; de la siguiente manera:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;activity android:name=".NoteEdit"&amp;gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt;/activity&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;
Y a correr!&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;div&gt;
&lt;div&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;div&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;div&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;div&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;div style="display: inline !important;"&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;div style="display: inline !important;"&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;div style="display: inline !important;"&gt;
&lt;/div&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-1607710724479339785?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/FDYMrHkAXb8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/1607710724479339785/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/04/notepad-tutorial-ejercicio-2.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1607710724479339785?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1607710724479339785?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/FDYMrHkAXb8/notepad-tutorial-ejercicio-2.html" title="Notepad Tutorial - Ejercicio 2" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C574F3Iy4U0/S9C5TUfQo-I/AAAAAAAAAIk/iyMtrSRxSjQ/s72-c/notepad2.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/04/notepad-tutorial-ejercicio-2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEDR3c6cCp7ImA9WxBaE0o.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-6371852600145817101</id><published>2010-03-23T21:33:00.001+01:00</published><updated>2010-03-23T21:37:56.918+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T21:37:56.918+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="LinearLayout" /><category scheme="http://www.blogger.com/atom/ns#" term="Notepad" /><title>Notepad Tutorial - Ejercicio 1</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eWzia8j5Zn0lFH5_Uxu-Jtg567U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eWzia8j5Zn0lFH5_Uxu-Jtg567U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eWzia8j5Zn0lFH5_Uxu-Jtg567U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eWzia8j5Zn0lFH5_Uxu-Jtg567U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;En &lt;i&gt;Android Labs&lt;/i&gt;&amp;nbsp;nos proponen un tutorial bastante completo, &lt;a href="http://developer.android.com/resources/tutorials/notepad/index.html"&gt;Notepad Tutorial&lt;/a&gt;, un gestor de notas.&lt;br /&gt;
&lt;br /&gt;
El tutorial se sigue en forma de ejercicios, 3 más uno extra. De cada ejercicio tenemos un código base y su solución por si tenemos algún problema.&lt;br /&gt;
&lt;br /&gt;
Nos &lt;a href="http://developer.android.com/intl/de/resources/tutorials/notepad/codelab/NotepadCodeLab.zip"&gt;descargamos&lt;/a&gt;&amp;nbsp;el código base y las soluciones, y nos &lt;a href="http://developer.android.com/intl/de/resources/tutorials/notepad/index.html#preparing"&gt;preparamos&lt;/a&gt;&amp;nbsp;el entorno para empezar con el &lt;a href="http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html"&gt;ejercicio 1&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ejercicio 1&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
En este &lt;a href="http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html"&gt;ejercicio 1&lt;/a&gt; construiremos una lista de notas a la que podremos añadir nuevas notas, pero no editaralas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 1&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Abrimos el proyecto &lt;i&gt;Notepadv1 &lt;/i&gt;en Eclipse. Este proyecto es el punto de inicio para el ejercicio 1.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;i&gt;File &lt;/i&gt;&amp;gt; &lt;i&gt;New &lt;/i&gt;&amp;gt; &lt;i&gt;Android Project&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Seleccionamos &lt;i&gt;Create project from existing source&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Seleccionamos el directorio &lt;i&gt;Notepadv1 &lt;/i&gt;que nos hemos descargado antes&lt;/li&gt;
&lt;li&gt;La mayoría de propiedades del proyecto se rellenan automáticamente. Seleccionamos el &lt;i&gt;Target&lt;/i&gt;, en &lt;i&gt;Android Labs&lt;/i&gt;&amp;nbsp;nos recomiendan seleccionar la versión del sdk menor para que sea compatible con la mayor cantidad de dispositivos.&lt;/li&gt;
&lt;li&gt;Pulsamos en &lt;i&gt;Finish&lt;/i&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Yo no he tenido problemas, pero si en vuestro caso tenéis algún problema con el &lt;i&gt;AndroidManifest.xml&lt;/i&gt;, con el botón derecho en el proyecto seleccionamos &lt;i&gt;Android Tools&lt;/i&gt; &amp;gt; &lt;i&gt;Fix Project Properties&lt;/i&gt;, para que dejen de salirnos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 2&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Echamos un vistazo a la clase &lt;i&gt;NotesDbAdapter&lt;/i&gt;, que nos servira para acceder a la base de datos &lt;a href="http://developer.android.com/intl/de/reference/android/database/sqlite/package-summary.html"&gt;SQLite&lt;/a&gt;&amp;nbsp;que utilizaremos para guardar las notas.&lt;br /&gt;
&lt;br /&gt;
Al principio de la clase tenemos unas cuantas constantes declaradas:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;i&gt;&amp;nbsp;private static final String DATABASE_CREATE =&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"create table notes (_id integer primary key autoincrement, "&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ "title text not null, body text not null);";&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Esta es la consulta que crea la tabla de notas, que contiene 3 campos, &lt;i&gt;_id&lt;/i&gt;, &lt;i&gt;title&lt;/i&gt; y &lt;i&gt;body&lt;/i&gt;, de los que también tenemos sus constantes:&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&amp;nbsp;  &lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;i&gt;public static final String KEY_TITLE = "title";&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public static final String KEY_BODY = "body";&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public static final String KEY_ROWID = "_id";&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
También tenemos una constante que identifica la clase a la hora de escribir en log:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&amp;nbsp;   &lt;/span&gt;&lt;i&gt;private static final String TAG = "NotesDbAdapter";&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
El constructor de la clase &lt;i&gt;NotesDbAdapter &lt;/i&gt;toma como parámetro un objeto de clase &lt;a href="http://developer.android.com/intl/de/reference/android/content/Context.html"&gt;Context&lt;/a&gt;. Esto es para poder acceder a propiedades y métodos del sistema (&lt;i&gt;Android&lt;/i&gt;).&lt;br /&gt;
&lt;br /&gt;
En el método &lt;i&gt;open()&lt;/i&gt;&amp;nbsp;creamos un instancia de la clase &lt;i&gt;DatabaseHelper&lt;/i&gt;, que es un clase local que implementa &lt;a href="http://developer.android.com/intl/de/reference/android/database/sqlite/SQLiteOpenHelper.html"&gt;SQLiteOpenHelper&lt;/a&gt;. Con el método &lt;a href="http://developer.android.com/intl/de/reference/android/database/sqlite/SQLiteOpenHelper.html#getWritableDatabase()"&gt;getWritableDatabase()&lt;/a&gt;&amp;nbsp;obtenemos la base de datos.&lt;br /&gt;
&lt;br /&gt;
Con el método &lt;i&gt;close()&lt;/i&gt;&amp;nbsp;simplemente cerramos la conexión con la base de datos.&lt;br /&gt;
&lt;br /&gt;
Al método &lt;i&gt;createNote()&lt;/i&gt;&amp;nbsp;le pasamos un &lt;i&gt;String title&lt;/i&gt;&amp;nbsp;y otro &lt;i&gt;body&lt;/i&gt;&amp;nbsp;para crear una nueva nota en la base de datos. Si se crea bien, devolveremos un &lt;i&gt;long&lt;/i&gt;&amp;nbsp;que sera el &lt;i&gt;_id&lt;/i&gt;&amp;nbsp;del nuevo registro creado en la tabla.&lt;br /&gt;
&lt;br /&gt;
Con &lt;i&gt;deleteNote()&lt;/i&gt;&amp;nbsp;podemos eliminar un registro de la tabla pasándole el &lt;i&gt;_id&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
Para obtener todos los registros de la tabla usaremos &lt;i&gt;fetchAllNotes()&lt;/i&gt;. Este método nos retorna un &lt;a href="http://developer.android.com/intl/de/reference/android/database/Cursor.html"&gt;Cursor&lt;/a&gt;&amp;nbsp;(según &lt;i&gt;Android Labs&lt;/i&gt; el sistema es más eficiente que con &lt;i&gt;collections&lt;/i&gt;). Dentro del método llamamos a &lt;a href="http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String)"&gt;SQLiteDatabase.query()&lt;/a&gt;&amp;nbsp;con los parámetros: nombre de la tabla (&lt;i&gt;String&lt;/i&gt;), columnas que queremos recuperar (&lt;i&gt;array de Strings&lt;/i&gt;, y otros campos que dejamos a &lt;i&gt;null&lt;/i&gt; para obtener todos los datos sin agrupar, ni ordernar. (Ver detalles en &lt;a href="http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html"&gt;SQLiteDatabase&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;fetchNote()&lt;/i&gt;&amp;nbsp;funciona de una forma similar que&lt;i&gt; fetchAllNotes()&lt;/i&gt;, pero le pasamos un &lt;i&gt;_id&lt;/i&gt;&amp;nbsp;para obtener un registro determinado.&lt;br /&gt;
&lt;br /&gt;
Para actualizar un nota utilizaremos &lt;i&gt;updateNote()&lt;/i&gt;, al que le pasaremos &lt;i&gt;_id&lt;/i&gt;&amp;nbsp;de la nota que modificar, y los valores actualizados.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 3&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Abrimos el fichero &lt;i&gt;res/layout/notepad_list.xml&lt;/i&gt;&amp;nbsp;y vemos un &lt;a href="http://developer.android.com/reference/android/widget/LinearLayout.html"&gt;LinearLayout&lt;/a&gt;&amp;nbsp;vacío. Si alguien no identifica o conoce algo que se pase por &lt;a href="http://desbc.blogspot.com/2010/03/hello-views-i.html"&gt;HelloLinearLayout&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 4&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
.&lt;br /&gt;
Copiamos el siguiente cógido en &lt;i&gt;res/layout/notepad_list.xml&lt;/i&gt;&amp;nbsp;para crear la vista del listado de notas&lt;span class="Apple-style-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;linearlayout xmlns:android="http://schemas.android.com/apk/res/android"&gt;&lt;/linearlayout&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;   &amp;lt;?xml version="1.0" encoding="utf-8"?&lt;/i&gt;&lt;i&gt;&amp;gt; &lt;/i&gt;&lt;i&gt;  &amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;   &amp;lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;      android:layout_width="wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;      android:layout_height="wrap_content"&lt;/i&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;      &lt;/i&gt;&lt;i&gt;&amp;lt;ListView android:id="@android:id/list"&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;         android:layout_width="wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;         android:layout_height="wrap_content"/&lt;/i&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;i&gt;&amp;lt;TextView android:id="@android:id/empty"&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;         android:layout_width="wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;         android:layout_height="wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;         android:text="@string/no_notes"/&lt;/i&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;   &amp;nbsp;&amp;lt;/LinearLayout&amp;gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;     &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Es una vista bastante sencilla, en la que tenemos un &lt;a href="http://developer.android.com/reference/android/widget/ListView.html"&gt;ListView&lt;/a&gt;&amp;nbsp;y un &lt;a href="http://developer.android.com/reference/android/widget/TextView.html"&gt;TextView&lt;/a&gt;. Suponiendo que ya conocemos un poco de vistas (si no, mirar&amp;nbsp;&lt;a href="http://desbc.blogspot.com/2010/03/hello-views-i.html"&gt;HelloLinearLayout&lt;/a&gt;), lo importante son los &lt;i&gt;id&lt;/i&gt; de estos dos elementos. Vemos que empiezan los dos por &lt;i&gt;@android:id/&lt;/i&gt;, esto quiere decir que nos lo proporciona la plataforma &lt;i&gt;Android&lt;/i&gt;. Pues usaremos 'automáticamente' &lt;i&gt;@android:id/list&lt;/i&gt;&amp;nbsp;cuando tengamos notas y &lt;i&gt;@android:id/empty&lt;/i&gt;&amp;nbsp;cuando no haya notas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 5&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para cada fila o item de la lista también deberemos generar una vista. Creamos un fichero nuevo en &lt;i&gt;res/layout &lt;/i&gt;y lo llamamos &lt;i&gt;notes_row.xml&lt;/i&gt;. El contenido será:&lt;span class="Apple-style-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;textview android:id="@+id/text1"&gt;&lt;/textview&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;      &amp;lt;?xml version="1.0" encoding="utf-8"?&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;      &amp;lt;&lt;/i&gt;&lt;/span&gt;TextView android:id="@+id/text1" &amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;          xmlns:android="http://schemas.android.com/apk/res/android"&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;          android:layout_width="wrap_content"&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;          android:layout_height="wrap_content"/&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Podemos observar que en el &lt;i&gt;id&lt;/i&gt; tenemos los carácteres &lt;i&gt;@+&lt;/i&gt;. El &lt;i&gt;+ i&lt;/i&gt;ndica que los elementos que usan esta vista se generan dinámicamente y el &lt;i&gt;id&lt;/i&gt; se creará automáticamente si todavía no existe.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 6&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Abrimos la clase &lt;i&gt;Notepadv1&lt;/i&gt;&amp;nbsp;y le cambiamos la clase padre &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;por &lt;a href="http://developer.android.com/reference/android/app/ListActivity.html"&gt;ListActivity&lt;/a&gt;. Esta clase añade funcionalidad extra para trabajar con listas.&lt;br /&gt;
&lt;br /&gt;
Si miramos el código vemos que tenemos un atributo &lt;i&gt;mNoteNumber&lt;/i&gt;&amp;nbsp;que todavía no usamos, pero que haremos servir para numerar las notas.&lt;br /&gt;
&lt;br /&gt;
También vemos que sobreescribimos tres métodos:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;i&gt;onCreate&lt;/i&gt;: llamado cuando la&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;empieza. Una especie de &lt;i&gt;main&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;onCreateOptionsMenu&lt;/i&gt;: llamado cuando el usuario pulsa en botón de menu&lt;/li&gt;
&lt;li&gt;&lt;i&gt;onOptionsItemSelected&lt;/i&gt;: cuando pulsamos en el botón de menú, normalmente lanzamos una lista de acciones, como por ejemplo "Crear Nota". Pues este método es llamado cuando el usuario pulsa en una opción de estas.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 7&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
El método &lt;i&gt;onCreate()&lt;/i&gt;&amp;nbsp;debe quedarnos así:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;&lt;i&gt;@Override&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;super.onCreate(savedInstanceState);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setContentView(R.layout.notepad_list);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mDbHelper = new NotesDbAdapter(this);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mDbHelper.open();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fillData();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
Después de las dos líneas típicas de un &lt;i&gt;onCreate()&lt;/i&gt;&amp;nbsp;(&lt;i&gt;super.onCreate()&lt;/i&gt;&amp;nbsp;y &lt;i&gt;setContenView()&lt;/i&gt;), creamos la instancia del &lt;i&gt;NotesDbAdapter&lt;/i&gt;, al que le pasamos el &lt;a href="http://developer.android.com/reference/android/content/Context.html"&gt;context&lt;/a&gt;. Abrimos la conexión y rellenamos los datos con &lt;i&gt;fillData()&lt;/i&gt;, método que todavía no hemos implementado.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 8&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
En el método &lt;i&gt;onCreateOptionsMenu()&lt;/i&gt;&amp;nbsp;copiamos:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;&lt;i&gt;@Override&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public boolean onCreateOptionsMenu(Menu menu) {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;boolean result = super.onCreateOptionsMenu(menu);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;menu.add(0, INSERT_ID, 0, R.string.menu_insert);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return result;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
Para que el código compile debemos añadir en el &lt;i&gt;res/value/strings.xml&lt;/i&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;string name="menu_insert"&gt;&lt;i&gt;Add Item&lt;/i&gt;&lt;/string&gt;&lt;br /&gt;
&lt;br /&gt;
Y añadimos en la clase &lt;i&gt;Notepadv1&lt;/i&gt;&amp;nbsp;la siguiente constante:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;        &lt;/i&gt;&lt;/span&gt;&lt;i&gt;public static final int INSERT_ID = Menu.FIRST;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
De esta manera hemos añadido un botón ("Add Item") que aparecerá cuando pulsemos en el botón de menú del dispositivo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 9&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
En &lt;i&gt;onOptionsItemSelected()&lt;/i&gt;&amp;nbsp;copiamos:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;        &lt;/span&gt;&lt;i&gt;@Override&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public boolean onOptionsItemSelected(MenuItem item) {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;switch (item.getItemId()) {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case INSERT_ID:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; createNote();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return super.onOptionsItemSelected(item);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
Este método se ejecutará cuando pulsemos en un opción del menú. Recibe como parámetros un &lt;a href="http://developer.android.com/reference/android/view/MenuItem.html"&gt;MenuItem&lt;/a&gt;, el cuál comprobamos si es la primera opción ("Add &amp;nbsp;Note") para crear una nota nueva con &lt;i&gt;createNote()&lt;/i&gt;. Finalmente llamaremos al método de la superclase con super.&lt;a href="http://developer.android.com/reference/android/app/Activity.html#onOptionsItemSelected(android.view.MenuItem)"&gt;onOptionsItemSelected()&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 10&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para este ejercicio 1 implementaremos un versión poco útil del método &lt;i&gt;createNote()&lt;/i&gt;. Simplemente crearemos una nota nueva vacía asignándole un titulo incluyendo un contador. La nota no se podrá modificar de momento.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;        &lt;/span&gt;&lt;i&gt;private void createNote() {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String noteName = "Note " + mNoteNumber++;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mDbHelper.createNote(noteName, "");&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fillData();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 11&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Por último tenemos que implementar el método &lt;i&gt;fillData()&lt;/i&gt;. El código es:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;&lt;i&gt;private void fillData() {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Cursor c = mDbHelper.fetchAllNotes();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;startManagingCursor(c);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String[] from = new String[] { NotesDbAdapter.KEY_TITLE };&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int[] to = new int[] { R.id.text1 };&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SimpleCursorAdapter notes =&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setListAdapter(notes);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Para rellenar los datos usamos un &lt;a href="http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html"&gt;SimpleCursorAdapter&lt;/a&gt;. Cuando creamos un objeto &lt;a href="http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html"&gt;SimpleCursorAdapter&lt;/a&gt;&amp;nbsp;le pasamos los siguientes parámetros:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;this&lt;/i&gt; --&amp;gt; Contexto&lt;/li&gt;
&lt;li&gt;&lt;i&gt;int layout&lt;/i&gt; --&amp;gt; identificador del layout que contiene la lista de elementos a rellenar&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Cursor&lt;/i&gt; --&amp;gt; &lt;a href="http://developer.android.com/reference/android/database/Cursor.html"&gt;Cursor&lt;/a&gt; de la base de datos&lt;/li&gt;
&lt;li&gt;&lt;i&gt;String[]&lt;/i&gt; --&amp;gt; Array de las columnas a rellenar&lt;/li&gt;
&lt;li&gt;&lt;i&gt;int[]&lt;/i&gt; --&amp;gt; Array de las vistas/layouts que mostrarán los datos&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
Para poder trabajar con el cursor, la clase&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;nos da el método &lt;a href="http://developer.android.com/reference/android/app/Activity.html#startManagingCursor(android.database.Cursor)"&gt;startManagingCursor(Cursor c)&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Paso 12&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Ejecutamos la aplicación&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_C574F3Iy4U0/S6klkXc-JrI/AAAAAAAAAHA/VpWO57iSOfk/s1600-h/notepad1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_C574F3Iy4U0/S6klkXc-JrI/AAAAAAAAAHA/VpWO57iSOfk/s320/notepad1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-6371852600145817101?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/FFrU4wg0rcQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/6371852600145817101/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/notepad-tutorial-ejercicio-1.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/6371852600145817101?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/6371852600145817101?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/FFrU4wg0rcQ/notepad-tutorial-ejercicio-1.html" title="Notepad Tutorial - Ejercicio 1" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_C574F3Iy4U0/S6klkXc-JrI/AAAAAAAAAHA/VpWO57iSOfk/s72-c/notepad1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/notepad-tutorial-ejercicio-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEEQHc9cCp7ImA9WxBbFk0.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-7724803485144617955</id><published>2010-03-15T00:00:00.001+01:00</published><updated>2010-03-15T00:00:01.968+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-15T00:00:01.968+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="truco" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="ddms" /><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu" /><category scheme="http://www.blogger.com/atom/ns#" term="Nexus One" /><title>Hacer capturas con Nexus One en Ubuntu</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ExIJCS_tX3zIDxGjDXzPyDGLifQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ExIJCS_tX3zIDxGjDXzPyDGLifQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ExIJCS_tX3zIDxGjDXzPyDGLifQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ExIJCS_tX3zIDxGjDXzPyDGLifQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;Por Internet existen muchas páginas con las instrucciones que hay que seguir para poder realizar capturas de pantalla, o debuggar, con tu teléfono. Pero después de seguir las instrucciones de varias páginas, yo no lo conseguía para mi Nexus One y Ubuntu.&lt;br /&gt;
Pero por fin he encontrado el cómo y voy a explicarlo (&lt;a href="http://coffeecokeandcode.blogspot.com/2009/12/android-debug-bridge-on-ubuntu-910.html"&gt;fuente&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;En un terminal linux ejecutamos &lt;b&gt;&lt;i&gt;lsusb&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;y obtendremos un pantalla del estilo a ésta:&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/S5tsgsneaJI/AAAAAAAAADg/nvbCLBQa690/s1600-h/lsusb0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="263" src="http://2.bp.blogspot.com/_C574F3Iy4U0/S5tsgsneaJI/AAAAAAAAADg/nvbCLBQa690/s400/lsusb0.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Conectamos el N1 al ordenador y lo ponemos en modo&amp;nbsp;&lt;b&gt;&lt;i&gt;Depuración USB&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;. Ajustes -- Aplicaciones -- Desarrollo -- Depuración USB&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/S5traHVAehI/AAAAAAAAADQ/8-qvcH8SLfo/s1600-h/debug.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_C574F3Iy4U0/S5traHVAehI/AAAAAAAAADQ/8-qvcH8SLfo/s320/debug.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;En un terminal de linux volvemos a ejecutar&amp;nbsp;&lt;b&gt;&lt;i&gt;lsusb&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;y podremos que se ha añadido un dispositivo a la lista:&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/S5ts_1Vg9iI/AAAAAAAAADo/l5-tpMOdUxM/s1600-h/lsusb1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="263" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S5ts_1Vg9iI/AAAAAAAAADo/l5-tpMOdUxM/s400/lsusb1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Ahora necesitamos crear una regla para nuestro dispositivo. Tenemos que crear un fichero en &lt;i&gt;/etc/udev/rules.d/&lt;/i&gt;. Por ejemplo:&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/S5tuM8-RFQI/AAAAAAAAADw/S8tIhuViEYg/s1600-h/rules.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="37" src="http://2.bp.blogspot.com/_C574F3Iy4U0/S5tuM8-RFQI/AAAAAAAAADw/S8tIhuViEYg/s400/rules.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;ul&gt;&lt;li&gt;El contenido del fichero tiene que ser en mi caso (en negrita los valores que vemos con &lt;b&gt;&lt;i&gt;lsusb&lt;/i&gt;&lt;/b&gt;):&lt;/li&gt;
&lt;/ul&gt;&lt;i&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;SUBSYSTEM=="usb", ATTRS{idVendor}=="&lt;b&gt;18d1&lt;/b&gt;", ATTRS{idProduct}=="&lt;b&gt;4e12&lt;/b&gt;", MODE="0666"&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Le damos permisos de acceso y ejecución a ese fichero:&lt;/li&gt;
&lt;/ul&gt;&lt;i&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;sudo chmod a+rx /etc/udev/rules.d/51.android.rules&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Recargamos el servicio &lt;/span&gt;udev:&lt;/li&gt;
&lt;/ul&gt;&lt;div style="text-align: center;"&gt;sudo service udev reload&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Ahora si arrancamos el servicio &lt;/span&gt;adb&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;vemos que no tenemos permisos (imágen de la&amp;nbsp;&lt;a href="http://coffeecokeandcode.blogspot.com/2009/12/android-debug-bridge-on-ubuntu-910.html"&gt;fuente&lt;/a&gt;):&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/S5tz86UVyiI/AAAAAAAAAD4/oIvMhT7JjcM/s1600-h/no_permissions.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="102" src="http://2.bp.blogspot.com/_C574F3Iy4U0/S5tz86UVyiI/AAAAAAAAAD4/oIvMhT7JjcM/s400/no_permissions.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;Ahora reiniciamos el servidor. Primero hacemos el &lt;b&gt;&lt;i&gt;kill-server &lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;y después (imágen de la &lt;a href="http://coffeecokeandcode.blogspot.com/2009/12/android-debug-bridge-on-ubuntu-910.html"&gt;fuente&lt;/a&gt;):&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;i&gt;&lt;div style="display: inline !important; text-align: justify;"&gt;&lt;div style="display: inline !important; text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;div style="display: inline !important; text-align: center;"&gt;&lt;ul style="display: inline !important;"&gt;&lt;li style="display: inline !important; text-align: justify;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;&lt;div style="display: inline !important; text-align: justify;"&gt;&lt;div style="display: inline !important; text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;div class="separator" style="clear: both; display: inline !important; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/S5t0kyp8RAI/AAAAAAAAAEA/5HhoAa5iGmQ/s1600-h/start-server.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="77" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S5t0kyp8RAI/AAAAAAAAAEA/5HhoAa5iGmQ/s400/start-server.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;Por último listamos los dispositivos y veremos algo al estilo:&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/i&gt;&lt;div style="text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/S5t1bR_vfOI/AAAAAAAAAEI/wjB4NxSuFVM/s1600-h/devices.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="57" src="http://2.bp.blogspot.com/_C574F3Iy4U0/S5t1bR_vfOI/AAAAAAAAAEI/wjB4NxSuFVM/s400/devices.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;A partir de ahora podremos hacer capturas y debuggar desde&amp;nbsp;&lt;i&gt;Eclipse&lt;/i&gt;:&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/S5t3DaJpRuI/AAAAAAAAAEY/SnM2sMzkNQY/s1600-h/eclipse.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="315" src="http://4.bp.blogspot.com/_C574F3Iy4U0/S5t3DaJpRuI/AAAAAAAAAEY/SnM2sMzkNQY/s400/eclipse.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;O desde &lt;i&gt;Dalvik Debug Monitor&lt;/i&gt; que ejecutamos con &lt;i&gt;/tools/ddms&lt;/i&gt;:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/S5t2UuuGXpI/AAAAAAAAAEQ/S_vZEbkRojQ/s1600-h/Pantallazo-Dalvik+Debug+Monitor+.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" src="http://2.bp.blogspot.com/_C574F3Iy4U0/S5t2UuuGXpI/AAAAAAAAAEQ/S_vZEbkRojQ/s400/Pantallazo-Dalvik+Debug+Monitor+.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-7724803485144617955?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/CDwjMHI5olA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/7724803485144617955/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/hacer-capturas-con-nexus-one-en-ubuntu.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7724803485144617955?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7724803485144617955?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/CDwjMHI5olA/hacer-capturas-con-nexus-one-en-ubuntu.html" title="Hacer capturas con Nexus One en Ubuntu" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_C574F3Iy4U0/S5tsgsneaJI/AAAAAAAAADg/nvbCLBQa690/s72-c/lsusb0.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/hacer-capturas-con-nexus-one-en-ubuntu.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8EQn4_cCp7ImA9WxBbFE4.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-4227935723514744930</id><published>2010-03-13T00:00:00.000+01:00</published><updated>2010-03-13T00:00:03.048+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-13T00:00:03.048+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="truco" /><category scheme="http://www.blogger.com/atom/ns#" term="action_send" /><category scheme="http://www.blogger.com/atom/ns#" term="email" /><category scheme="http://www.blogger.com/atom/ns#" term="Intent" /><category scheme="http://www.blogger.com/atom/ns#" term="action_chooser" /><title>Enviar e-mail con datos predefinidos (con Intents)</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cB0OqiRkvoxlXB8sDz0NmbMaVsw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cB0OqiRkvoxlXB8sDz0NmbMaVsw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cB0OqiRkvoxlXB8sDz0NmbMaVsw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cB0OqiRkvoxlXB8sDz0NmbMaVsw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Puede que desde nuestra aplicación queramos enviar un email, ya sea para que el usuario se ponga en contacto con nosotros, con algún negocio, etcétera. En este post voy explicar como hacerlo con &lt;i&gt;Intents&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;// Creamos el Intent pasando un String&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;// Rellenamos los datos que queremos predefinir&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;emailIntent.setType("plain/text");&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"sergi.bc@gmail.com"});&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "DeSBC");&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Gracias SBC");&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;// Empezamos la acción con createChooser&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
En la primera línea creamos un &lt;a href="http://developer.android.com/reference/android/content/Intent.html"&gt;Intent&lt;/a&gt;&amp;nbsp;al que le pasamos un &lt;i&gt;String&lt;/i&gt;&amp;nbsp;con la acción&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/content/Intent.html#ACTION_SEND"&gt;android.content.Intent.ACTION_SEND&lt;/a&gt;. Esta acción permite al usuario enviar información a otra persona, aunque todavía no está definido el como.&lt;br /&gt;
&lt;br /&gt;
En las siguientes 4 líneas estamos completando la información que por defecto queremos enviar, para que cada vez que ejecutemos esta acción siempre sea la misma.&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://developer.android.com/reference/android/content/Intent.html#setType(java.lang.String)"&gt;setType("plain/text")&lt;/a&gt;: indicamos que el contenido es de tipo plano&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.android.com/reference/android/content/Intent.html#EXTRA_EMAIL"&gt;android.content.Intent.EXTRA_EMAIL&lt;/a&gt;: indicamos un String[] con las direcciones destino&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.android.com/reference/android/content/Intent.html#EXTRA_SUBJECT"&gt;android.content.Intent.EXTRA_SUBJECT&lt;/a&gt;: indicamos un String con el asunto del email&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.android.com/reference/android/content/Intent.html#EXTRA_TEXT"&gt;android.content.Intent.EXTRA_TEXT&lt;/a&gt;: indicamos un String con el contenido del email&lt;/li&gt;
&lt;/ul&gt;El método &lt;a href="http://developer.android.com/reference/android/content/Intent.html#putExtra(java.lang.String, android.os.Bundle)"&gt;Intent.putExtra(String, Bundle)&lt;/a&gt;&amp;nbsp;añade información extra al &lt;a href="http://developer.android.com/reference/android/content/Intent.html"&gt;Intent&lt;/a&gt;. También es posible eliminar información con &lt;a href="http://developer.android.com/reference/android/content/Intent.html#removeExtra(java.lang.String)"&gt;Intent.removeExtra(String)&lt;/a&gt; y recuperar todo el &lt;a href="http://developer.android.com/reference/android/os/Bundle.html"&gt;Bundle&lt;/a&gt; con &lt;a href="http://developer.android.com/reference/android/content/Intent.html#getBundleExtra(java.lang.String)"&gt;Intent.getBundleExtra(String)&lt;/a&gt;.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;En la última línea, con &lt;a href="http://developer.android.com/reference/android/content/Intent.html#createChooser(android.content.Intent, java.lang.CharSequence)"&gt;Intent.createChooser(Intent, String)&lt;/a&gt;, estamos creando un &lt;a href="http://developer.android.com/reference/android/content/Intent.html"&gt;Intent &lt;/a&gt;de tipo &lt;a href="http://developer.android.com/reference/android/content/Intent.html#ACTION_CHOOSER"&gt;ACTION_CHOOSER&lt;/a&gt;. Se utiliza este método por convención en vez de crearlo de la manera habitual (&lt;i&gt;new Intent(...)&lt;/i&gt;). Lo que conseguimos es lanzar una pantalla en la que podemos elegir una&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;, que en nuestro caso será la &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;encarga de enviar el email. Esta puede ser la&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;de &lt;b&gt;gmail &lt;/b&gt;o de cualquier otra que sea capaz de enviar emails.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/S5p7VkRiQYI/AAAAAAAAADI/mMP7aiP7VTo/s1600-h/chooser.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S5p7VkRiQYI/AAAAAAAAADI/mMP7aiP7VTo/s320/chooser.png" style="cursor: move;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-4227935723514744930?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/Pf3ApaLZTRg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/4227935723514744930/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/enviar-e-mail-con-datos-predefinidos.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/4227935723514744930?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/4227935723514744930?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/Pf3ApaLZTRg/enviar-e-mail-con-datos-predefinidos.html" title="Enviar e-mail con datos predefinidos (con Intents)" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_C574F3Iy4U0/S5p7VkRiQYI/AAAAAAAAADI/mMP7aiP7VTo/s72-c/chooser.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/enviar-e-mail-con-datos-predefinidos.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EERXgyeSp7ImA9WxBbE0k.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-8209625909065341100</id><published>2010-03-12T00:00:00.002+01:00</published><updated>2010-03-12T00:20:04.691+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-12T00:20:04.691+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="truco" /><category scheme="http://www.blogger.com/atom/ns#" term="SharedPreferences" /><category scheme="http://www.blogger.com/atom/ns#" term="Preferences" /><title>Guardar preferencias</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8lxeV_GHYMwpaI0amCdBH9a2nZg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8lxeV_GHYMwpaI0amCdBH9a2nZg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8lxeV_GHYMwpaI0amCdBH9a2nZg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8lxeV_GHYMwpaI0amCdBH9a2nZg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Cuando queremos que nuestra aplicación tenga unas preferencias o propiedades, tanto fijas o variables, y que se mantengan cada vez que la ejecutamos, podemos almacenar estos valores de varias formas ( &lt;a href="http://developer.android.com/guide/topics/data/data-storage.html#pref"&gt;Preferences&lt;/a&gt;, &lt;a href="http://developer.android.com/guide/topics/data/data-storage.html#files"&gt;Files&lt;/a&gt;, &lt;a href="http://developer.android.com/guide/topics/data/data-storage.html#db"&gt;Databases&lt;/a&gt;, y &lt;a href="http://developer.android.com/guide/topics/data/data-storage.html#netw"&gt;Network&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
Quizás la forma más fácil y ligera es con &lt;a href="http://developer.android.com/guide/topics/data/data-storage.html#pref"&gt;Preferences&lt;/a&gt;, que es apropiada para guardar datos de tipo primitivo. La manera de guardar y recoger propiedades es del tipo &lt;i&gt;clave-valor&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
Incluso, es posible compartir las preferencias de nuestra aplicación con otras aplicaciones. Aunque si solamente tenemos una aplicación, o no queremos que las preferencias sean compartidas, todavía es más sencillo (el ejemplo que voy a explicar es de este tipo).&lt;br /&gt;
&lt;br /&gt;
El objeto que contiene las propiedades &lt;i&gt;clave-valor&lt;/i&gt; es del tipo &lt;a href="http://developer.android.com/reference/android/content/SharedPreferences.html"&gt;SharedPreferences&lt;/a&gt;, que obtenemos con la llamada &lt;a href="http://developer.android.com/reference/android/app/Activity.html#getPreferences(int)"&gt;Activity.getPreferences(int mode)&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Para guardar los cambios de nuestras propiedades usaremos un editor &lt;a href="http://developer.android.com/reference/android/content/SharedPreferences.Editor.html"&gt;SharedPreferences.Editor&lt;/a&gt;, pero para leerlas lo haremos directamente del &lt;a href="http://developer.android.com/reference/android/content/SharedPreferences.html"&gt;SharedPreferences&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Vamos con el código de ejemplo (&lt;i&gt;el siguiente código no compila, es solo un trozo de código&lt;/i&gt;),&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;i&gt;import android.app.Activity;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;i&gt;import android.content.SharedPreferences;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public class MyActivity extends Activity {&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;i&gt; . . . &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;b&gt;// En la primera llamada de la Activity recuperamos el valor de una propiedad llamada "welcomeMessage"&lt;/b&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;&lt;b&gt;  &lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;@Override&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;protected void onCreate(Bundle state){&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;super.onCreate(state);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;b&gt;// Creamos el objeto SharedPreferences&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                 &lt;/i&gt;&lt;/span&gt;&lt;i&gt;SharedPreferences settings = getSharedPreferences(MODE_PRIVATE);&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;b&gt;// defaultMessage será el valor por defecto de nuestra propiedad&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;String defaultMessage = "Hola SBC";&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;// recuperamos el valor de nuestra propiedad 'welcomeMessage'&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;String welcomeMessage = settings.getString("welcomeMessage", defaultMessage );&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;myObject.setWelcomeMessage(welcomeMessage);&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                   &lt;/i&gt;&lt;/span&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                   &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;b&gt;// Guardaremos las opciones en este evento, pero &amp;nbsp;podríamos hacerlo en cualquier momento&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;@Override&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                   &lt;/i&gt;&lt;/span&gt;&lt;i&gt;protected void onStop(){&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;super.onStop();&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                  &lt;b&gt;// Creamos el objecto SharedPreferences&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;SharedPreferences settings = getSharedPreferences(MODE_PRIVATE);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;&amp;nbsp;&amp;nbsp;// Recuperamos el editor para poder guardar&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                 &lt;/i&gt;&lt;/span&gt;&lt;i&gt;SharedPreferences.Editor editor = settings.edit();&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;b&gt;// Recuperamos el mensaje que hemos introducido&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;EditText tv = (EditText) findViewById(R.id.message);&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;String message = tv.toString();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;// Con el editor le asignamos un valor a nuestra propiedad 'welcomeMessage'&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                &lt;/i&gt;&lt;/span&gt;&lt;i&gt;editor.putString("welcomeMessage", message);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                               &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;b&gt;// El commit IMPORTANTE sobre el editor&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                               &lt;/i&gt;&lt;/span&gt;&lt;i&gt;editor.commit();&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                    &lt;/i&gt;&lt;/span&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;           &lt;/i&gt;&lt;/span&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
Como se puede observar es bastante sencillo. Para poder compartir las preferencias con otras aplicaciones es muy similar, pero en vez de llamar a &lt;a href="http://developer.android.com/reference/android/app/Activity.html#getPreferences(int)"&gt;Activity.getPreferences(int mode)&lt;/a&gt;, deberemos llamar a &lt;a href="http://developer.android.com/reference/android/content/Context.html#getSharedPreferences(java.lang.String, int)"&gt;Context.getSharedPrefences(String my_preferences, int mode)&lt;/a&gt;, donde mode &lt;i&gt;my_preferences &lt;/i&gt;es el nombre identificativo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-8209625909065341100?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/YGXg3fNdOsk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/8209625909065341100/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/guardar-preferencias.html#comment-form" title="10 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/8209625909065341100?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/8209625909065341100?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/YGXg3fNdOsk/guardar-preferencias.html" title="Guardar preferencias" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>10</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/guardar-preferencias.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcEQ3s4cCp7ImA9WxBbEks.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-1002469003664824108</id><published>2010-03-11T00:00:00.001+01:00</published><updated>2010-03-11T00:00:02.538+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-11T00:00:02.538+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="BroadcastReceiver" /><category scheme="http://www.blogger.com/atom/ns#" term="AndroidManifest" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="IntentFilter" /><category scheme="http://www.blogger.com/atom/ns#" term="ContentProvider" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Fundamentals" /><category scheme="http://www.blogger.com/atom/ns#" term="Intent" /><category scheme="http://www.blogger.com/atom/ns#" term="XML" /><title>Application Fundamentals I</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WlOx_EabJwMpzkLsTJecthYG6ZM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WlOx_EabJwMpzkLsTJecthYG6ZM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WlOx_EabJwMpzkLsTJecthYG6ZM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WlOx_EabJwMpzkLsTJecthYG6ZM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;Como dije hace unos días, voy intentar resumir el articulo &lt;a href="http://developer.android.com/guide/topics/fundamentals.html"&gt;Application Fundamentals&lt;/a&gt;&amp;nbsp;de &lt;i&gt;Android Labs&lt;/i&gt;. Lo haré en dos partes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Supongo que a estas alturas ya sabéis que el lenguaje de programación utilizado es &lt;i&gt;Java&lt;/i&gt;. Así que para los que estamos familiarizados con este lenguaje, en principio no tendremos grandes problemas para empezar a programar en &lt;i&gt;Android&lt;/i&gt;. Para los que no, quizás es recomendable empezar con algún tutorial de &lt;i&gt;Java&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;El código java compilado y los recursos utilizados en nuestra aplicación se empaquetan en un fichero de extensión &lt;i&gt;APK &lt;/i&gt;(&lt;i&gt;Android Package&lt;/i&gt;).&lt;/div&gt;&lt;div&gt;Este fichero &lt;i&gt;APK &lt;/i&gt;lo podemos considerar como una aplicación, ya que por cada aplicación tenemos un fichero &lt;i&gt;APK&lt;/i&gt;. Para instalarnos una aplicación debemos obtener su fichero &lt;i&gt;APK&lt;/i&gt;, ya sea a través del &lt;a href="http://www.android.com/market/"&gt;Android Market&lt;/a&gt;&amp;nbsp;o de algún otro medio.(Sí, es posible y legal)&lt;/div&gt;&lt;div&gt;Aunque el lenguaje de programación sea &lt;i&gt;Java&lt;/i&gt;, las aplicaciones &lt;i&gt;Android &lt;/i&gt;no trabajan de la misma manera. Gracias a la &lt;i&gt;DalvikVM &lt;/i&gt;una aplicación tiene estas características:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Cada aplicación corre en un único proceso &lt;i&gt;Linux&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Cada proceso corre en una &lt;i&gt;VM&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Cada proceso es asignado a un único &lt;i&gt;User ID&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;i&gt;&lt;b&gt;Nota&lt;/b&gt;&lt;/i&gt;: este es el comportamiento normal, pero es posible que dos aplicaciones compartan el mismo &lt;i&gt;UserID &lt;/i&gt;para ver los ficheros entre ellas. Y también correr en el mismo proceso compartiendo la misma &lt;i&gt;VM&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;Application Components&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;Activities&lt;/i&gt;: una &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;es una IU que realiza una actividad o acción. Una aplicación puede tener una simple &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;o varias. Por ejemplo, podemos tener una &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;que liste mensajes, otra que nos permita escribirlos, etc.. Todas estas acciones son clases que heredan de la clase &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Services&lt;/i&gt;: es una acción sin IU pero que corre en modo &lt;i&gt;background &lt;/i&gt;durante un tiempo indefinido. Por ejemplo, en una aplicación para escuchar música, probablemente tendremos una IU para escoger la(s) canción(es) que queremos escuchar, esto sería una &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;. En cambio, lo que es la reproducción de música en sí será un servicio, ya que si hacemos ostras cosas, como navegar, consultar el correo, etcétera, queremos seguir escuchando la música. Todas las clases que implementan servicios heredan de &lt;a href="http://developer.android.com/reference/android/app/Service.html"&gt;Service&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Broadcast Receivers&lt;/i&gt;: es un componente que aparentemente no hace nada, pero que recibe y reacciona a algunos eventos. Por ejemplo, cuando la batería esta baja, cambiamos de zona horaria, recibimos un mensaje (como en la imagen), etc.. Los &lt;i&gt;broadcast receivers&lt;/i&gt; no tienen IU, pero suelen lanzar una&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;o un notificación a través del &lt;a href="http://developer.android.com/reference/android/app/NotificationManager.html"&gt;NotificationManager &lt;/a&gt;.Cada clase hereda de &lt;a href="http://developer.android.com/reference/android/content/BroadcastReceiver.html"&gt;BrodcastReceiver&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/S5d5G4ks9DI/AAAAAAAAACA/V4c6Ep0Gl2Q/s1600-h/status_bar.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S5d5G4ks9DI/AAAAAAAAACA/V4c6Ep0Gl2Q/s320/status_bar.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;Content Provieders&lt;/i&gt;: los &lt;i&gt;Content Providers&lt;/i&gt; hacen posible que cierta información de nuestra aplicación, sea accesible desde otras aplicaciones. Los datos podemos almacenarlos en sistema de ficheros con SQLite u otros medios. Nuestras clases&amp;nbsp;&lt;i&gt;Content Providers&amp;nbsp;&lt;/i&gt;heredan de &lt;a href="http://developer.android.com/reference/android/content/ContentProvider.html"&gt;ContentProvider&lt;/a&gt;, y tendremos un conjunto de métodos con los que conseguir los datos que nos interesen. Un &lt;a href="http://developer.android.com/reference/android/content/ContentProvider.html"&gt;ContentProvider &lt;/a&gt;se activa cuando lo reclama un &lt;a href="http://developer.android.com/reference/android/content/ContentResolver.html"&gt;ContentResolver&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;&lt;i&gt;Intents&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Los componentes&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;,&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/content/BroadcastReceiver.html"&gt;BrodcastReceiver&lt;/a&gt;&amp;nbsp;y&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/app/Service.html"&gt;Service&lt;/a&gt;&amp;nbsp;se activan a través de unos mensajes asíncronos llamados &lt;i&gt;Intents&lt;/i&gt;. Nuestros &lt;i&gt;Intents &lt;/i&gt;heredan de la clase&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/content/Intent.html"&gt;Intent&lt;/a&gt;&amp;nbsp;y contienen el mensaje. A cada tipo componente se le llama de una manera distinta, pasándole la &lt;i&gt;URI &lt;/i&gt;(entre otros parámetros):&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;: &lt;i&gt;&lt;a href="http://developer.android.com/reference/android/content/Context.html#startActivity(android.content.Intent)"&gt;Context.startActivity()&lt;/a&gt;&lt;/i&gt; o&amp;nbsp;&lt;i&gt;&lt;a href="http://www.blogger.com/goog_1268215180265"&gt;Activity&lt;/a&gt;&lt;/i&gt;&lt;i&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)"&gt;.&lt;wbr&gt;&lt;/wbr&gt;startActivityForResult()&lt;/a&gt;&lt;/i&gt;. El primer método simplemente lanza la acción, y el segundo espera una respuesta.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.android.com/reference/android/app/Service.html"&gt;Service&lt;/a&gt;: &lt;a href="http://developer.android.com/reference/android/content/Context.html#startService(android.content.Intent)"&gt;Context.startService()&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://developer.android.com/reference/android/content/BroadcastReceiver.html"&gt;BrodcastReceiver&lt;/a&gt;: Varias formas --&amp;gt;&amp;nbsp;&lt;span style="color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;"&gt;&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/content/Context.html#sendBroadcast(android.content.Intent)"&gt;Context.sendBroadcast()&lt;/a&gt;,&lt;wbr&gt;&lt;/wbr&gt;&lt;a href="http://developer.android.com/reference/android/content/Context.html#sendOrderedBroadcast(android.content.Intent, java.lang.String)"&gt;Context.sendOrderedBroadcast()&lt;/a&gt;&lt;wbr&gt;&lt;/wbr&gt;, y &lt;a href="http://developer.android.com/reference/android/content/Context.html#sendStickyBroadcast(android.content.Intent)"&gt;Context.sendStickyBroadcast()&lt;/a&gt;&lt;code&gt;&lt;code&gt;&lt;/code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Manifest&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Para que Android pueda iniciar un componente de una aplicación debemos definirlo en un archivo &lt;i&gt;xml&lt;/i&gt;. Este archivo se llama &lt;i&gt;AndroidManifest.xml&lt;/i&gt;, y estará incluido en el paquete &lt;i&gt;APK &lt;/i&gt;junto con los demás recursos.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Además de declarar los componentes, en este fichero también tenemos que incluir las bibliotecas que necesita la aplicación, y también determinar los permisos que el usuario deberá otorgar a la aplicación para su correcto funcionamiento.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Un ejemplo:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="&amp;lt;/manifest&amp;gt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="&amp;lt;/manifest&amp;gt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="&amp;lt;/manifest&amp;gt;"&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;manifest . . .&amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;application . . .&amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;activity android:name="com.example.&lt;wbr&gt;&lt;/wbr&gt;project.FreneticActivity"&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:icon="@drawable/&lt;wbr&gt;&lt;/wbr&gt;small_pic.png"&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:label="@string/&lt;wbr&gt;&lt;/wbr&gt;freneticLabel"&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;. . . &amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;/activity&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;. . .&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;/application&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;/manifest&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="The name attribute of the &amp;lt;activity&amp;gt; element names the Activity subclass that implements the activity."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="The name attribute of the &amp;lt;activity&amp;gt; element names the Activity subclass that implements the activity."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;En el atributo de &lt;i&gt;name &lt;/i&gt;de la&amp;nbsp;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;activity&lt;/i&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&amp;nbsp;tenemos la subclase de&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Activity&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;que implimenta la funcionalidad.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span title="The icon and label attributes point to resource files containing an icon and label that can be displayed to users to represent the activity."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;El &lt;i&gt;icon &lt;/i&gt;(icono) y la &lt;i&gt;label&amp;nbsp;&lt;/i&gt;(etiqueta) apuntan a los ficheros del directorio de recursos &lt;i&gt;/res/drawable&lt;/i&gt; que contiene un icono y una etiqueta.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="The icon and label attributes point to resource files containing an icon and label that can be displayed to users to represent the activity."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Los demás componentes (&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;i&gt;service&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;i&gt;,&amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;receiver&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;,&amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;provider&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;) se declaran de una forma similar. Los componentes que no se declaran en el &lt;i&gt;AndroidManifest.xml&lt;/i&gt; nunca se podrán ejecutar porque no son visibles para la aplicación. Sin embargo, los&lt;i&gt;&amp;nbsp;&amp;lt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;broadcastReceiver&amp;gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&amp;nbsp;pueden ser declarados tanto en el &lt;/span&gt;AndroidManifest&lt;span class="Apple-style-span" style="font-style: normal;"&gt; como en &lt;/span&gt;hardcode&lt;span class="Apple-style-span" style="font-style: normal;"&gt;. Para ello deberán registrarse con la llamada &lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/content/Context.html#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)"&gt;Context.registerReceiver()&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span title="The icon and label attributes point to resource files containing an icon and label that can be displayed to users to represent the activity."&gt;&lt;/span&gt;&lt;/span&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Esta mini-introducción del &lt;i&gt;AndroidManifest.xml&lt;/i&gt; se puede completar con &lt;a href="http://developer.android.com/guide/topics/manifest/manifest-intro.html"&gt;The AndroidManifest.xml File&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&lt;b&gt;Intent Filters&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Un objecto&amp;nbsp;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/content/Intent.html"&gt;Intent&lt;/a&gt;&lt;/span&gt;&amp;nbsp;puede llamar explícitamente a un componente. Gracias al &lt;i&gt;AndroidManifest.xml&lt;/i&gt;, Android lo puede encontrará y lo activará. Pero si la llamada no es explícita, Android debe localizar el componente que mejor corresponda a la llamada. Android consigue hacer esto gracias a los &lt;a href="http://developer.android.com/reference/android/content/IntentFilter.html"&gt;IntentFilters&lt;/a&gt;. Un &lt;a href="http://developer.android.com/reference/android/content/IntentFilter.html"&gt;IntentFilter &lt;/a&gt;le indica a Android cual es el mejor &lt;i&gt;handler &lt;/i&gt;para ese tipo de componente. Cosa que también declararemos en el &lt;i&gt;AndroidManifest.xml&lt;/i&gt;. Completando el ejemplo anterior:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="line-height: 22px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;manifest . . .&amp;nbsp;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;application . . .&amp;nbsp;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;activity android:name="com.example.&lt;wbr&gt;&lt;/wbr&gt;project.FreneticActivity"&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:icon="@drawable/&lt;wbr&gt;&lt;/wbr&gt;small_pic.png"&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:label="@string/&lt;wbr&gt;&lt;/wbr&gt;freneticLabel"&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;. . . &amp;nbsp;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;intent-filter . . .&amp;nbsp;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;action android:name="android.intent.&lt;wbr&gt;&lt;/wbr&gt;action.MAIN" /&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;category android:name="android.intent.&lt;wbr&gt;&lt;/wbr&gt;category.LAUNCHER" /&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/intent-filter&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;intent-filter . . .&amp;nbsp;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;action android:name="com.example.&lt;wbr&gt;&lt;/wbr&gt;project.BOUNCE" /&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;data android:mimeType="image/jpeg" /&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;category android:name="android.intent.&lt;wbr&gt;&lt;/wbr&gt;category.DEFAULT" /&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/intent-filter&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/activity&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;. . .&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/application&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/manifest&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;El primer&amp;nbsp;&lt;i&gt;&amp;lt;intent-filter&amp;gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;del ejemplo (la combinación de "&lt;i&gt;android.intent.action.MAIN&lt;/i&gt;" y "&lt;i&gt;android.intent.category.&lt;wbr&gt;&lt;/wbr&gt;LAUNCHER&lt;/i&gt;") es muy común, ya que indica que esta&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Activity&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;es el punto de entrada de la aplicación y que se mostrará en el menú de aplicaciones que puede ejecutar el usuario.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;En el segundo&amp;nbsp;&lt;i&gt;&amp;lt;intent-filter&amp;gt;&lt;/i&gt;&amp;nbsp;se declara una&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Activity&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;que podrá manejar datos de tipo&lt;i&gt; image/jpg&lt;/i&gt;. "&lt;i&gt;android.intent.&lt;wbr&gt;&lt;/wbr&gt;category.DEFAULT&lt;/i&gt;" es la &lt;i&gt;category &lt;/i&gt;que pondremos cuando nuestra&amp;nbsp;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;&lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Activity&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;no sea ninguna otra específica.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Un componente puede tener cualquier número de&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/content/IntentFilter.html"&gt;IntentFilter&lt;/a&gt;. Si no tienen ninguno puede ser activado solamente cuando se llame explícitamente desde el código.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #333333;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;span style="color: black; line-height: 22px;"&gt;&lt;span title="However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver()."&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Para completar esta info &lt;a href="http://developer.android.com/guide/topics/intents/intents-filters.html"&gt;Intents and Intent Filters&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-1002469003664824108?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/iYDvKHR0vhc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/1002469003664824108/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/application-fundamentals-i.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1002469003664824108?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1002469003664824108?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/iYDvKHR0vhc/application-fundamentals-i.html" title="Application Fundamentals I" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_C574F3Iy4U0/S5d5G4ks9DI/AAAAAAAAACA/V4c6Ep0Gl2Q/s72-c/status_bar.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/application-fundamentals-i.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMBSXo-eyp7ImA9WxBbEUk.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-7952274405010770561</id><published>2010-03-09T14:42:00.002+01:00</published><updated>2010-03-09T14:47:38.453+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-09T14:47:38.453+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HelloWorld" /><category scheme="http://www.blogger.com/atom/ns#" term="HelloListView" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="layout" /><category scheme="http://www.blogger.com/atom/ns#" term="ListView" /><category scheme="http://www.blogger.com/atom/ns#" term="strings.xml" /><category scheme="http://www.blogger.com/atom/ns#" term="ListAdapter" /><title>Hello Views VI</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RgFkEEBUUI4i5uDspOJvD0QT3Do/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RgFkEEBUUI4i5uDspOJvD0QT3Do/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RgFkEEBUUI4i5uDspOJvD0QT3Do/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RgFkEEBUUI4i5uDspOJvD0QT3Do/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;b&gt;List View&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para crear una lista de elementos scrollables utilizaremos &lt;a href="http://developer.android.com/reference/android/widget/ListView.html"&gt;ListView&lt;/a&gt;. Estos elementos se insertarán automáticamente en la lista usando un &lt;a href="http://developer.android.com/reference/android/widget/ListAdapter.html"&gt;ListAdapter&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
En el &lt;a href="http://developer.android.com/resources/tutorials/views/hello-listview.html"&gt;ejemplo&lt;/a&gt;&amp;nbsp;que nos proponen en &lt;i&gt;Android Labs&lt;/i&gt;, veremos una lista de países que leeremos de un array de strings. Cuando seleccionemos un elemento, un &lt;a href="http://developer.android.com/reference/android/widget/Toast.html"&gt;Toast&lt;/a&gt;&amp;nbsp;se mostrará diciéndonos su posición en la lista.&lt;br /&gt;
&lt;br /&gt;
Los pasos resumidos son:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Crear el proyecto con Eclipse indicando la &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt;&amp;nbsp;&lt;i&gt;HelloListView&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Crear un fichero llamado &lt;i&gt;list_item.xml&lt;/i&gt;&amp;nbsp;y copiar el contenido en el directorio &lt;i&gt;res/layout/&lt;/i&gt;. Es el layout para cada elemento de la lista.&lt;/li&gt;
&lt;li&gt;Modificar la clase padre de &lt;i&gt;HelloListView&lt;/i&gt;. Ahora tiene que heredar de &lt;a href="http://developer.android.com/reference/android/app/ListActivity.html"&gt;ListActivity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Rellenar el método &lt;i&gt;onCreate()&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Copiar el array de paises (o lo que queramos listar)&lt;/li&gt;
&lt;li&gt;Ejecutar la aplicación&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/S5ZLLwxAkZI/AAAAAAAAAB4/xj-DvrPzze4/s1600-h/hello-listview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_C574F3Iy4U0/S5ZLLwxAkZI/AAAAAAAAAB4/xj-DvrPzze4/s320/hello-listview.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora vamos comentar los puntos más importantes del ejemplo.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Podemos ver que &lt;i&gt;list_item.xml&lt;/i&gt; simplemente nos dice que cada elemento de la lista será una &lt;a href="http://developer.android.com/reference/android/widget/TextView.html"&gt;TextView&lt;/a&gt;. Aquí podríamos añadir por ejemplo una imagen al lado del texto.&lt;/li&gt;
&lt;li&gt;¿Porqué heredamos de &lt;a href="http://developer.android.com/reference/android/app/ListActivity.html"&gt;ListActivity&lt;/a&gt;? Pues porque un &lt;a href="http://developer.android.com/reference/android/app/ListActivity.html"&gt;ListActivity&lt;/a&gt;&amp;nbsp;nos permite mostrar una lista de elementos vinculados a un &lt;i&gt;data source&lt;/i&gt;, como un array. Además permite eventos sobre los elementos de la lista.&lt;/li&gt;
&lt;li&gt;En el método &lt;i&gt;onCreate()&amp;nbsp;&lt;/i&gt;vemos cosas interesantes. Por ejemplo, que no cargamos ningún fichero de layout. En vez de esto, indicamos un &lt;a href="http://developer.android.com/reference/android/widget/ListAdapter.html"&gt;ListAdapter&lt;/a&gt;&amp;nbsp;con &lt;i&gt;setListAdapter(&lt;/i&gt;&lt;a href="http://developer.android.com/reference/android/widget/ListAdapter.html"&gt;&lt;i&gt;ListAdapter&lt;/i&gt;&lt;/a&gt;&lt;i&gt;)&lt;/i&gt;, que añade automáticamente un &lt;a href="http://developer.android.com/reference/android/widget/ListView.html"&gt;ListView&lt;/a&gt;&amp;nbsp;que rellena toda la pantalla de la &lt;a href="http://developer.android.com/reference/android/app/ListActivity.html"&gt;ListActivity&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Al &lt;i&gt;setListAdapter(&lt;/i&gt;&lt;a href="http://developer.android.com/reference/android/widget/ListAdapter.html"&gt;&lt;i&gt;ListAdapter&lt;/i&gt;&lt;/a&gt;&lt;i&gt;)&lt;/i&gt; le pasamos como parámetros un &lt;a href="http://developer.android.com/reference/android/widget/ArrayAdapter.html"&gt;ArrayAdapter&lt;/a&gt;. Para construir este objeto tenemos que pasarle el contexto (en nuestro caso con el &lt;i&gt;this&lt;/i&gt;), el layout que utilizaremos para mostrar los elements (&lt;i&gt;list_item.xml&lt;/i&gt;), y el array o lista de objecto que queremos mostrar (los países).&lt;/li&gt;
&lt;li&gt;El método &lt;i&gt;setTextFilterEnabled(boolean)&lt;/i&gt; de la &lt;a href="http://developer.android.com/reference/android/widget/ListView.html"&gt;ListView &lt;/a&gt;hace posible que podamos filtrar el listado.&lt;/li&gt;
&lt;li&gt;El método &lt;i&gt;setOnItemClickListener(OnItemClickListener)&lt;/i&gt; define un &lt;i&gt;onClick listener&lt;/i&gt; para cada elemento, como vimos en el &lt;a href="http://desbc.blogspot.com/2010/03/hello-views-iv.html"&gt;HelloGridView&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;La manera de definir el array de strings, en &lt;i&gt;hardcode&lt;/i&gt;, no es la mejor. Para hacerlo de una manera más elegante y práctica es mejor referenciarlo desde un fichero externo. El array deberemos declararlo de la siguiente forma, y ubicándolo el fichero &lt;i&gt;strings.xml&lt;/i&gt;&amp;nbsp;en el directorio &lt;i&gt;res/values&lt;/i&gt;:&lt;/li&gt;
&lt;/ul&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                                       &lt;i&gt; &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                       &amp;lt;resources&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                             &amp;lt;string-array name="countries_array"&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                                  &amp;lt;item&amp;gt;Bahrain&amp;lt;/item&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                                  &amp;lt;item&amp;gt;Bangladesh&amp;lt;/item&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                                  &amp;lt;item&amp;gt;Barbados&amp;lt;/item&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                                  &amp;lt;item&amp;gt;Belarus&amp;lt;/item&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                                  &amp;lt;item&amp;gt;Belgium&amp;lt;/item&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                                  &amp;lt;item&amp;gt;Belize&amp;lt;/item&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                                  &amp;lt;item&amp;gt;Benin&amp;lt;/item&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                             &amp;lt;/string-array&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;                                       &amp;lt;/resources&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Ahora para cargar el&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/widget/ListAdapter.html"&gt;ListAdapter&lt;/a&gt;&amp;nbsp;tenemos que pasar el array de strings de la siguiente forma:&lt;/li&gt;
&lt;/ul&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String[] countries = getResources().getStringArray(R.array.countries_array);&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setAdapter(new ArrayAdapter&lt;/i&gt;&lt;string&gt;&lt;i&gt;(this, R.layout.list_item, countries));&lt;/i&gt;&lt;/string&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Dudas&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
Me surge la duda de si el método &lt;i&gt;setTextFilterEnabled(boolean)&lt;/i&gt; sólo funciona cuando nuestros elementos son &lt;a href="http://developer.android.com/reference/android/widget/TextView.html"&gt;TextView&lt;/a&gt;, o siempre aunque sean de otro tipo y el filtro se haga por algún identificador o descripción.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Notas&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
Como nos indica &lt;i&gt;Android Labs&lt;/i&gt;&amp;nbsp;en el ejemplo, android ya proporciona unos layouts de serie, cosa que no conocía hasta ahora. Os dejo el &lt;a href="http://developer.android.com/reference/android/R.layout.html"&gt;enlace&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-7952274405010770561?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/BUig70WMKpM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/7952274405010770561/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/hello-views-vi.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7952274405010770561?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7952274405010770561?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/BUig70WMKpM/hello-views-vi.html" title="Hello Views VI" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C574F3Iy4U0/S5ZLLwxAkZI/AAAAAAAAAB4/xj-DvrPzze4/s72-c/hello-listview.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/hello-views-vi.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMBQnszfyp7ImA9WxBUGE4.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-1015299938031023689</id><published>2010-03-06T00:34:00.004+01:00</published><updated>2010-03-06T01:14:13.587+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-06T01:14:13.587+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HelloWorld" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="TabHost.Spec" /><category scheme="http://www.blogger.com/atom/ns#" term="TabHost" /><category scheme="http://www.blogger.com/atom/ns#" term="FrameLayout" /><category scheme="http://www.blogger.com/atom/ns#" term="TabWidget" /><category scheme="http://www.blogger.com/atom/ns#" term="TabHost.TabSpec" /><category scheme="http://www.blogger.com/atom/ns#" term="main.xml" /><category scheme="http://www.blogger.com/atom/ns#" term="HelloTabWidget" /><title>Hello Views V</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/M-EmVHwA6UNZJxyollMGnFpI84Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M-EmVHwA6UNZJxyollMGnFpI84Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/M-EmVHwA6UNZJxyollMGnFpI84Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M-EmVHwA6UNZJxyollMGnFpI84Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;TabLayout&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Como nos dicen en &lt;i&gt;Android Labs&lt;/i&gt;, para crear una interfaz con pestañas o tabs, necesitaremos usar un &lt;a href="http://developer.android.com/reference/android/widget/TabHost.html"&gt;TabHost&lt;/a&gt; y un &lt;a href="http://developer.android.com/reference/android/widget/TabWidget.html"&gt;TabWidget&lt;/a&gt;. El&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/widget/TabHost.html"&gt;TabHost&lt;/a&gt;&amp;nbsp;será el nodo raíz de nuestro layout, que tendrá el&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/widget/TabWidget.html"&gt;TabWidget&lt;/a&gt;&amp;nbsp;para mostrar las pestañas, y un &lt;a href="http://developer.android.com/reference/android/widget/FrameLayout.html"&gt;FrameLayout&lt;/a&gt; para enseñar el contenido de las pestañas.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;Existen dos formas de implementar un IU con pestañas: en una sola &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt; o en una &lt;a href="http://developer.android.com/reference/android/app/Activity.html"&gt;Activity&lt;/a&gt; por pestaña. Este último método es el más indicado ya que tendremos separadas las funcionalidades, y lo utilizaremos para este &lt;a href="http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"&gt;ejemplo&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/S5GTjb1H7WI/AAAAAAAAABw/tOOhrPjjxi0/s1600-h/hello-tabwidget.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_C574F3Iy4U0/S5GTjb1H7WI/AAAAAAAAABw/tOOhrPjjxi0/s320/hello-tabwidget.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Los pasos resumidos son:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Crear el proyecto con Eclipse indicando la &lt;i&gt;Activity&lt;/i&gt; &lt;i&gt;HelloTabWidget&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Crear 3 &lt;i&gt;Activity's&lt;/i&gt; más: &lt;i&gt;ArtistsActivity&lt;/i&gt;, &lt;i&gt;AlbumsActivity&lt;/i&gt; y &lt;i&gt;SongsActivity&lt;/i&gt;. Poniendo en cada método &lt;i&gt;onCreate&lt;/i&gt; de las 3 &lt;i&gt;Activity&lt;/i&gt; un &lt;i&gt;TextView&lt;/i&gt; identificativo&lt;/li&gt;
&lt;li&gt;Para cada pestaña necesitamos dos imágenes, una para cuando está activada y otra para cuando no (en la &lt;a href="http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"&gt;página&lt;/a&gt; de &lt;i&gt;Android&lt;/i&gt; &lt;i&gt;Labs&lt;/i&gt; sólo vemos la imagen del micro, podemos coger otras para realizar el ejemplo). Además necesitamos un fichero XML, que hace de selector para realizar precisamente esa acción. Tanto las imágenes como los ficheros XML se guardan en &lt;i&gt;res/drawable&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Crear o copiar el contenido del fichero&lt;i&gt; main.xml&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Modificar la &lt;i&gt;Activity&lt;/i&gt; principal, &lt;i&gt;HelloTabWidget&lt;/i&gt;, para que herede de &lt;a href="http://developer.android.com/reference/android/app/TabActivity.html"&gt;TabActivity&lt;/a&gt; en vez de &lt;i&gt;Activity&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Copiar todo el código del método &lt;i&gt;onCreate&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Cambiar el tema de la aplicación&lt;/li&gt;
&lt;li&gt;Ejecutar aplicación&lt;/li&gt;
&lt;/ol&gt;&lt;ol&gt;&lt;/ol&gt;&lt;div&gt;Los puntos clave de este ejemplo (bajo mi punto de vista) son:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;El selector: La manera de mostrar una imagen para cuando la pestaña está activa o no se realiza en un fichero XML, &amp;nbsp;y un fichero por &lt;i&gt;Activity&lt;/i&gt;. El tag es &amp;lt;&lt;i&gt;selector&amp;gt;&lt;/i&gt; y dentro muestra los items que puede mostrar. Con el atributo &lt;i&gt;android:state_selected="true"&lt;/i&gt; indicamos cuál es la imagen/item a mostrar cuando la pestaña está activa. Este recurso (fichero XML), se lo tenemos que pasar al método &lt;i&gt;setIndicator&lt;/i&gt; a cada Tab.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;span class="Apple-style-span" style="white-space: normal;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;   &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;            &lt;span class="Apple-style-span" style="font-style: normal; white-space: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;selector xmlns:android="http://schemas.android.com/apk/res/android"&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;!-- When selected, use grey --&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;item android:drawable="@drawable/ic_tab_artists_grey"&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;nbsp;android:state_selected="true" /&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;!-- When not selected, use white--&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;&lt;/i&gt;&lt;/span&gt;item android:drawable="@drawable/ic_tab_artists_white" /&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;           &lt;span class="Apple-style-span" style="font-style: normal; white-space: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;/selector&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;main.xml&lt;/i&gt;: Vemos que la vista empieza y acaba por con el &lt;a href="http://developer.android.com/reference/android/widget/TabHost.html"&gt;TabHost&lt;/a&gt;. Después de indicar el &lt;i&gt;xmlns&lt;/i&gt;, &lt;i&gt;id&lt;/i&gt; y forma de relleno, vemos un &lt;a href="http://developer.android.com/reference/android/widget/LinearLayout.html"&gt;LinearLayout&lt;/a&gt;. Dentro de ésto vemos lo importante, un &lt;a href="http://developer.android.com/reference/android/widget/TabWidget.html"&gt;TabWidget&lt;/a&gt; y un &lt;a href="http://developer.android.com/reference/android/widget/FrameLayout.html"&gt;FrameLayout&lt;/a&gt;. El &lt;a href="http://developer.android.com/reference/android/widget/TabWidget.html"&gt;TabWidget&lt;/a&gt; ocupa a lo ancho el mismo espacio que su parent, y a lo alto el espacio necesario para mostrarse entero, es decir, el tamaño de la imagen.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;onCreate: Conseguimos los recursos, el &lt;a href="http://developer.android.com/reference/android/widget/TabHost.html"&gt;TabHost&lt;/a&gt; con &lt;i&gt;getTabHost&lt;/i&gt; (método específico de la clase &lt;a href="http://developer.android.com/reference/android/app/TabActivity.html"&gt;TabActivity&lt;/a&gt;). Creamos un&lt;a href="http://developer.android.com/reference/android/widget/TabHost.TabSpec.html"&gt; TabHost.TabSpec&lt;/a&gt;, que sirve para indicar las propiedades de una pestaña. Esta variable la vamos reutilizando una vez añadimos una pestaña al &lt;a href="http://developer.android.com/reference/android/widget/TabHost.html"&gt;TabHost&lt;/a&gt; con addTab(spec).&lt;/li&gt;
&lt;li&gt;Themes: En el ejemplo lo único que hace este tema es no mostrar el título de la aplicación. Pero se pueden hacer muchísimas más cosas. Más info &lt;a href="http://developer.android.com/guide/topics/ui/themes.html"&gt;aquí&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;&lt;i&gt;Notas&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;En el código del ejemplo hay un fallo, en el método onCreate indica &lt;i&gt;mTabHost.addTab(spec);&lt;/i&gt; cuando quiere decir &lt;i&gt;tabHost.addTab(spec);&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;No os olvidéis de cada pestaña tiene dos imágenes y un XML (selector), y que desde el XML se hace referencia al recurso de la imagen (&lt;i&gt;&amp;lt;item android:drawable="@drawable/nombre_imagen"/&amp;gt;). &lt;/i&gt;Y que todo va dentro del directorio &lt;i&gt;res/drawable/&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Y tampoco os olvidéis de incluir las 3 &lt;i&gt;Activity&lt;/i&gt;&amp;nbsp;en el fichero &lt;i&gt;main.xml.&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-1015299938031023689?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/luYcH-XKsz0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/1015299938031023689/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/hello-views-v.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1015299938031023689?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1015299938031023689?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/luYcH-XKsz0/hello-views-v.html" title="Hello Views V" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C574F3Iy4U0/S5GTjb1H7WI/AAAAAAAAABw/tOOhrPjjxi0/s72-c/hello-tabwidget.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/hello-views-v.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEINR3g9fCp7ImA9WxBUGE4.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-9059622111397552290</id><published>2010-03-04T15:09:00.000+01:00</published><updated>2010-03-06T00:43:16.664+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-06T00:43:16.664+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HelloWorld" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="GridView" /><category scheme="http://www.blogger.com/atom/ns#" term="main.xml" /><title>Hello Views IV</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/60dI2IcVCvN1ZXjFSxcC9pOe0go/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/60dI2IcVCvN1ZXjFSxcC9pOe0go/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/60dI2IcVCvN1ZXjFSxcC9pOe0go/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/60dI2IcVCvN1ZXjFSxcC9pOe0go/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;b&gt;GridView&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Un &lt;a href="http://developer.android.com/reference/android/widget/GridView.html"&gt;GridView&lt;/a&gt; también es un &lt;a href="http://developer.android.com/reference/android/view/ViewGroup.html"&gt;ViewGroup&lt;/a&gt;, que muestra sus hijos en una grid &lt;i&gt;scrollable&lt;/i&gt; de manera bidimensional. A diferencia de las otras vistas, los elementos no se van añadiendo en el &lt;i&gt;main.xml&lt;/i&gt;, sino que lo hacen a través de un &lt;a href="http://developer.android.com/reference/android/widget/ListAdapter.html"&gt;ListAdapter&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
En el&amp;nbsp;&lt;a href="http://developer.android.com/resources/tutorials/views/hello-gridview.html"&gt;ejemplo&lt;/a&gt;&amp;nbsp;de &lt;i&gt;AndroidLabs &lt;/i&gt;nos enseñan a crear una &lt;a href="http://developer.android.com/reference/android/widget/GridView.html"&gt;GridView &lt;/a&gt;con imágenes en miniatura. Los pasos que tenemos que seguir, y que luego explicaré, son los siguientes:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Crear el proyecto con Eclipse indicando la &lt;i&gt;Activity HelloGridView&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Copiar las imágenes que queremos visualizar en &lt;i&gt;res/drawable&lt;/i&gt; (las del ejemplo son &lt;a href="http://developer.android.com/shareables/sample_images.zip"&gt;estas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Crear o copiar el contenido del fichero&lt;i&gt; main.xml&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Crear y copiar el contenido de la clase &lt;/span&gt;ImageAdapter&lt;span class="Apple-style-span" style="font-style: normal;"&gt;, que hereda de la clase &lt;a href="http://developer.android.com/reference/android/widget/BaseAdapter.html"&gt;BaseAdapter&lt;/a&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Copiar el siguiente texto en el método &lt;i&gt;onCreate &lt;/i&gt;de la &lt;i&gt;Activity&lt;/i&gt;:&lt;/li&gt;
&lt;/ol&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;super.onCreate(savedInstanceState);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setContentView(R.layout.main);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView gridview = (GridView) findViewById(R.id.gridview);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gridview.setAdapter(new ImageAdapter(this));&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gridview.setOnItemClickListener(new OnItemClickListener() {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onItemClick(AdapterView parent, View v, int position, long id) {&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;/i&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/S4-8t7hXinI/AAAAAAAAABo/COM91i4_KwM/s1600-h/hello-gridview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_C574F3Iy4U0/S4-8t7hXinI/AAAAAAAAABo/COM91i4_KwM/s320/hello-gridview.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
En este caso lo más importante no es el &lt;i&gt;main.xml&lt;/i&gt;, pero que también voy a comentar:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;android:columnWidth&lt;/i&gt;: ancho de la columna&lt;/li&gt;
&lt;li&gt;&lt;i&gt;android:numColumns&lt;/i&gt;: número de columnas. (auto-fit, se ajusta automáticamente)&lt;/li&gt;
&lt;li&gt;&lt;i&gt;android:verticalSpacing&lt;/i&gt;: separación vertical entre elementos&lt;/li&gt;
&lt;li&gt;&lt;i&gt;android:horizontalSpacing&lt;/i&gt;: separación horizontal entre elementos&lt;/li&gt;
&lt;li&gt;&lt;i&gt;android:stretchMode&lt;/i&gt;: forma de estirar el contenido. columnWidth, a lo ancho de la columna&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
La 'chicha' empieza en el método &lt;i&gt;onCreate &lt;/i&gt;de la Activity:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;i&gt;GridView gridview = (GridView) findViewById(R.id.gridview);&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;i&gt;gridview.setAdapter(new ImageAdapter(this));&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Obtenemos el id de nuestra vista, la grid. Hemos indicado ese id en el fichero &lt;i&gt;main.xml&lt;/i&gt;, cuando hemos creado el &lt;a href="http://developer.android.com/reference/android/widget/GridView.html"&gt;GridView&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;i&gt;gridview.setOnItemClickListener(new OnItemClickListener() {&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;public void onItemClick(AdapterView parent, View v, int position, long id) {&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;  &lt;/i&gt;&lt;/span&gt;&lt;i&gt; &amp;nbsp; Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt;  &lt;/i&gt;&lt;/span&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;i&gt;});&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Añadimos un &lt;i&gt;Listener &lt;/i&gt;para cuando hacemos click en el item, una imagen. Al pulsar mostramos un &lt;a href="http://developer.android.com/reference/android/widget/Toast.html"&gt;Toast &lt;/a&gt;(especie de popup) en el que vemos la posicion de la imagen.&lt;br /&gt;
&lt;br /&gt;
Por último encontramos la clase &lt;i&gt;ImageAdapter&lt;/i&gt;, que hereda de la clase &lt;a href="http://developer.android.com/reference/android/widget/BaseAdapter.html"&gt;BaseAdapter&lt;/a&gt;. El método importante es &lt;i&gt;getView&lt;/i&gt;(). Este método esta sobreescribiendo al método de la clase &lt;a href="http://developer.android.com/reference/android/widget/Adapter.html"&gt;Adapter&lt;/a&gt;, de la que hereda &lt;a href="http://developer.android.com/reference/android/widget/BaseAdapter.html"&gt;BaseAdapter&lt;/a&gt;, y es llamado cada vez que se va a pintar un elemento de la &lt;a href="http://developer.android.com/reference/android/widget/GridView.html"&gt;GridView&lt;/a&gt;. En nuestro caso carga las imágenes que hemos descargado antes, y en el orden que le indicamos en el array mThumbIds.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Dudas&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
Creo que el parámetro &lt;i&gt;convertView &lt;/i&gt;viene a &lt;i&gt;null &lt;/i&gt;la primera vez que cargamos la &lt;a href="http://developer.android.com/reference/android/widget/GridView.html"&gt;GridView&lt;/a&gt;, pero en las siguientes llamadas nos viene ya la &lt;a href="http://developer.android.com/reference/android/widget/ImageView.html"&gt;ImageView&lt;/a&gt;. Por eso comprobamos si viene a &lt;i&gt;null &lt;/i&gt;o no. ¿Me equivoco?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-9059622111397552290?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/q3ypL3ufO44" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/9059622111397552290/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/hello-views-iv.html#comment-form" title="1 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/9059622111397552290?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/9059622111397552290?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/q3ypL3ufO44/hello-views-iv.html" title="Hello Views IV" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C574F3Iy4U0/S4-8t7hXinI/AAAAAAAAABo/COM91i4_KwM/s72-c/hello-gridview.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/hello-views-iv.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEINR3g9fSp7ImA9WxBUGE4.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-7838785098831822578</id><published>2010-03-04T09:01:00.003+01:00</published><updated>2010-03-06T00:43:16.665+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-06T00:43:16.665+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HelloWorld" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="TableLayout" /><category scheme="http://www.blogger.com/atom/ns#" term="main.xml" /><title>Hello Views III</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8MXrOio-zhGMh-wWbAjWwsCeCKs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8MXrOio-zhGMh-wWbAjWwsCeCKs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8MXrOio-zhGMh-wWbAjWwsCeCKs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8MXrOio-zhGMh-wWbAjWwsCeCKs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;TableLayout&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; font-weight: normal;"&gt;Como las anteriores vistas, la clase &lt;i&gt;&lt;a href="http://developer.android.com/reference/android/widget/TableLayout.html"&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;TableLayout&lt;/span&gt; &lt;/a&gt;&lt;/i&gt;es una &lt;i&gt;&lt;a href="http://developer.android.com/reference/android/view/ViewGroup.html"&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;ViewGroup&lt;/span&gt; &lt;/a&gt;&lt;/i&gt;que&amp;nbsp;muestra sus hijos (&lt;a href="http://developer.android.com/reference/android/view/View.html"&gt;Views&lt;/a&gt;), en filas y columnas. Y también empezamos&amp;nbsp;del mismo modo:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Crear el proyecto con Eclipse indicando la Activity &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;HelloTableLayout&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Crear o copiar el contenido del fichero &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;main.xml&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Cargar la vista en el método &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;onCreate &lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;de nuestra &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Activity&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Ejecutar&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Podemos ver dos tablas, que se identifican por el tag TableLayout, y&amp;nbsp;en este caso los atributos importantes son los siguientes:&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;android:stretchColumns&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;: el número de columnas empezando por el 0. Es decir, el 1 indica que hay dos columnas.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;android:layout_column&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;: índice de la columna en la que queremos mostrar un elemento.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;android:padding&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;:el relleno&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;android:gravity&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;: la manera de alinear el texto cuando es más pequeño que la vista.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;Como veis es bastante parecido a las tablas HTML.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; font-weight: normal;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/S49muQymkJI/AAAAAAAAABg/HtQXJBE1hvk/s1600-h/hello-tablelayout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S49muQymkJI/AAAAAAAAABg/HtQXJBE1hvk/s320/hello-tablelayout.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; font-weight: normal;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Curiosidad&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
Me ha parecido bastante curioso la forma de crear las lineas de&amp;nbsp;separación entre las dos tablas:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;&amp;lt;View&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height="2dip"&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:background="#FF909090" /&amp;gt;&lt;/i&gt;&lt;br /&gt;
Es un elemento &lt;i&gt;View&lt;/i&gt;, clase de la que heredan los &lt;i&gt;TextView&lt;/i&gt;, etcétera,&amp;nbsp;con una altura de 2dip (en otro post explicaré porqué es aconsejable&amp;nbsp;usar este tipo de unidad), con un color de fondo determinado en RGB.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; font-weight: normal;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; font-weight: normal;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-7838785098831822578?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/fJ0MALL7CtQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/7838785098831822578/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/hello-views-iii.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7838785098831822578?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7838785098831822578?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/fJ0MALL7CtQ/hello-views-iii.html" title="Hello Views III" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_C574F3Iy4U0/S49muQymkJI/AAAAAAAAABg/HtQXJBE1hvk/s72-c/hello-tablelayout.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/hello-views-iii.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEINR3g9fip7ImA9WxBUGE4.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-2140476694013404832</id><published>2010-03-02T16:21:00.003+01:00</published><updated>2010-03-06T00:43:16.666+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-06T00:43:16.666+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HelloWorld" /><category scheme="http://www.blogger.com/atom/ns#" term="RelativeLayout" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="main.xml" /><title>Hello Views II</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Yc61JBDqopQ-Y1GvbSmXhDbQYJ8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Yc61JBDqopQ-Y1GvbSmXhDbQYJ8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Yc61JBDqopQ-Y1GvbSmXhDbQYJ8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Yc61JBDqopQ-Y1GvbSmXhDbQYJ8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href="http://www.blogger.com/"&gt;&lt;/a&gt;&lt;span id="goog_1267536485713"&gt;&lt;/span&gt;&lt;span id="goog_1267536485714"&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;RelativeLayout&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
La clase &lt;a href="http://developer.android.com/reference/android/widget/RelativeLayout.html"&gt;RelativeLayout&lt;/a&gt;, al igual que LinearLayout, hereda de &lt;a href="http://developer.android.com/reference/android/view/ViewGroup.html"&gt;ViewGroup&lt;/a&gt;. Pero en este caso los elementos se muestran de manera relativa los unos con los otros.&lt;br /&gt;
Seguimos los pasos del &lt;a href="http://developer.android.com/resources/tutorials/views/hello-relativelayout.html"&gt;tutorial&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: 13px; line-height: 22px;"&gt;Crear el proyecto con Eclipse indicando la Activity&lt;i&gt;&amp;nbsp;HelloRelativeLayout&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: 13px; line-height: 22px;"&gt;Crear o copiar el contenido del fichero&amp;nbsp;&lt;i&gt;main.xml&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Cargar la vista en el método&amp;nbsp;&lt;i&gt;onCreate&lt;/i&gt;&amp;nbsp;de nuestra Activity.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: 13px; line-height: 22px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;Ejecutar&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;En el fichero &lt;i&gt;main.xml&lt;/i&gt;&amp;nbsp;podemos identificar el inicio y el final de nuestro layout &amp;lt;RelativeLayout&amp;gt;...&amp;lt;/RelativeLayout&amp;gt;. Pero en este caso lo más importante lo encontramos dentro de cada componente &lt;a href="http://developer.android.com/reference/android/view/View.html"&gt;View&lt;/a&gt;, su posición relativa. En el ejemplo:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;i&gt;android:id="@+id/xxx"&lt;/i&gt;: El &lt;b&gt;&lt;i&gt;+&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;de &lt;/span&gt;&lt;i&gt;@&lt;/i&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&amp;nbsp;que el id del elemento se crea automáticamente si no existe.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;android:layout_below="@id/label"&lt;/i&gt;: Debajo de. En el ejemplo podemos ver que la caja de texto está debajo de la etiqueta. Tenemos que poner el id del elemento del cuál nos posicionamos relativamente.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;android:layout_alignParentRight="true"&lt;/i&gt;: Si es cierto, el lado derecho del elemento coincide con el lado derecho del padre. Vemos que el botón de &lt;i&gt;Ok&lt;/i&gt;, además de estar debajo de la caja de texto, está a la derecha, coincidiendo con el lado derecho del &lt;i&gt;parent&lt;/i&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;android:layout_marginLeft="10dip"&lt;/i&gt;: Indica la cantidad de margen que queremos en el lado izquierdo de nuestro elemento.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;android:layout_toLeftOf="@id/ok"&lt;/i&gt;: A la izquierda de. En el ejemplo vemos como el botón de cancelar se sitúa a la izquierda del botón de &lt;i&gt;Ok&lt;/i&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;android:layout_alignTop=&lt;/i&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;i&gt;"@id/ok"&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;: La parte superior alineado con. El lado superior del botón cancelar está a la misma altura que el lado superior del botón &lt;i&gt;Ok&lt;/i&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_C574F3Iy4U0/S40nSZhOLsI/AAAAAAAAABY/vWZO5ktkAL0/s1600-h/hello-relativelayout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_C574F3Iy4U0/S40nSZhOLsI/AAAAAAAAABY/vWZO5ktkAL0/s320/hello-relativelayout.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;Para otros atributos del RelativeLayout mirar&amp;nbsp;&lt;a href="http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html"&gt;RelativeLayout.LayoutParams&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;Siempre es aconsejable &lt;i&gt;manusear &lt;/i&gt;un poco el código que cogemos de ejemplo. ¿Lo habéis hecho? ¿Alguna duda?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Trebuchet MS', verdana, sans-serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 22px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-2140476694013404832?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/v1oFLdssELQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/2140476694013404832/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/hello-views-ii.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/2140476694013404832?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/2140476694013404832?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/v1oFLdssELQ/hello-views-ii.html" title="Hello Views II" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_C574F3Iy4U0/S40nSZhOLsI/AAAAAAAAABY/vWZO5ktkAL0/s72-c/hello-relativelayout.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/hello-views-ii.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEINR3g9fyp7ImA9WxBUGE4.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-1802726535954678632</id><published>2010-03-02T11:19:00.006+01:00</published><updated>2010-03-06T00:43:16.667+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-06T00:43:16.667+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HelloWorld" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="LinearLayout" /><category scheme="http://www.blogger.com/atom/ns#" term="main.xml" /><title>Hello Views I</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LjEneB2pqGTxmg2-hnpbGlIY8Mk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LjEneB2pqGTxmg2-hnpbGlIY8Mk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LjEneB2pqGTxmg2-hnpbGlIY8Mk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LjEneB2pqGTxmg2-hnpbGlIY8Mk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Continuando con los recursos de Android Labs, lo siguiente que vamos hacer es un &lt;i&gt;HelloWorld&lt;/i&gt; para cada tipo de vista. En esta primera entrega veremos el &lt;a href="http://developer.android.com/resources/tutorials/views/hello-linearlayout.html"&gt;LinearLayout&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span"&gt;LinearLayout&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Este layout es una vista en grupo, la cuál muestra los subelementos de manera lineal.Si vamos a la api de &amp;nbsp;la clase &lt;a href="http://developer.android.com/reference/android/widget/LinearLayout.html"&gt;LinearLayout&lt;/a&gt;&amp;nbsp;vemos que hereda de la clase &lt;a href="http://developer.android.com/reference/android/view/ViewGroup.html"&gt;ViewGroup&lt;/a&gt;.&lt;br /&gt;
Vamos a seguir los pasos del &lt;a href="http://developer.android.com/resources/tutorials/views/hello-linearlayout.html"&gt;tutorial&lt;/a&gt;:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Crear el proyecto con Eclipse indicando la Activity&lt;i&gt; HelloLinearLayout&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Crear o copiar el contenido del fichero &lt;i&gt;main.xml&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Cargar la vista en el método &lt;i&gt;onCreate&lt;/i&gt; de nuestra Activity.&lt;/li&gt;
&lt;li&gt;Ejecutar&lt;/li&gt;
&lt;/ol&gt;Como podemos ver en la pantalla tenemos dos layouts, uno horizontal mostrando 4 colores, y uno vertical mostrando 4 filas con texto:&lt;br /&gt;
&lt;ol&gt;&lt;/ol&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_C574F3Iy4U0/S4zPR7hmOlI/AAAAAAAAABI/AgbminhlW4A/s1600-h/hello-linearlayout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_C574F3Iy4U0/S4zPR7hmOlI/AAAAAAAAABI/AgbminhlW4A/s320/hello-linearlayout.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Ahora vamos a comentar lo importante, el fichero &lt;i&gt;main.xml&lt;/i&gt;. Como decíamos, podemos identificar los dos layouts:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;&amp;lt;LinearLayout android:orientation="horizontal"...&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;...&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;/LinearLayout&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;LinearLayout android:orientation="vertical"...&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;...&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;lt;&lt;/i&gt;&lt;/span&gt;/LinearLayout&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;i&gt;&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Los atributos que configuran nuestros LinearLayout son:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;android:orientation&lt;/i&gt;&amp;nbsp;:indica la orientación del layout.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;android:layout_width&lt;/i&gt;: indica el modo de relleno a lo ancho.&lt;i&gt;&amp;nbsp;fill_parent&lt;/i&gt;&amp;nbsp;hace que ocupe todo el espacio que nos deja el elemento "padre".&lt;/li&gt;
&lt;li&gt;&lt;i&gt;android:layout_height&lt;/i&gt;: indica el modo de relleno a lo largo/alto.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;android:layout_weight&lt;/i&gt;: indica la importancia del elemento dentro de la vista. El 0 es el valor menos importante. (más información en &lt;i&gt;&lt;a href="http://developer.android.com/guide/topics/ui/layout-objects.html#linearlayout"&gt;Common Layout Objects&lt;/a&gt;&lt;/i&gt;)&lt;/li&gt;
&lt;/ul&gt;Dentro de los LinearLayouts están los TextView que contienen el texto a enseñar, cosa que no es muy práctica pero que nos sirve para simplificar el ejemplo.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;Dudas&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Después de estar un rato jugando con el fichero &lt;i&gt;main.xml&lt;/i&gt;&amp;nbsp;y modificar los valores del atributo &lt;i&gt;android:layout_weight&lt;/i&gt; de los TextView, he visto que efectivamente cambia el tamaño al variar los valores. Concretamente he puesto un 2 a los TextView rojo y amarillo, que han incrementado su tamaño pero no ocupan lo mismo, el amarillo ocupa más.&lt;/div&gt;&lt;div&gt;No sé cuál es el motivo, ¿pero es por el tamaño del texto? &lt;i&gt;yellow &lt;/i&gt;es más largo que &lt;i&gt;red.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-1802726535954678632?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/W67cat_77F8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/1802726535954678632/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/03/hello-views-i.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1802726535954678632?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/1802726535954678632?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/W67cat_77F8/hello-views-i.html" title="Hello Views I" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_C574F3Iy4U0/S4zPR7hmOlI/AAAAAAAAABI/AgbminhlW4A/s72-c/hello-linearlayout.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/03/hello-views-i.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUANQ3kzeip7ImA9WxBUFUk.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-7604589650884872050</id><published>2010-02-28T02:12:00.002+01:00</published><updated>2010-03-02T16:29:52.782+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-02T16:29:52.782+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="HelloWorld" /><category scheme="http://www.blogger.com/atom/ns#" term="Android Fundamentals" /><category scheme="http://www.blogger.com/atom/ns#" term="layout" /><category scheme="http://www.blogger.com/atom/ns#" term="XML" /><category scheme="http://www.blogger.com/atom/ns#" term="ADV" /><category scheme="http://www.blogger.com/atom/ns#" term="strings.xml" /><category scheme="http://www.blogger.com/atom/ns#" term="main.out.xml" /><title>Hello World / Hello Android</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CGFnQTpQuHq32sDyfghZn8wXwhg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CGFnQTpQuHq32sDyfghZn8wXwhg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CGFnQTpQuHq32sDyfghZn8wXwhg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CGFnQTpQuHq32sDyfghZn8wXwhg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Una vez tenemos el entorno preparado vamos hacer nuestro primer proyecto. Siguiendo como guía Android Labs, nos recomiendan hacer el típico &lt;a href="http://developer.android.com/resources/tutorials/hello-world.html"&gt;HelloWorld&lt;/a&gt;.&lt;br /&gt;
Los pasos que nos indican son los siguientes:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Crear el AVD, que ya hicimos en el último paso del post anterior.&lt;/li&gt;
&lt;li&gt;Crear el projecto en Eclipse.&lt;/li&gt;
&lt;li&gt;Construir la Interfaz de Usuario dentro de la clase.&lt;/li&gt;
&lt;li&gt;Ejecutar la aplicación.&lt;/li&gt;
&lt;/ol&gt;Esta manera de crear la interfaz de usuario dentro del código se llama programática. Puede ser útil para interfaces sencillas, y también se puede utilizar para crear algún elemento de manera dinámica. Pero esta forma es difícil de mantener, y por ello Android ofrece la posibilidad de crear las IU a partir de &lt;i&gt;layouts &lt;/i&gt;en ficheros XML. Por ejemplo:&lt;br /&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:text="@string/hello"/&amp;gt;&lt;/pre&gt;&lt;/i&gt;&lt;br /&gt;
¿Dónde ubicamos estos ficheros XML? Primero vamos a ver la estructura de directorio:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_C574F3Iy4U0/S4my3A1FyQI/AAAAAAAAAAc/SZlik5lWKAg/s1600-h/dir_project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S4my3A1FyQI/AAAAAAAAAAc/SZlik5lWKAg/s320/dir_project.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;src/&lt;/i&gt;: código de nuestras clases&lt;/li&gt;
&lt;li&gt;&lt;i&gt;gen/&lt;/i&gt;: código generado&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;i&gt;assets/&lt;/i&gt;: desconozco!&lt;/li&gt;
&lt;li&gt;&lt;i&gt;res/drawable/&lt;/i&gt;: imágenes&lt;/li&gt;
&lt;li&gt;&lt;i&gt;res/layout/&lt;/i&gt;: layouts para nuestra IU&lt;/li&gt;
&lt;li&gt;&lt;i&gt;res/value/&lt;/i&gt;: textos&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;Para más detalles, recomiendo mirar&amp;nbsp;&lt;a href="http://developer.android.com/guide/topics/fundamentals.html"&gt;Application Fundamentals&lt;/a&gt;. En los próximos post intentaré explicar de manera sencilla el contenido de esta página.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;Ya hemos acabado con nuestro HelloWorld!! Si ejecutamos veremos que los resultados son iguales, tanto creando la IU programáticamente como con &lt;i&gt;layouts&lt;/i&gt;.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;b&gt;&lt;i&gt;Problemas&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;La guía de Android Labs es bastante sencilla de seguir, pero durante la realización me encontré con un problema. Después de estar jugando con los ficheros, me daba el siguiente error:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;i&gt;main.out.xml already defined&lt;/i&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;Después de googlear un rato no supe cuál era el motivo, pero lo solucioné eliminando el archivo &lt;i&gt;main.out.xml&lt;/i&gt;&amp;nbsp;a mano.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-7604589650884872050?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/VPxMxfN1jv4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/7604589650884872050/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/02/hello-world-hello-android.html#comment-form" title="1 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7604589650884872050?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/7604589650884872050?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/VPxMxfN1jv4/hello-world-hello-android.html" title="Hello World / Hello Android" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_C574F3Iy4U0/S4my3A1FyQI/AAAAAAAAAAc/SZlik5lWKAg/s72-c/dir_project.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/02/hello-world-hello-android.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8ERHY4cSp7ImA9WxBUFUk.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-4207939489528442873</id><published>2010-02-26T00:51:00.005+01:00</published><updated>2010-03-02T16:30:05.839+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-02T16:30:05.839+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer Labs" /><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="ADV" /><category scheme="http://www.blogger.com/atom/ns#" term="ADT" /><category scheme="http://www.blogger.com/atom/ns#" term="SDK" /><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu" /><title>Preparando el entorno</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2IHXAucvgfV0vpAsqIk0ourYuWE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2IHXAucvgfV0vpAsqIk0ourYuWE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2IHXAucvgfV0vpAsqIk0ourYuWE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2IHXAucvgfV0vpAsqIk0ourYuWE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Para guiarme durante la instalación del entorno he seguido los pasos de la página oficial de &lt;a href="http://developer.android.com/sdk/eclipse-adt.html"&gt;Android Developers&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://developer.android.com/"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_C574F3Iy4U0/S4fklVfmThI/AAAAAAAAAAU/83HoxGHHE34/s320/Android_Dev_Lab_l.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;Lo primero que tenemos que hacer es descargarnos un IDE y el SDK de Android. Yo utilizaré Eclipse para Linux (Ubuntu 9.10).&lt;br /&gt;
Instalamos la última versión de &lt;a href="http://www.eclipse.org/downloads/"&gt;Eclipse&lt;/a&gt;, en mi caso es la versión Galileo. Después descargamos la última versión del &lt;a href="http://developer.android.com/sdk/index.html"&gt;SDK&lt;/a&gt; de Android, ahora es la versión 2.1.&lt;br /&gt;
&lt;div&gt;Ahora que ya tenemos las dos cosas básicas, vamos a preparar el entorno. Seguimos la &lt;a href="http://developer.android.com/sdk/eclipse-adt.html"&gt;página&lt;/a&gt; de guía y seguimos los pasos, que en resumen son:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Instalar el plugin ADT (Android Development Tools)&lt;/li&gt;
&lt;li&gt;Indicamos el lugar donde tenemos descargado el SDK de Android&lt;/li&gt;
&lt;li&gt;Poner en las variables de entorno el lugar donde tenemos el directorio &lt;i&gt;tools&lt;/i&gt; del SDK. Para cada sistema operativo es diferente, en Linux se ha de modificar el fichero &lt;i&gt;./bashrc&lt;/i&gt; o &lt;i&gt;./bash_profile&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Por último tenemos que crear el &lt;a href="http://developer.android.com/guide/developing/tools/avd.html"&gt;AVD&lt;/a&gt; (Android Virtual Device), es decir, el emulador. En Linux lo creamos desde la consola con el comando &lt;i&gt;android create avd&lt;/i&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;b&gt;&lt;i&gt;Problemas&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Una vez instalado Eclipse para Linux, al menos con las versiones que trabajo, existe un bug que hace no funcionar correctamente los botones. Para solucionarlo me he creado el siguiente script para lanzar el Eclipse:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;#!/bin/sh&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;export GDK_NATIVE_WINDOWS=true&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;/directorio_eclipse/eclipse&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-4207939489528442873?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/FIEo17G4L7Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/4207939489528442873/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/02/preparando-el-entorno.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/4207939489528442873?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/4207939489528442873?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/FIEo17G4L7Q/preparando-el-entorno.html" title="Preparando el entorno" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_C574F3Iy4U0/S4fklVfmThI/AAAAAAAAAAU/83HoxGHHE34/s72-c/Android_Dev_Lab_l.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/02/preparando-el-entorno.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4NRH8_fip7ImA9WxBUEUQ.&quot;"><id>tag:blogger.com,1999:blog-4632909914431127163.post-8374962336612739811</id><published>2010-02-26T00:35:00.005+01:00</published><updated>2010-02-26T16:09:55.146+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-26T16:09:55.146+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mobile World Congress" /><category scheme="http://www.blogger.com/atom/ns#" term="Nexus One" /><title>Inicio</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Rc-cewwsKVHo4xwoHjsooQeE8a0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Rc-cewwsKVHo4xwoHjsooQeE8a0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Rc-cewwsKVHo4xwoHjsooQeE8a0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Rc-cewwsKVHo4xwoHjsooQeE8a0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Después de mucho tiempo con la intención de ponerme en serio a aprender Android, Google me ha ayudado a lanzarme. &lt;br /&gt;
&lt;div&gt;Hace una semana asistí por primera vez a una Technical Session de Android Labs, durante el &lt;a href="http://www.mobileworldcongress.com/"&gt;Mobile World Congress 2010 de Barcelona&lt;/a&gt;. Al acabar la primera sesión, Introduction to Android Development (101), nos dieron a elegir a todos los asistentes entre un &lt;a href="http://www.google.com/phone/?locale=en_US&amp;amp;s7e="&gt;Google Nexus One&lt;/a&gt; o un &lt;a href="http://www.motorola.com/Consumers/US-EN/Consumer-Product-and-Services/Mobile-Phones/Motorola-DROID-US-EN"&gt;Motorola Droid&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;Yo escogí el Nexus One, y en un par de días tenía instalado ya el SDK!!!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_C574F3Iy4U0/S4fkJJfo5xI/AAAAAAAAAAM/xSLKVP_Z9Rg/s1600-h/regalito.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_C574F3Iy4U0/S4fkJJfo5xI/AAAAAAAAAAM/xSLKVP_Z9Rg/s320/regalito.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4632909914431127163-8374962336612739811?l=desbc.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlogDeSbc/~4/oEKaV91h8GA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://desbc.blogspot.com/feeds/8374962336612739811/comments/default" title="Enviar comentarios" /><link rel="replies" type="text/html" href="http://desbc.blogspot.com/2010/02/inicio.html#comment-form" title="0 comentarios" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/8374962336612739811?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4632909914431127163/posts/default/8374962336612739811?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlogDeSbc/~3/oEKaV91h8GA/inicio.html" title="Inicio" /><author><name>SBC</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_C574F3Iy4U0/S4fkJJfo5xI/AAAAAAAAAAM/xSLKVP_Z9Rg/s72-c/regalito.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://desbc.blogspot.com/2010/02/inicio.html</feedburner:origLink></entry></feed>

