A TEXT POST

Register a BroadcastReceiver to handle SD Mounted intent

It’s not a big deal but it’s tricky. To register a broadcast for the SD Mounted Intent is easy just following these steps:

AndroidManifest.xml

Register your receiver in the AndroidManifest and it’s necessary to add the data scheme file or it won’t work.

 <receiver android:name=“.SDBroadcastReceiver” >

            <intent-filter>

                <action android:name=“android.intent.action.MEDIA_MOUNTED” />

                <data android:scheme=“file” />

            </intent-filter>

        </receiver>

SDBroadcastReceiver.java

public class SDBroadcastReceiver extends BroadcastReceiver {

    @Override

    public void onReceive(Context context, Intent intent) {

      //TODO: Add your code here, now the SD is available

          }

    }

}

A TEXT POST

Eclipse shortcuts más usados en Mac OS X

La forma más eficiente de aumentar tu productividad es minimizar el tiempo que no estás programando. Para disminuir esas tareas rutinarias lo mejor es conocer tu IDE, en mi caso Eclipse. Estos son los shortcuts de Eclipse que mejoran mi eficiencia desarrollando y me evitan perder tiempo con tareas rutinarias. 

  • Ctrl+Shift+R: Abre el buscador de recursos que permite abrir un fichero rápidamente. Si seleccionas un nombre al utilizar el shortcut lo busca directamente.
  • Ctrl+Shift+T: Abre el buscador de tipos de objetos. Similar al anterior pero solo para objetos.
  • Ctrl+Alt+H: Abre la Jerarquía de llamadas.
  • Command+Shift+C: Comenta las lineas seleccionadas. Para descomentar usar el mismo comando sobre las lineas comentadas.
  • Command+Alt+S: Aparece un menú contextual con la opciones de Source sobre la  clase.
  • Command+Alt+T: Aparece un menú contextual con la opciones de Refactor sobre la  clase.
  • Command+O: Abre la Outline View de la clase. Puedes ver los tipos declarados, las variables, las funciones todo en el orden que aparece y permite buscar por nombre y posicionar el cursos en lo que buscas.
  • Command+click: Abre el fichero java, xml que define la variable seleccionada.
  • Alt+Left / Alt+Right: Navega en el código entre palabras.
  • Ctrl+Space: Asistente de contenido para autcompletar tipos, métodos, interfaces… 
  • Command+L : Introduce un número de linea.
  • Command+Shift+L: Abre el menú Key Assist que enseña todos los shortcuts
A TEXT POST

Dear Google, Please Force Developers To Follow Android Design Guidelines

I agree! The time has come and Google has to Force Developers to Follow Android Guidelines,  because this will force, clients that externalize mobile apps, to create pure Android Apps.

I’ve been working a few years as consultant for mobile apps and what I could say is that clients don’t understand why they have to invest in redesign the iOS UI and UX. The client, most of times just want to say: “I have an Android app, see how cool I am”.

Actually some clients don’t care about Android. They just buy the cheapest android app development (usually this cheap solution just  port iOS version with phonegap or similar). if I have to be frank make a pure Android app is not easy, not fast, not cheaper than port an iOS version. 

Unfortunately, Google is not going to change Play Store the publish requirements.  Play Store has an increased number of malware, spyware, spam apps and the only change they made was to remove the new apps section in the Store, so don’t wait for it.

A TEXT POST

Utilizar BugSense con maven en Android

Bugsense no da soporte a maven. ¿Qué no usas Bugsense en tus proyectos? Bugsense permite remote logging de todos los errores, con una sencilla iniciación en una activity. Así que hay que ponerse manos a la obra para añadir el jar al proyecto. Hay varias formas, pero la mejor para trabar en equipo es crear un repositorio local donde poder instalar todos los jar externos. De esta forma, cuando alguien se descargue el proyecto no tendrá que depender de jar externos que agregar, será bajar, instalar, deployar y a correr.

  1. Crea el repositorio local:Crea dentro del proyecto una carpeta, yo he decidido crear lib en la raiz del proyecto, así quedaría el pom.xml:
    <repositories>
    	     <repository>
    	            <id>
    	                bugsense
    	            </id>
    	            <url>
    	                file:///${project.basedir}/lib
    	            </url>
                </repository>
    </repositories>
  2. Instalar el jar en el repositorio localque hemos creado mediante el siguiente comando. Cambia path/to con la dirección correcta:
    mvn  install:install-file  -Dfile=path/to/bugsense-1.9.jar 
    -DgroupId=com.bugsense.trace  -DartifactId=library -Dversion=1.0  
    -Dpackaging=jar -DlocalRepositoryPath=./lib
    
    Importante mantener el groupId y artifactId para luego añadirlo en el dependencies de pom.xml
  3. Añadir la dependecia en el pom:Una vez creado el repositorio e instalado el jar en el mismo. Es momento de añadirlo como dependencia en el pom.xml del proyecto. Copia lo siguiente:
        
             <dependency>
                <groupId>
                    com.bugsense.trace
                </groupId>
                <artifactId>
                    library
                </artifactId>
                <version>
                    1.0
                </version>
                <type>
                    jar
                </type>
            </dependency>
        </dependencies>
            
         
    
    Importante mantener el groupId y artifactId para luego añadirlo en el dependencies de pom.xml

Fácil, ¿no? :) A disfrutar del genial BugSense

A TEXT POST

De APK a código Java/XML en 3 pasos

Las aplicaciones Android se enpaquetan en un apk. Para conseguir ese apk, el código java pasa por los siguientes pasos: .java->.class->.dex+.arsc->.apk
  • dex2jar es una herramienta que desde un apk te genera un jar.
 ./dex2jar.sh ../name.apk 
  • jad nos permite extraer el código fuente de los .class dentro del jar.
 ./jad -o -r -sjava -dsrc path/to/**/*.class
  • Finalmente, con apktool puedes extraer los ficheros XML.

 ./apktool d name.apk

A TEXT POST

Andy Rubin elevated to senior vp

The promotions signal which areas will be a priority for Page. The executives Page elevated to senior vice president include Andy Rubin, who is in charge of Android mobile phone software; Salar Kamangar, who runs YouTube and video; Sundar Pichai, head of the Chrome Web browser and operating system; and Vic Gundotra, who is focused on Google’s social networking strategy to compete with a wave of young Web companies, most notably Facebook Inc.

The elevated executives are from Android, Chrome and Social Network… These 3 are the important areas of this Google Page’s era 

Good job Page I hope you the best specially with Android :)

A QUOTE

if Google did not act, we faced a Draconian future. A future where one man, one company, one device, and one carrier would be our only choice.