Showing posts with label jellybean. Show all posts
Showing posts with label jellybean. Show all posts

Saturday, June 1, 2013

[Tutorial] Instalar el SDK de Android en Linux

¿Cómo instalar el SDK de Android en Linux?

What is he talking about? English version

Para este tutorial estoy usando Ubuntu 13.04 pero el procedimiento es el mismo para todas las distribuciones.

Nota: No estoy exactamente seguro de los permisos que hay que dar a las carpetas que vamos a crear. Si saben cuál es el mínimo necesario cambienlos. Yo dí todos los permisos para que simplemente funcionara.

Van a necesitar Eclipse y Java en sus computadoras. Si no tienen ninguno pueden instalar Eclipse en Ubuntu y va a instalar Java al mismo tiempo. Solo usen el comando siguiente:

sudo apt-get install eclipse

Descargar el SDK para Android


Antes que nada necesitarán descargar el SDK desde el sitio de desarrolladores de Android. Vayan a esta página y escojan la opción: SDK Tools only.



Una vez que hicieron eso, van a extraer las herramientas poniéndolas en la carpeta /opt.

sudo tar xzvf android-sdk_r22-linux.tgz -C /opt

Necesitamos cambiar los permisos en esta carpeta para que Eclipse puede usar el SDK luego.

sudo chmod 777 -R /opt/android-sdk-linux

Ahora necesitamos ejecutar el manager de Android para descargar los paquetes que queramos.

cd /opt/android-sdk-linux/tools

./android



Tengan cuidado con lo que escojan descargar porque los paquetes pesan mucho. Normalmente no necesitan nada extra de lo que ya viene en su primera descarga. La última versión de Android ya viene instalada.

Podemos hacer un enlace simbólico a esta herramienta porque vamos a necesitarla en el futuro.

sudo ln -s /opt/android-sdk-linux/tools/android /usr/bin/android

Usar el manager


Lo que vamos a querer hacer ahora es asegurarnos que podemos crear una máquina virtual que use Android.

Vamos a darle todos los permisos a la carpeta de configuración. Así el manager del SDK va a poder crear nuevas máquinas virtuales.

sudo chmod 777 -R  ~/.android

Ahora usen el comando siguiente (después de haber hecho el enlace en /usr/bin):

./android avd


Y pueden crear un nuevo dispositivo cuando le click a "New". Van a ver las diferentes opciones que hayan descargado.



Les recomiendo que activen el uso de GPU de su máquina, así el dispositivo virtual va a estar más rápido.
Lancen el emulador y esperen. Puede tomar un poco de tiempo entonces no se asusten (como yo lo hice).



Ahora podemos instalar el plugin para Eclipse.

Instalar el plugin para Eclipse


Abran Eclipse y vayan a Help > Install New Software... > Add...

Escojan Add... en la esquina superior derecha.

Luego van a tener que  escoger un nombre para el plugin que van a instalar, "Android" tal vez. Y en la sección URL pongan el siguiente link:

https://dl-ssl.google.com/android/eclipse/


Escojan "Developer Tools" y denle click a Next>. Acepten los "Terms and Conditions" y escojan Finish. Eclipse va reiniciarse pero todavía no van a poder usar el SDK.
 
Configurar el camino hacia el SDK

Vayan a  Windows > Preferences > Android y configuren la sección "SDK Location" poniendo la siguiente línea:


/opt/android-sdk-linux



Denle click a Apply y luego a OK. Reinicien Eclipse y el SDK de Android va a poder funcionar bien.

Crear su primera aplicación


Si quieren un nuevo proyecto de aplicación en Eclipse vayan a New > Other... y escojan "Android Application Project".



Esto va a crear una aplicación muy simple automáticamente.

Si quieren probar su app en el dispositivo virtual necesitan lanzar el dispositivo primero y Eclipse va a instalar la app y lanzarla automáticamente.

Si quieren instalar y probar su app en un dispositivo de verdad necesitan lanzar adb con permisos de super utlizador. Solo usen los comandos siguientes:

sudo adb kill-server

sudo adb start-server

Si quieren ver si su dispositivo está bien reconocido solo usen

adb devices



¡Eso es todo! Disfruten del SDK y programen mucho.

¿Les gustó este post? No se olviden de agregarme a  G+ o síganme en Twitter: @RobertoXMed .

Si pueden y quieren no olviden hacer una Donación (por Paypal) para el blog chimbo así podré seguir haciendo gran contenido.

Wednesday, May 29, 2013

[How to] Install Android SDK in Linux

How to install the Android SDK in Linux

¿De qué está hablando? Versión en español.

For this tutorial I am using Ubuntu 13.04 but the procedure is the same for all distros.

Note: I am not exactly sure about the permissions you need to give to the folders we are going to create. Feel free to change them. I gave all permissions so it will just work.

You will need Eclipse and Java installed. If you haven't got Eclipse all you have to do in Ubuntu is using this command (it will pull Java at the same time):

sudo apt-get install eclipse

Downloading the SDK for Android


First of all you need to get the SDK from the developer site of Android. Go this website and choose the last option: SDK Tools only.



Now you will need to extract those tools, and lets put them in the /opt directory.

sudo tar xzvf android-sdk_r22-linux.tgz -C /opt

We need to give permissions to this folder so Eclipse will be able to use the SDK.

sudo chmod 777 -R /opt/android-sdk-linux

Now we need to run the Android manager to download the packages we need.

cd /opt/android-sdk-linux/tools

./android



Be careful when you choose what you want to download because it takes a lot of memory. Normally you won't need anything extra if you want to run the latest Android version.

We can make a symbolic link because we are going to need this in the future.

sudo ln -s /opt/android-sdk-linux/tools/android /usr/bin/android

Using the manager


Now we want to make sure we can create a virtual machine running android.

Let's give all permissions to our configuration file. In order to let the SDK create a virtual Android device.

sudo chmod 777 -R  ~/.android

Launch the following command (make sure you created a symbolic link before):

./android avd


And create a new virtual device, if you don't have any, choose "New". You will see the different options that you downloaded with the SDK manager.



I recommend you to enable the GPU usage, the virtual device will run faster with that.
Launch the emulator and wait. It could take sometime to launch so don't panic. (Like I did)



Now we can install the plugin for Eclipse.

Installing the Eclipse plugin


Launch Eclipse and go to Help > Install New Software... > Add...

Choose Add... in the top right corner.

Then you will enter a name for the new software you are going to install, "Android" maybe. And in the URL section enter the following Location:

https://dl-ssl.google.com/android/eclipse/



Choose the "Developer Tools" and then click Next>.
Accept the "Terms and Conditions" and then choose Finish. Eclipse will restart but you won't be able to use the SDK just yet.

Configure the path to the SDK

Go to Windows > Preferences > Android and configure the "SDK Location" to:

/opt/android-sdk-linux



And choose Apply then click OK. Restart Eclipse and the Android SDK will be good to go.

Creating your first app


If you want to create a new application with Eclipse go to New > Other... and choose "Android Application Project".



It will create the application automatically.

If you want to test your app in the virtual device you will need to launch the device first and Eclipse will install and run the app in the device.

You can install and launch the app in a real device but you need to launch adb with root permissions. Just use the following commands.

sudo adb kill-server

sudo adb start-server

And if you want to check if your device is recognized use

adb devices



And that's it! Enjoy the SDK.

Did you like this post? Don't forget to add me to your circles in G+ or to follow me on Twitter: @RobertoXMed . If you can and if you want, don't forget to Donate so I can keep up the good work.

Monday, April 22, 2013

[How to] Root your Android device in Linux

How to root your Android device if you use Linux

¿De qué está hablando? Versión en español

You can adapt this tutorial to your device.

Introduction and motivation


When I was looking for a tutorial that will show me how to root my device in Linux I didn't find a post that will show me exactly how it was going to be, that's why I decided to do this post.

I have a HTC Desire C, which has Ice Cream Sandwich (Android 4.0.3).

First steps


Usually if you bought your device in a retail store, your "Bootloader" should be blocked. The Bootloader is what allows you to install new operating systems in your Android device.

For any HTC device, you need to follow the tutorial in the developer website of HTC. The tutorial explains how to unlock the Bootloader in Windows actually, so I'm going to show you how to do it with your Linux machine:

Go to the HTC site: http://www.htcdev.com and choose "Unlock Bootloader".


After you clicked in "Get Started" you will see a list of devices that are supported. If your device isn't supported you can choose the "All Other Supported Models" option.
Note: you need to create an account in HTCdev, you will receive a mail afterwards with a binary that you will need to unlock the Bootloader. Also you need to accept some conditions.

Now we can see the tutorial made by HTC. Basically we are going to do the same thing but in Linux!! (yeah awesome)
  1. Remove the battery and before you turn ON your device again you need to press the Volume Down Key and then the Power Button. Hold them until your device boots again.
  2. You will see a different screen, and some options will be displayed: "Fastboot", "Recovery", "Factory Reset" and "Simlock". To choose an option you need to use the Volume Keys.
  3. Choose "Fastboot" and press the Power Button.
  4. Plug in your device to your computer. You will see that the title "FASTBOOT" will change to "FASTBOOT USB".

Download the Android tools (adb, fastboot)


For the Ubuntu users: with all the developing that is happening with Ubuntu Touch the "Phablet" team released a PPA in order to download and install adb and fastboot (if your release doesn't have them in the default packages). Just run the following commands:

sudo add-apt-repository ppa:phablet-team/tools
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot

If you don't use Ubuntu you need to search for the tools in the Google website. Again maybe your distro has uploaded the tools to your packages.

Unlock the Bootloader


Once you have fastboot installed, the next step is to use this command:

sudo fastboot oem get_identifier_token

This will generate a token and the output must look like this:


Then in the tutorial of HTCdev you need to copy (Ctrl + Shift + C in the Terminal) and paste this token in the box of the website.


After you hit the "Submit" button you will receive a mail with a binary that you will execute to unlock the Bootloader.



After you received the mail, you will see a link with the rest of the instructions. Download the attached file "Unlock_code.bin" and put it in a strategic place, "~" (<- your home) seems good to me. Again from a Terminal you use this command:

sudo fastboot flash unlocktoken Unlock_code.bin


Then in your device you will see the following screen. It will ask you if you are sure of what you are doing. After you select "Yes" your phone will have its Bootloader unlocked.

Note: if you want to lock the Bootloader again, just use:
 
sudo fastboot oem lock

Downloading the super user


The next step is to download the super user, this little program will give you all the privileges in your Android device, that way you can do whatever you want with your phone. For example you can erase all the apps that you don't want but that are installed by default. Or you can install a new ROM into your phone.

You need to go to this website and download the file "Superboot r1".

Put the file where you want and extract it, you need to give the permission to execute the script:

chmod +x install-superboot-linux.sh

Then you need to plug in your phone, again in "FASTBOOT USB" mode.
You can do that without removing the battery with abd. But your device has to have the USB Debugging option activated. Go to "Settings">"Developer options"



sudo adb reboot-bootloader


Install the super user


Once your phone is connected and after you are in the good folder in your terminal, you will just need to run the script:

sudo ./install-superboot-linux.sh

Once you did that your phone will restart and the super user (SU) will be installed.

Did you like this post? Here you can see what I'm going to write about in this blog (for the moment). Don't forget to add me to your G+ circles or follow me on Twitter: @RobertoXMed

[Tutorial] Cómo rootear su Android en Linux

Cómo rootear su Android si usan Linux

What is he talking about? English version

Introducción e interés


Buscando tutoriales sobre como rootear mi teléfono en Linux no encontré nada muy claro ni muy gráfico entonces he decidido hacer este tutorial.

Yo utilizo un HTC Desire C, vino con Ice Cream Sandwich (versión 4.0.3 de Android).

Primeros pasos


Normalmente cada dispositivo tiene su "Bootloader" bloqueado. El Bootloader es lo que permite instalar un nuevo sistema operativo en su Android.

En el caso de los dispositivos HTC lo que tienen que hacer es seguir el tutorial en la página de desarroladores de HTC. Como el tutorial está más centrado para gente que usa Windows aquí les mostraré lo que tienen que hacer:

Vayan al sitio de HTC: http://www.htcdev.com y elijan "Unlock Bootloader".


Luego de clikear en "Get Started" van a tener una lista de dispositivos a su derecha. Si su dispositivo no está en la lista van a tener que elejir "All Other Supported Models".

Nota: tienen que crear una cuenta en HTCdev porque luego van a recibir un mail con un código que les va a servir para desbloquear el "Bootloader". Así mismo tienen que aceptar algunas condiciones en las cuales dicen que saben lo que están haciendo.

Luego llegamos al tutorial de HTC. Básicamente vamos a hacer lo mismo que está en el tutorial pero solo les diré cómo hacerlo en Linux y no en Windows.
  1. Saquen la batería y cuando vayan a prenderlo de nuevo deben aplastar el botón del volumen hacia abajo y el botón de encendido al mismo tiempo. (Pueden aplastar el volumen hacia abajo primero y luego el botón de encendido).
  2. Cuando su teléfono se va a encender van a ver una pantalla en la que tienen algunas opciones: "Fastboot", "Recovery", "Factory Reset" y "Simlock". Para navegar en este menú deben utilizar los botones de volumen.
  3. Seleccionan "Fastboot" luego aplastan en el botón de encendido.
  4. Conecten su dispositvo al computador. Una vez que lo hicieron el título debe cambiar a "FASTBOOT USB".

Descargar los utilitarios (adb, fastboot)


Para los usuarios de Ubuntu: con todo el desarrollo que se está dando a causa de Ubuntu Touch para los teléfonos se ha creado un PPA del cual pueden descargar e instalar abd y fastboot (si estos no están en los paquetes). Solo usen los comandos siguientes.

sudo add-apt-repository ppa:phablet-team/tools
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot

Si no usan Ubuntu deben ir a la página de Google y descargar estos dos utilitarios para Linux (si estas herramientas no están en los paquetes de su distribución).

Desbloquear el Bootloader


Una vez que tengan instalado fastboot el siguiente paso es usar este comando para que fastboot nos genere un código:

sudo fastboot oem get_identifier_token

Les va a salir un mensaje como este:


Luego ese código deben introducirlo en una casilla de los pasos que están en la página de HTC con el tutorial sobre cómo desbloquear el bootloader.


Una vez que le den click en "Submit" van a recibir un mail con un script que van a ejecutarlo y así su teléfono se desbloqueará.



Después de que recibieron el mail, van a ver que en él hay lo que sigue de las instrucciones. Descargamos el archivo adjunto  que se llama "Unlock_code.bin" en un lugar fácil de encontrar por ejemplo en "~" (<- eso es su home). De nuevo desde el terminal vamos a usar el comando siguiente:

sudo fastboot flash unlocktoken Unlock_code.bin


Y luego en su teléfono van a ver la pantalla siguiente que les preguntará si están seguros de que quieren desbloquear el Bootloader. Seleccionan "Yes" y listo. Su teléfono debe reiniciarse.


Nota: si quieren bloquear el bootloader de nuevo lo único que tienen que hacer es:

sudo fastboot oem lock

Descargar el super utilizador (super user)


El siguiente paso es descargar el super utilizador, es lo que les va a dar todos los derechos en su Android y así podrán hacer lo quieran con su dispositivo. Como por ejemplo eliminar todas las aplicaciones que no les sirven de nada y que ocupan mucho espacio. O pueden instalar un nuevo ROM en su teléfono.

Para eso deben ir a esta página y descargar el archivo "Superboot r1".

Lo ponen donde quieran en su computador, lo extraen y deben darle el permiso para ejecutarse:

chmod +x install-superboot-linux.sh

Luego deben volver a conectar su teléfono prendiéndolo como al principio, es decir con "FASTBOOT USB".
Pueden hacer esto usando adb. Pero antes deben activar el modo depuración USB, yendo a "Ajustes">"Opciones de desarrollo":



sudo adb reboot-bootloader


Instalar el super utilizador


Una vez que su teléfono está conectado y en su terminal están en la buena carpeta (donde pusieron el instalador del súper utilizador), lo único que les resta hacer es lo siguiente:

sudo ./install-superboot-linux.sh

Una vez que hicieron esto su teléfono va a reiniciarse y tendrán instalado el súper utilizador (SU).

Les gustó este post? Aquí pueden ver lo que se va a venir en este blog (por el momento). No se olviden de agregarme a sus círculos en G+ o de seguirme en Twitter: @RobertoXMed