Android Programmer
Programación para dispositivos Android-
Julio 6th, 2010TutorialesCon ayuda de los tutoriales anteriores ya tenemos lista la aplicación Android y ahora queremos subirla al MarketPlace. Por qué subirla al Marketplace? Hay varios motivos. Entre ellos la audiencia potencial y la facilidad de instalación. Cualquiera puede llegar a la aplicación vía Marketplace, bajarla e instalarla desde el Android pero no cualquiera puede bajar un APK, indicar los permisos para poder ejecutar aplicaciones por fuera del Marketplace y confiar en que funcionará. Por tales motivos es bueno subir las aplicaciones al MarketPlace. Ahora la parte negativa: Google pide un pago de u$25 por única vez para registrarse. La dirección es http://www.android.com/market (vean en la imágen el link para desarrolladores)

Publicar en Android Market
Tras registrarse en el MarketPlace, es necesario realizar varias cosas aún sobre la aplicación a fin de poder subirla.
1. Setear en el Manifest, la opción Debuggable como False (para desarrollar era necesario que estuviera True a fin de detectar errores pero a la hora de pasar a producción, hay que apagar dicha característica)
2. Ir a la carpeta de Java C:\Program Files\Java\jre1.6.0_07/bin, ejecutar Keytool indicando una contraseña y tus datos personales
Un Ejemplo seríakeytool -genkey -v -keystore oraculo.keystore -alias MiEmpresa -keyalg RSA -keysize 2048 -validity 10000
3. Buscar oraculo.keystore que usualmente se ecnontrará en C:\Users\TuUsuario\AppData\Local\VirtualStore\Program Files\Java\jre1.6.0_07\bin
4. Usar el Wizard del Eclipse para encriptar y generar el APK indicando el keystore location del paso anteriorSiguiendo estos pasos deberías tener listo el APK para subir al Marketplace. Los usuarios de Android podrán bajar e instalar tu aplicación y también podrán votar y realizar comentarios. Desde el panel de control del Marketplace podrás ver cuántos usuarios bajaron e instalaron y cuántos tienen la aplicación activa.
Espero que les sea de utilidad. Para la próxima ocasión: cómo monetizar aplicaciones Android via AdMob o AdSense.
-
Junio 9th, 2010TutorialesTras haber instalado la plataforma de desarrollo y pruebas procederemos a programar una aplicación sencilla. Se trata de un Oracúlo para Android. La idea es realizar preguntas que el Oráculo responderá con Sí o No.
Crear emulador
Antes es necesario crear el emulador que vamos a utilizar para probar el desarrollo. Esto se hace desde la línea de comandos con la siguiente instrucción:
android create avd –target 2 –name my_avd
Crear el proyecto
Luego abrimos Eclipse, New Project, Android Project, Next y cargamos estos datos
Project name: AskTheOracle (sin espacios)
Target: Android 1.5
Application name: Ask The Oracle (aquí sí se pueden usar espacios)
Package name: alhadeff.asktheoracle (esto debe seguir la lógica de packages del desarrollador, pueden usar su empresa. apellido.aplicación por ejemplo)
Create Activity: checkeado e ingresar el nombre de la actividad AskTheOracle (sin espacios)
Min SDK versión: 3 (vean que es el SDK correspondiente a la API del Android 1.5)
Click en Finish.
Diseñar la pantalla
Click en la barra derecha Package Explorer, Ask The Oracle, click en res, drawable, botón derecho, import, General, file system, luego seleccionar una imagen almacenada en la computadora para representar al Oráculo
Luego click en Layout, main.xml, tab layout, botón derecho sobre la pantalla negra, Add, ImageView.Click en la ventana Outline de la derecha inferior sobre ImageView01, en Properties bajar hasta src y ahí seleccionar de la carpeta drawable la imagen del Oraculo importada en el paso previo.
Luego repetir el paso de agregado pero esta vez con un EditText. Tras agregarlo ir a Properties y borrar del campo text esta cadena: @+id/EditText01 Luego indicar minwidth=300px
Luego repetir el procedimiento pero esta vez seleccionando Button. Tras agregar el botón ir a Properties y reemplazar el Text @+id/Button01 por Ask.El código del main.xml debería quedar así:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/oraculoc"></ImageView><TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Ask the Oracle"></TextView><EditText android:id="@+id/EditText01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="300px"></EditText>
<Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Ask"></Button>
</LinearLayout>
Agregar el código de la aplicación
Es necesario ahora hacer click en src, en todas los íconos inferiores hasta que se abra la ventana del código fuente.
Ahí copiamos este código:package alhadeff.asktheoracle; import java.util.Random; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class AskTheOracle extends Activity { /** Called when the activity is first created. */ Button Button01; TextView tv; EditText txtbox1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); /** Retrieve screen elements */ Button01 = (Button) findViewById(R.id.Button01); tv = (TextView) findViewById(R.id.TextView01); txtbox1 = (EditText) findViewById(R.id.EditText01); /** Setup a listener for the button */ Button01.setOnClickListener(new clicker()); } class clicker implements Button.OnClickListener { public void onClick(View v) { /** Randomize to select answer Yes/No */ Random randomGenerator = new Random(); int randomInt = randomGenerator.nextInt(2); /** Clear textbox */ txtbox1.setText(""); /** if random is 1 present yes, if 2 present no */ if (randomInt==1) tv.setText("Yes"); else tv.setText("No"); } } }Es importante notar que a medida que incorporamos cualquier cambio en la aplicación, aparecerá una X roja de encontrarse algún error. No será posible ejecutar la aplicación a menos que solucionemos este error.
Al copiar y pegar desde luego que no deberían encontrar errores pero al escribir su propio código no se olviden de que no es lo mismo mayúscula que minúscula y presten atención a las advertencias.
Para importar automáticamente packages existe el atajo: Control + Shift + OEjecutar la aplicación
Finalmente llegó la hora de probar la aplicación: simplemente hagan botón derecho, Run As, Android Application. Si aparece la pantalla lockeada del Android, clickeen sobre Menu. Es posible que tarde en ejecutarse la aplicación un par de minutos la primera vez.
Tags: android, Eclipse, emulador, Oracle, packages, SDK version
-
Junio 7th, 2010Tutoriales
Eclipse for Android
Sos programador y estás interesado en desarrollar aplicaciones para vender en el Android Market pero la documentación de Google no parece nada sencilla ni amigable. Estás en el lugar correcto. Me dispongo a ofrecer un tutorial sencillo de desarrollo para programadores Android. En este tutorial sólo se cubre Windows. Si querés desarrollar en Linux podés instalar el entorno de acuerdo a la documentación de Google y luego leer las otras partes del tutorial.
Vamos paso por paso. Primero lo requerimientos técnicos. Si bien Google dice que es posible desarrollar con Windows XP y 200MB de disco, la realidad es que necesitás al menos 2gb – y preferentemente 3gb – de memoria para que el emulador no se cuelgue. Entonces los requerimientos realistas son: Windows Vista o Windows 7, 3GB de memoria RAM y al menos 500mb de disco.
Luego es necesario bajar e instalar este software:
1. Android SDK: http://developer.android.com/sdk/index.html bajar, hacer unzip en cualquier ubicación y agregar la ubicación al path de Windows (Mi Computadora, click derecho del mouse, Propiedades, Avanzadas, Variables de entorno, doble-click en Path o Ruta bajo Variables del Sistema, agregar la ruta all directorio
tools/del SDK)2. Entorno de desarrollo Eclipse for Java Developers: http://www.eclipse.org/downloads/Bajar, ejecutar el instalador y abrir la aplicación
3. Dentro del Eclipse ir a Help, Install New Software, Available Software, Add, cargar http://dl-ssl.google.com/android/eclipse/ en el textbox de location, clickear en Developer Tools, click en Next, click en Install, click en Finish. Salir y volver a ingresar al Eclipse. Luego ir a Window/Preferences/Android/Browse y seleccionar la ubicación del SDK instalado en el paso 1. Click en Apply y luego en OK.
Eso es todo en cuánto a las herramientas y entorno de desarrollo. Sigamos al paso 2 para programar la primera aplicación.
Tags: android, Eclipse, Google, Java, programación, SDK -
Junio 2nd, 2010Announcements
Android Pocket Freud
Freud in your pocket. Install Pocket Freud in your Android and throw away those therapyst bills.
-
Junio 2nd, 2010EULAEND-USER LICENSE AGREEMENT FOR Pocket Freud IMPORTANT PLEASE READ THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT CAREFULLY BEFORE CONTINUING WITH THIS PROGRAM INSTALL: Mobile 117 End-User License Agreement (“EULA”) is a legal agreement between you (either an individual or a single entity) and Mobile 117. for the Mobile 117 software product(s) identified above which may include associated software components, media, printed materials, and “online” or electronic documentation (“SOFTWARE PRODUCT”). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. This license agreement represents the entire agreement concerning the program between you and Mobile 117, (referred to as “licenser”), and it supersedes any prior proposal, representation, or understanding between the parties. If you do not agree to the terms of this EULA, do not install or use the SOFTWARE PRODUCT.
The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.
1. GRANT OF LICENSE.
The SOFTWARE PRODUCT is licensed as follows:
(a) Installation and Use.
Mobile 117 grants you the right to install and use copies of the SOFTWARE PRODUCT on your device2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.
(a) Maintenance of Copyright Notices.
You must not remove or alter any copyright notices on any and all copies of the SOFTWARE PRODUCT.
(b) Distribution.
You may not distribute registered copies of the SOFTWARE PRODUCT to third parties. Evaluation versions available for download from Mobile 117’s websites may be freely distributed.
(c) Prohibition on Reverse Engineering, Decompilation, and Disassembly.
You may not reverse engineer, decompile, or disassemble the SOFTWARE PRODUCT, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
(d) Rental.
You may not rent, lease, or lend the SOFTWARE PRODUCT.
(e) Support Services.
No support is provided
(f) Compliance with Applicable Laws.
You must comply with all applicable laws regarding use of the SOFTWARE PRODUCT.3. TERMINATION
Without prejudice to any other rights, Mobile 117 may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOFTWARE PRODUCT in your possession.4. COPYRIGHT
All title, including but not limited to copyrights, in and to the SOFTWARE PRODUCT and any copies thereof are owned by Mobile 117 or its suppliers. All title and intellectual property rights in and to the content which may be accessed through use of the SOFTWARE PRODUCT is the property of the respective content owner and may be protected by applicable copyright or other intellectual property laws and treaties. This EULA grants you no rights to use such content. All rights not expressly granted are reserved by Mobile 117.5. NO WARRANTIES
Mobile 117 expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT is provided ‘As Is’ without any express or implied warranty of any kind, including but not limited to any warranties of merchantability, noninfringement, or fitness of a particular purpose. Mobile 117 does not warrant or assume responsibility for the accuracy or completeness of any information, text, graphics, links or other items contained within the SOFTWARE PRODUCT. Mobile 117 makes no warranties respecting any harm that may be caused by the transmission of a computer virus, worm, time bomb, logic bomb, or other such computer program. Mobile 117 further expressly disclaims any warranty or representation to Authorized Users or to any third party.6. LIMITATION OF LIABILITY
In no event shall Mobile 117 be liable for any damages (including, without limitation, lost profits, business interruption, or lost information) rising out of ‘Authorized Users’ use of or inability to use the SOFTWARE PRODUCT, even if Mobile 117 has been advised of the possibility of such damages. In no event will Mobile 117 be liable for loss of data or for indirect, special, incidental, consequential (including lost profit), or other damages based in contract, tort or otherwise. Mobile 117 shall have no liability with respect to the content of the SOFTWARE PRODUCT or any part thereof, including but not limited to errors or omissions contained therein, libel, infringements of rights of publicity, privacy, trademark rights, business interruption, personal injury, loss of privacy, moral rights or the disclosure of confidential information. -
Mayo 31st, 2010Sin categoríaVersion 1.0 of Pocket Freud was released today. Please download from Android Market and test it.
-
Mayo 31st, 2010Sin categoríaEste es el sitio web de Mobile 117, un emprendimiento dedicado a proveer aplicaciones para dispositivos Android. Asimismo contendrá tutoriales e información para developers Java/Android.
Tags: android, desarrollo, programación -


