<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7565626106349277982</id><updated>2024-09-14T17:57:26.340+02:00</updated><category term="Android"/><category term="Intent"/><category term="AndroidManifest"/><category term="Filter"/><category term="Intent Filter"/><category term="Tips"/><category term="intent esplicita"/><category term="onclick"/><title type='text'>Tech Queue</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://techqueue.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://techqueue.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Danilo Del Fio</name><uri>http://www.blogger.com/profile/14672910983257318556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFQQVHgZ8SpdwPpHJ_MHjUHie-6H44e1lb6yeOtVzunAk6X_XPyz2hZOK_jnjh9mVhTqol6-UczCI6UOPQC-bpc3ge17q_sH93t0Z6wItStGbqgcC_L6NoqUmbNDRjg/s220/2010-11-04-103120.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7565626106349277982.post-6383661266409574746</id><published>2012-09-20T16:10:00.005+02:00</published><updated>2012-09-20T16:11:59.539+02:00</updated><title type='text'>NodeJs REPL</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;Quando approcciamo ad una nuova tecnologia una delle cose fondamentali è la possibilità che abbiamo per poterne testare le potenzialità e sentirsi subito &quot;attivi&quot;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;NodeJS, oltre ad essere una potentissima piattaforma Server Side per la costruzione di sevizi, fornisce uno ambiente di runtime come Perl, Pyton e Ruby, per poter eseguire e testare le nostre applicazioni.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;b&gt;REPL &lt;/b&gt;(Read-Eval-Print-Loop), così viene chiamato l&#39;ambiente interattivo di cui sopra, permette quindi il testing delle nostre applicazioni, ma non solo, perché essendo NodeJS un wrapper dell&#39;engine V8, permette di testare anche programmi scritti in Javascript.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: 16px;&quot;&gt;Per poter testare le nostre applicazioni, oltre a scrivere dei semplici comandi possiamo testare delle funzioni javascript che andranno a popolare le pagine web delle nostre applicazioni, oppure, semplicemente testare i nostri programmi scritti con nodeJS semplicemente richiamando il nome del file creato dopo l&#39;istruzione &lt;/span&gt;&lt;b style=&quot;font-family: inherit; font-size: 16px;&quot;&gt;&lt;i&gt;node&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-family: inherit; font-size: 16px;&quot;&gt;. Per esempio se inseriamo il codice scritto di seguito in un file chiamato &lt;/span&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;u&gt;&lt;b&gt;inizializzaMySQL.js&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: 16px;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot; style=&quot;background-color: #eeeeee; color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;var mysql = require(&#39;mysql&#39;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &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&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;var TEST_DATABASE = &#39;techqueue_mysql_test&#39;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;var TEST_TABLE = &#39;nodejs_test&#39;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;var client = mysql.createClient({&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; user: &#39;root&#39;,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; password: &#39;root&#39;,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;client.query(&#39;CREATE DATABASE &#39;+TEST_DATABASE, function(err) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; if (err &amp;amp;&amp;amp; err.number != mysql.ERROR_DB_CREATE_EXISTS) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; throw err;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;client.query(&#39;USE &#39;+TEST_DATABASE);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;client.query(&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;CREATE TABLE &#39;+TEST_TABLE+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;(id INT(11) AUTO_INCREMENT, &#39;+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;title VARCHAR(255), &#39;+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;text TEXT, &#39;+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;created DATETIME, &#39;+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;PRIMARY KEY (id))&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;client.query(&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;INSERT INTO &#39;+TEST_TABLE+&#39; &#39;+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;SET title = ?, text = ?, created = ?&#39;,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; [&#39;prova titolo 1&#39;, &#39;Testo di prova di nodejs&#39;, &#39;20/09/2012 15:00:00&#39;]&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;var query = client.query(&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;INSERT INTO &#39;+TEST_TABLE+&#39; &#39;+&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;SET title = ?, text = ?, created = ?&#39;,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; [&#39;secondo titolo&#39;, &#39;Testo nel secondo record&#39;, &#39;
20/09/2012 16:00:00&amp;nbsp;&#39;]&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;client.query(&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &#39;SELECT * FROM &#39;+TEST_TABLE,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; function selectCb(err, results, fields) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; if (err) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; throw err;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; console.log(results);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; console.log(fields);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; client.end();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;Possiamo eseguirlo e testarlo (ovviamente avendo preventivamente installato mysql server e configurato opportunamente lo script), scrivendo semplicemente:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;hps&quot; style=&quot;background-color: #cccccc; color: #333333; font-size: 16px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;gt; node inizializzaMySQL.js&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;Da sottolineare il fatto che nella prima istruzione gestiamo l&#39;importazione del modulo &#39;mysql&#39; per poter utilizzare le sue funzioni.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;In nodejs per poter utilizzare le librerie che non sono comprese nel core, bisogna importarle nel sistema utilizzando un &quot;gestore di pacchetti&quot;, denominato npm. Quindi, se vogliamo installare il modulo per gestire il dbms mysql, dovremmo scrivere:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-family: Courier New, Courier, monospace; font-size: 16px;&quot;&gt;&lt;b style=&quot;background-color: #cccccc;&quot;&gt;&amp;gt; npm install mysql&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;Quindi non ci resta che installare e provare le nostre funzioni.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;Buon lavoro&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://techqueue.blogspot.com/feeds/6383661266409574746/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://techqueue.blogspot.com/2012/09/nodejs-repl.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/6383661266409574746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/6383661266409574746'/><link rel='alternate' type='text/html' href='http://techqueue.blogspot.com/2012/09/nodejs-repl.html' title='NodeJs REPL'/><author><name>Danilo Del Fio</name><uri>http://www.blogger.com/profile/14672910983257318556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFQQVHgZ8SpdwPpHJ_MHjUHie-6H44e1lb6yeOtVzunAk6X_XPyz2hZOK_jnjh9mVhTqol6-UczCI6UOPQC-bpc3ge17q_sH93t0Z6wItStGbqgcC_L6NoqUmbNDRjg/s220/2010-11-04-103120.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7565626106349277982.post-3618746631222917410</id><published>2012-05-29T09:54:00.002+02:00</published><updated>2012-05-29T10:16:15.817+02:00</updated><title type='text'>Step into NodeJS</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
NodeJS è un modo di eseguire JavaScript al di fuori del browser web. Esso è un wrapper ad alte prestazioni per il runtime JavaScript di Google Chrome &lt;a href=&quot;http://code.google.com/p/v8/&quot;&gt;V8&lt;/a&gt; (Javascript engine scritta in C++ che permette l&#39;esecuzione di codice JS in modalità stadalone o embedded in un&#39;applicazione C++).&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
NodeJS permette la gestione dell&#39;engine V8 per permettergli di lavorare meglio in contesti diversi dal browser, per lo più da fornendo API aggiuntive che sono ottimizzate per specifici casi d&#39;uso.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
V8 utilizza alcune delle tecniche più innovative nella tecnologia del compilatore. Ciò consente spesso di poter scrivere codice in un linguaggio di alto livello come ad esempio JavaScript ed avere comportamenti paragonabili a codice scritto in un linguaggio di basso livello come C, &lt;b&gt;&lt;i&gt;con una frazione del costo di sviluppo&lt;/i&gt;&lt;/b&gt;. Questa focalizzazione sulle prestazioni è un aspetto fondamentale di NodeJS.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Javascript&amp;nbsp;(dai veri cultori del codice, spesso bistrattato), è un linguaggio &lt;i&gt;event-driven&lt;/i&gt; e NodeJS utilizza questo a suo vantaggio per la produzione di server altamente scalabili. Utilizzando un&#39;architettura chiamata &lt;i&gt;&lt;b&gt;events-loop&lt;/b&gt;&lt;/i&gt;, rende la programmazione server altamente scalabile facile e sicura.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Una caratteristica molto importante di NodeJS è la riduzione drastica della complessità per lo sviluppatore pur essendo molto potente e performante. Riusciamo, infatti, a raggiungere prestazioni impressionanti senza molta fatica.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Per supportare l&#39;approccio events-loop (nella programmazione ad eventi&amp;nbsp;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;il flusso del programma è determinato soprattutto dal verificarsi di eventi esterni),&lt;/span&gt;&amp;nbsp;&lt;/span&gt;NodeJS fornisce una serie di librerie &quot;non bloccanti&quot;.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In sostanza, si tratta di interfacce di tipo event-driven per risorse come il file system o un database. Quando si effettua una richiesta al filesystem, &lt;i&gt;&lt;b&gt;NodeJS anziché aspettare il disco rigido che recuperi il file, l&#39;interfaccia non-blocking, semplicemente notifica quando ha accesso alla risorsa, nello stesso modo in cui si comporta un browser web, per esempio, all&#39;evento onclick.&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
L&#39;installazione è estremamente semplice, Node gira su Windows, Linux, Mac e altri sistemi operativi POSIX (come Solaris e BSD). NodeJS si può scaricare dal &lt;a href=&quot;http://www.nodejs.org/&quot;&gt;sito&lt;/a&gt;&amp;nbsp;del progetto o il &lt;a href=&quot;https://github.com/joyent/node&quot;&gt;repository&lt;/a&gt; GitHub.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Colleghiamoci al sito scelto e scarichiamo l&#39;ultima release. Prendiamo come esempio il download della versione tar.gz&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;tar xzf node-v0.6.6.tar.gz&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;La x sta per estrai (piuttosto che comprimere), z dice a tar di decomprimere utilizzando l&#39;algoritmo&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&amp;nbsp; di &lt;/i&gt;&lt;i&gt;GZIP, e f indica che stiamo scompattato il file indicato come argomento finale.&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Il passo successivo consiste nel configurare il codice per il sistema.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
NodeJS utilizza il sistema &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;configure/make&lt;/span&gt;. Lo script di configurazione, ispezionando il sistema, trova i percorsi necessari per gestire le dipendenze di cui ha bisogno.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;./configure&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Il successivo passo di installazione è quello di fare il make del progetto. Questo compila nodo e costruisce la versione binaria che verrà utilizzato in una costruzione sottodirectory della directory dei sorgenti che abbiamo usato&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;make&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Il passo finale è quello di installare NodeJS. Se vogliamo installarlo come superuser, l&#39;istruzione da eseguire è la seguente:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;gt; &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;sudo make install&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
Nei prossimi post approfondiremo vari aspetti e usi di questo splendido e innovativo modo di scrivere software di qualità con un occhio alle performance...&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techqueue.blogspot.com/feeds/3618746631222917410/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://techqueue.blogspot.com/2012/05/step-into-nodejs.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/3618746631222917410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/3618746631222917410'/><link rel='alternate' type='text/html' href='http://techqueue.blogspot.com/2012/05/step-into-nodejs.html' title='Step into NodeJS'/><author><name>Danilo Del Fio</name><uri>http://www.blogger.com/profile/14672910983257318556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFQQVHgZ8SpdwPpHJ_MHjUHie-6H44e1lb6yeOtVzunAk6X_XPyz2hZOK_jnjh9mVhTqol6-UczCI6UOPQC-bpc3ge17q_sH93t0Z6wItStGbqgcC_L6NoqUmbNDRjg/s220/2010-11-04-103120.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7565626106349277982.post-369299360613201273</id><published>2011-02-09T09:38:00.000+01:00</published><updated>2011-02-09T09:38:32.956+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Intent"/><category scheme="http://www.blogger.com/atom/ns#" term="intent esplicita"/><category scheme="http://www.blogger.com/atom/ns#" term="onclick"/><title type='text'>Android Base: Un esempio di Intent Esplicito.</title><content type='html'>&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;In un’Intent Esplicito specifichiamo l’Activity target invocandola direttamente. Tale gestione è utile nel caso si vogliano gestire messaggi all’interno delle proprie applicazioni.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;A differenza delle Intent Implicite in cui dichiariamo il tipo di Intent che vogliamo sia gestita e deleghiamo alla piattafroma Android il compito di trovare l’Activity in grado di operare sui dati di cui abbiamo bisogno, ora definiamo a tempo di compilazione chi sarà ad “occuparsi dei nostri dati”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Chiarirò tutto con un semplice esempio.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Supponiamo di avere due Activity:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol; font-size: 12.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;InvokeActivity&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol; font-size: 12.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;InvokedActivity&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Che, ovviamente, rappresentano l’Activity chiamante e quella chiamata.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Partiamo dalla definizione della nostra applicazione col seguente &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;AndroidManifest.xml&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt; :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;?xml   version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;manifest   xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;package=&quot;it.delfio.android.activity.intents&quot;   android:versionCode=&quot;1&quot; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;android:versionName=&quot;1.0&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;application   android:icon=&quot;@drawable/icon&quot;   android:label=&quot;@string/app_name&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;activity   android:name=&quot;.InvokeActivity&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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&gt;android:label=&quot;@string/app_name&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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&gt;&amp;lt;intent-filter&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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; &lt;/span&gt;&amp;lt;action   android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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; &lt;/span&gt;&amp;lt;category   android:name=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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&gt;&amp;lt;/intent-filter&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/activity&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;activity   android:name=&quot;.InvokedActivity&quot;   android:label=&quot;@string/app_name&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;/activity&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/application&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;uses-sdk   android:minSdkVersion=&quot;3&quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;L’InvokeActivity contiene un bottone “Invoca Activity” (da inserire nel file xml di layout: main.xml) che, una volta cliccato, permette di invocare l’Activity target.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;?xml   version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;LinearLayout   xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;android:orientation=&quot;vertical&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &lt;/span&gt;android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;TextView&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &lt;/span&gt;android:layout_width=&quot;fill_parent&quot;   android:layout_height=&quot;wrap_content&quot; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &lt;/span&gt;android:text=&quot;@string/testoInvokeActivity&quot; android:layout_weight=&quot;1&quot;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;Button   android:text=&quot;@string/invokeButtonText&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;android:id=&quot;@+id/invokeButton&quot;   android:layout_gravity=&quot;center_horizontal&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;android:layout_width=&quot;wrap_content&quot;   android:layout_height=&quot;wrap_content&quot;/&amp;gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Di seguito il codice dell’InvokeActivity con in evidenza la gestione dell’evento onClick lanciato alla pressione del bottone con id &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;invokeButton&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;package it.delfio.android.activity.intents;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import android.app.Activity;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import android.content.Intent;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import android.os.Bundle;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import android.view.View;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;public class InvokeActivity extends Activity {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;@Override&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;public void onCreate(Bundle   savedInstanceState) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;super.onCreate(savedInstanceState);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;setContentView(R.layout.main);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Button invokeButton =   (Button)findViewById(R.id.invokebutton);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;invokeButton.setOnClickListener(new   OnClickListener() {&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;public   void onClick(View v) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Intent explicitIntent = new Intent(InvokeActivity.this,InvokedActivity.class);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;startActivity(explicitIntent);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Recuperiamo il pulsante che permetterà di lanciare il nostro Intent attraverso l’istruzione:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;(Button)findViewById(R.id.invokebutton)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Di seguito, attraverso il costruttore :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;Intent(InvokeActivity.this,InvokedActivity.class)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Possiamo specificare l’Activity sorgente e quella destinazione della chiamata, che verrà fatta sempre attraverso la chiamata:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;startActivity(explicitIntent);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Definiamo nel file &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt;&quot;&gt;/res/values/string.xml&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt; tutte le stringhe che utilizzaremo nell’applicazione:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;?xml   version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;resources&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;string   name=&quot;testoInvokeActivity&quot;&amp;gt;Activity che lancia una Intent   Esplicita&amp;lt;/string&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;string   name=&quot;app_name&quot;&amp;gt;Prova Intent Esplicita&amp;lt;/string&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;string   name=&quot;invokeButtonText&quot;&amp;gt;Invoca Activity&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/string&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;string   name=&quot;testoInvokedActivity&quot;&amp;gt;Activity chiamata esplicitamente.   Non abbiamo configurato nessun Intent Filter, quindi per invocare la seconda   Activity bisogna chiamarla esplicitamente.&amp;lt;/string&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;/resources&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Alla pressione del bottone, come accennato in precedenza viene lanciata l’Intent a cui risponderà la nostra seconda InvokedActivity, il cui layout è definito dal file:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;?xml   version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;LinearLayout   xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;android:orientation=&quot;vertical&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &lt;/span&gt;android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;TextView   android:text=&quot;@string/testoInvokedActivity&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &lt;/span&gt;android:layout_width=&quot;fill_parent&quot;   android:layout_height=&quot;wrap_content&quot; &amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/TextView&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Che contiene un unico campo testo da visualizzare appena viene invocata e visualizzata attraverso il semplice codice:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;package it.delfio.android.activity.intents;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import android.app.Activity;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import android.content.Intent;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import android.os.Bundle;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;import android.view.View;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;public class InvokedActivity extends Activity {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;@Override&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;public   void onCreate(Bundle savedInstanceState) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;super.onCreate(savedInstanceState);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;setContentView(R.layout.invokedactivity);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8.0pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;   &lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Infine, provando a lanciare la nostra semplice applicazione sull’emulatore, dovremmo ottenere:&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-language: IT; mso-no-proof: yes;&quot;&gt;&lt;v:shapetype coordsize=&quot;21600,21600&quot; filled=&quot;f&quot; id=&quot;_x0000_t75&quot; o:preferrelative=&quot;t&quot; o:spt=&quot;75&quot; path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; stroked=&quot;f&quot;&gt;  &lt;v:stroke joinstyle=&quot;miter&quot;&gt;  &lt;v:formulas&gt;   &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;&gt;   &lt;v:f eqn=&quot;sum @0 1 0&quot;&gt;   &lt;v:f eqn=&quot;sum 0 0 @1&quot;&gt;   &lt;v:f eqn=&quot;prod @2 1 2&quot;&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;&gt;   &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;&gt;   &lt;v:f eqn=&quot;sum @0 0 1&quot;&gt;   &lt;v:f eqn=&quot;prod @6 1 2&quot;&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;&gt;   &lt;v:f eqn=&quot;sum @8 21600 0&quot;&gt;   &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;&gt;   &lt;v:f eqn=&quot;sum @10 21600 0&quot;&gt;  &lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;  &lt;v:path gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot; o:extrusionok=&quot;f&quot;&gt;  &lt;o:lock aspectratio=&quot;t&quot; v:ext=&quot;edit&quot;&gt; &lt;/o:lock&gt;&lt;/v:path&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;v:shape alt=&quot;ActivityInvoke.jpg&quot; id=&quot;Immagine_x0020_0&quot; o:spid=&quot;_x0000_i1026&quot; style=&quot;height: 278.25pt; mso-wrap-style: square; visibility: visible; width: 186.75pt;&quot; type=&quot;#_x0000_t75&quot;&gt;  &lt;v:imagedata o:title=&quot;ActivityInvoke&quot; src=&quot;file:///C:\users\danilo\Temp\msohtmlclip1\01\clip_image001.jpg&quot;&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;v:shape alt=&quot;ActivityInvoked.jpg&quot; id=&quot;Immagine_x0020_1&quot; o:spid=&quot;_x0000_i1025&quot; style=&quot;height: 278.25pt; mso-wrap-style: square; visibility: visible; width: 186.75pt;&quot; type=&quot;#_x0000_t75&quot;&gt;  &lt;v:imagedata o:title=&quot;ActivityInvoked&quot; src=&quot;file:///C:\users\danilo\Temp\msohtmlclip1\01\clip_image002.jpg&quot;&gt; &lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6mRTcgDTwAWVCYSAPnhX9enr6tl1PYWCK-Ege-7Ah7qh7i9Piy3YeBYSZuf_UvvRHNvLxI6hHNWlf8guX8ExAgvy0Jqn0slXZqSGmEBV_zo7-Vjm22YKgz6zkKLBFgal5wC7OGAn1GRwi/s1600/ActivityInvoke.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6mRTcgDTwAWVCYSAPnhX9enr6tl1PYWCK-Ege-7Ah7qh7i9Piy3YeBYSZuf_UvvRHNvLxI6hHNWlf8guX8ExAgvy0Jqn0slXZqSGmEBV_zo7-Vjm22YKgz6zkKLBFgal5wC7OGAn1GRwi/s320/ActivityInvoke.jpg&quot; width=&quot;214&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6qohzn51z4oAS8esZfXkwcFsiEN7C4URDNv5rHh2mnvwbeD9uoa8L-IACbEVKASdbjmSSAg_j-vtavToPvc3Tb9W4T4ebM5sxnWU_inYbwwAzb-y1wabxEt-dsxMMDowmqKWRM-6_kJUm/s1600/ActivityInvoked.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6qohzn51z4oAS8esZfXkwcFsiEN7C4URDNv5rHh2mnvwbeD9uoa8L-IACbEVKASdbjmSSAg_j-vtavToPvc3Tb9W4T4ebM5sxnWU_inYbwwAzb-y1wabxEt-dsxMMDowmqKWRM-6_kJUm/s320/ActivityInvoked.jpg&quot; width=&quot;214&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techqueue.blogspot.com/feeds/369299360613201273/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://techqueue.blogspot.com/2011/02/android-base-un-esempio-di-intent.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/369299360613201273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/369299360613201273'/><link rel='alternate' type='text/html' href='http://techqueue.blogspot.com/2011/02/android-base-un-esempio-di-intent.html' title='Android Base: Un esempio di Intent Esplicito.'/><author><name>Danilo Del Fio</name><uri>http://www.blogger.com/profile/14672910983257318556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFQQVHgZ8SpdwPpHJ_MHjUHie-6H44e1lb6yeOtVzunAk6X_XPyz2hZOK_jnjh9mVhTqol6-UczCI6UOPQC-bpc3ge17q_sH93t0Z6wItStGbqgcC_L6NoqUmbNDRjg/s220/2010-11-04-103120.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6mRTcgDTwAWVCYSAPnhX9enr6tl1PYWCK-Ege-7Ah7qh7i9Piy3YeBYSZuf_UvvRHNvLxI6hHNWlf8guX8ExAgvy0Jqn0slXZqSGmEBV_zo7-Vjm22YKgz6zkKLBFgal5wC7OGAn1GRwi/s72-c/ActivityInvoke.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7565626106349277982.post-5554553667741064571</id><published>2011-02-03T10:03:00.003+01:00</published><updated>2011-02-03T13:19:29.158+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="AndroidManifest"/><category scheme="http://www.blogger.com/atom/ns#" term="Intent"/><category scheme="http://www.blogger.com/atom/ns#" term="Intent Filter"/><title type='text'>Android Base: Intent e Intent Filter. Un esempio di Intent Implicito.</title><content type='html'>&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Nel precedente Post ho parlato di Intent e di Intent Filter, senza specificare di cosa si trattasse.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Gli Intent sono dei messaggi asincroni che permettono alle varie Activity di inviare o ricevere dati da e verso altre Activity o Servizi.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Per esempio un&#39;applicazione può fare richiesta, attraverso un&#39;intent, di informazioni relative ad un contatto, mentre un Intent Filter mi permette di registrarmi su un determinato tipo di dato (praticamente dico che posso gestire un certo tipo di dati).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Ci sono due tipi di Intent:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 16px;&quot;&gt;Impliciti&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 16px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 16px;&quot;&gt;Espliciti&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Gli Intent Espliciti chiamano direttamente il componente di cui hanno bisogno (per esempio una classe Java), mentre gli Intent impliciti chiedono al sistema do eseguire un servizio (per esempio aprire un Browser).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Quando selezioniamo un dato in un&#39;applicazione e richiediamo un certo servizio Android determinerà le applicazioni adatte a gestirlo e proporrà&amp;nbsp; all&#39;utente una scelta. La determinazione di quali applicazioni presentare nella scelta é basata sugli Intent Filter, rappresentati dalla classe &quot;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;android.content.IntentFilter&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&quot;. Gli Intent Filter sono in genere definiti tramite l&#39;AndroidManifest.xml. Un componente utilizza gli Intent Filter per definire quali Intent sia in grado di gestire, se non viene configurato nessun Intent Filter, significa che possiamo chiamare il componente solo in modo esplicito.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Per chiarire meglio la differenza tra i due tipi di Intent, facciamo degli esempi.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #c00000; font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Intent Implicito&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Supponiamo che voglia aprire un URL e vogliamo fare in modo che il sistema inserisca tra le scelte possibili per gestirlo, la nostra Activity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Creaiamo, a tale scopo, il package &lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;it.delfio.android.activity.intents&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt; con l’Activity &lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ImplicitManager&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;. Partendo dalla definizione di un view Layout:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-left: 5,4pt; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;?xml   version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;LinearLayout   xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:orientation=&quot;vertical&quot;   android:layout_width=&quot;fill_parent&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;   android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;Button   android:id=&quot;@+id/Bottone1&quot; android:layout_width=&quot;wrap_content&quot;   android:layout_height=&quot;wrap_content&quot; android:text=&quot;Call   browser&quot;&amp;nbsp; android:onClick=&quot;IntentManager&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Per poter utilizzare alcuni tipi di Intent bisogna configurarli sul file manifest della nostra applicazione. Dobbiamo, quindi, avere:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 16px;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-left: 5,4pt; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot;   encoding=&quot;utf-8&quot;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;manifest   xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   package=&quot;it.delfio.android.intents&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   android:versionCode=&quot;1&quot;   android:versionName=&quot;1.0&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &amp;lt;application android:icon=&quot;@drawable/icon&quot;   android:label=&quot;@string/app_name&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &amp;lt;activity android:name=&quot;.IntentsManager&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&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:label=&quot;@string/app_name&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&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;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&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;action android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&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;category android:name=&quot;android.intent.category.LAUNCHER&quot;   /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&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;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &amp;lt;/activity&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &amp;lt;/application&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &amp;lt;uses-sdk android:minSdkVersion=&quot;9&quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;uses-permission   android:name=&quot;android.permission.INTERNET&quot;&amp;gt;&amp;lt;/uses-permission&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 16px;&quot;&gt;La nostra Activity che gestirà la chiamata alla Intent sarà:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f2f2f2; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-left: 5,4pt; width: 614px;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;package it.delfio.android.activity.intents;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;import android.app.Activity;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;import android.content.Intent;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;import android.net.Uri;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;import android.os.Bundle;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;import android.view.View;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;import android.widget.Toast;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;public class ImplicitManager extends Activity {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**   Called when the activity is first created. */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public   void onCreate(Bundle savedInstanceState) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&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; super.onCreate(savedInstanceState);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&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; setContentView(R.layout.main);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public   void callIntent(View view) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; Intent intent = null;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; if (R.id.Bottone1==view.getId()) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;intent   = new Intent(Intent.ACTION_VIEW,Uri.parse(&quot;http://www.google.it&quot;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; startActivity(intent);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;startActivityForResult(intent, -1);&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public   void onActivityResult(int requestCode, int resultCode, Intent data) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; if (resultCode == Activity.RESULT_OK   &amp;amp;&amp;amp; requestCode == 0) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String result = data.toURI();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, result,   Toast.LENGTH_LONG);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 8pt;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;   &lt;td style=&quot;padding: 0cm 5.4pt 0cm 5.4pt; width: 460.7pt;&quot; valign=&quot;top&quot; width=&quot;614&quot;&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Ho inserito nella mia Activity un metodo che permette di gestire gli eventuali dati di ritorno provenienti dalla Activity che ha gestito l’Intent (per esempio nel caso della scelta di un nominativo dalla rubrica). In questo caso avrei dovuto lanciare l’Intent tramite il comando:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&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&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;startActivityForResult(intent, 0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Il secondo parametro rappresenta il request code. Far partire una Activity con un valore negativo di questo parametro equivale a lanciare il metodo &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;startActivity(intent)&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;. &amp;nbsp;Da notare che per Intent come &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;Intent.ACTION_VIEW&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;Intent.ACTION_MAIN&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt; e altre (che non prevedono un valore di ritorno), non ha senso chiamare l’activity con tale metodo che, tra l’altro, potrebbe ritornare un valore non atteso. Per esempio, nel caso di lancio di una Activity che prevede l’avvio sullo stesso thread del chiamante, otterremo come risposta un risultato di &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 12pt;&quot;&gt;CANCEL&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot; style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;Nel prossimo articolo parlerò delle Intent Esplicite che meritano un Post a parte.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techqueue.blogspot.com/feeds/5554553667741064571/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://techqueue.blogspot.com/2011/02/nel-precedente-post-ho-parlato-di.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/5554553667741064571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/5554553667741064571'/><link rel='alternate' type='text/html' href='http://techqueue.blogspot.com/2011/02/nel-precedente-post-ho-parlato-di.html' title='Android Base: Intent e Intent Filter. Un esempio di Intent Implicito.'/><author><name>Danilo Del Fio</name><uri>http://www.blogger.com/profile/14672910983257318556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFQQVHgZ8SpdwPpHJ_MHjUHie-6H44e1lb6yeOtVzunAk6X_XPyz2hZOK_jnjh9mVhTqol6-UczCI6UOPQC-bpc3ge17q_sH93t0Z6wItStGbqgcC_L6NoqUmbNDRjg/s220/2010-11-04-103120.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7565626106349277982.post-102853843363719372</id><published>2011-01-31T10:38:00.001+01:00</published><updated>2011-02-01T22:09:56.340+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="AndroidManifest"/><category scheme="http://www.blogger.com/atom/ns#" term="Filter"/><category scheme="http://www.blogger.com/atom/ns#" term="Intent"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>Categorizzare un Intent Filter</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Cominciamo qui una serie di Tips per chi desidera sviluppare applicazioni mobile su piattaforma Android.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Come ben sappiamo, la piattaforma Android è una piattaforma &quot;aperta&quot;. Una conseguenza di questo è che le nostre applicazioni girano con gli stessi privilegi delle applicazioni native.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;E&#39; possibile, quindi, fare in modo che una nostra applicazione venga utilizzata al posto della Home nativa (essa stessa è una Activity) e per fare questo basta configurare il nostro &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;AndroidManifest.xml &lt;/span&gt;in questo modo :&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; white-space: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; white-space: normal;&quot;&gt;&lt;pre class=&quot;default prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;lt;activity&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;=&quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;miaHome&lt;/span&gt;&quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;lt;intent-filter&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;lt;action&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;android:name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&quot;android.intent.action.MAIN&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;lt;category&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;android:name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&quot;android.intent.category.HOME&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;lt;category&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: red; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;android:name&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: blue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&quot;android.intent.category.DEFAULT&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/intent-filter&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/activity&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Come si può vedere non abbiamo fatto altro che definire in Intent Filter (in prossimi Post parleremo più in dettaglio di cosa siano e a cosa servono), e scegliere per esso la categoria a cui appartiene anche la Home nativa ovvero &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;android.intent.category.HOME&lt;/span&gt;, è stata inoltre inserita la cetegoria &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;android.intent.category.DEFAULT&lt;/span&gt; per fare in modo che la nostra Activity sia quella di default quando si preme il punsante Home sul dispositivo.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techqueue.blogspot.com/feeds/102853843363719372/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://techqueue.blogspot.com/2011/01/categorizzare-un-intent-filter.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/102853843363719372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7565626106349277982/posts/default/102853843363719372'/><link rel='alternate' type='text/html' href='http://techqueue.blogspot.com/2011/01/categorizzare-un-intent-filter.html' title='Categorizzare un Intent Filter'/><author><name>Danilo Del Fio</name><uri>http://www.blogger.com/profile/14672910983257318556</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCFQQVHgZ8SpdwPpHJ_MHjUHie-6H44e1lb6yeOtVzunAk6X_XPyz2hZOK_jnjh9mVhTqol6-UczCI6UOPQC-bpc3ge17q_sH93t0Z6wItStGbqgcC_L6NoqUmbNDRjg/s220/2010-11-04-103120.jpg'/></author><thr:total>0</thr:total></entry></feed>