El emulador en Windows Phone 8 SDK e Hyper-V

Como todos ya seguro que sabréis, y si no lo sabéis ya os lo digo yo que para eso estoy aquí, el recién estrenado SDK para Windows Phone 8 solo es posible instalarlo en maquinas con sistemas operativos de 64bits.

¿Cual es el motivo?, bueno pues seguramente que serán muchos, pero uno de ellos es que el nuevo emulador para testear nuestras aplicaciones, no es un emulador al uso tal y como lo teníamos en Windows Phone 7.5, sino que es una imagen del S.O. virtualizada a través de la tecnología Hyper-V de Microsoft y esta tecnología solo es compatible con sistemas de 64 bits como podéis ver en sus requerimientos.

Esto para mi significa una gran ventaja con respecto al emulador de anteriores versiones. Por un lado le dota de mayor estabilidad y un mayor rendimiento, por otro lado el lanzar varios emuladores al mismo tiempo se hace una tarea bastante mas sencilla que antes, la gestión de las imágenes de nuestros Windows Phone emulados ahora son gestionables y no como antes que eran un simple fichero y a veces teníamos que pegarnos con los ficheros de sesión que se quedaban colgados y demás…

Emulator_WP8_0

Bueno, pues manos a la obra y vamos a disponernos a lanzar nuestro flamante emulador y ver in situ todo su potencial.

Emulator_WP8_1

Vaya la primera en la frente, Visual Studio me advierte gentilmente que quizás no tenga habilitado en la BIOS el soporte para la virtualización por hardware, necesario para lanzar Hyper-V y por consiguiente el emulador.

Pero lo primero seria comprobar si nuestro sistema es capaz de ejecutar Hyper-V y si tenemos el Hardware necesario para ello. Os recuerdo que necesitamos que nuestra maquina ejecute la virtualización asistida de Hardware, SLAT (Second Level Address Translation) y DEP (Hardware-based Data Execution Prevention).

Si esto te suena a chino y no tienes ni remota idea de que estoy hablando lo mejor es descargarnos esta pequeña utilidad de Microsoft, llamada Coreinfo para comprobar todos estos requerimientos.

Simplemente tras descargarnos Coreinfo, lo ejecutamos en la línea de comandos con permisos de administrador, con el parámetro –v

C:\> Coreinfo.exe -v

Esto nos mostrara una serie de datos de capacidades de nuestro procesador.

Emulator_WP8_6

Debemos de asegurarnos de tener un asterisco, en las 2 ultimas características, capacidad de virtualización por hardware y SLAT presente.y que nos indique que el Hypervisor está presente.

Por ultimo debemos de hacer otra comprobación, en este caso ejecutando Coreinfo sin ningún tipo de parámetro de entrada.

C:\> Coreinfo.exe

Entre todas las características que nos presenta debemos de buscar la opción NX, la cual nos dirá si disponemos de la capacidad de DEP (Hardware-base Data Executivo Prevención) o no, con un asterisco.

Emulator_WP8_7

Una vez comprobado todo, debemos de saber que tenemos que tener un asterisco en las 3 características comentadas y ver que Hypervisor esta presente, si esto no es así ya podemos ir pensando en comprar otro ordenador o simplemente olvidarnos de probar nuestras aplicaciones en el emulador de Windows Phone 8.

Si tenemos la suerte de contar con todos estos requisitos, simplemente deberemos de ir a la BIOS de nuestro sistema y activar la virtualización por hardware que normalmente viene deshabilitada. En mi caso simplemente tengo que ir a la sección de características de la CPU dentro de mi BIOS y activarlo:

WP_000453

Solo una cosita mas, una vez comprobado nuestro sistema y activado en la BIOS la opción de virtualización, deberemos de añadir nuestro usuario de Windows al grupo de administradores de Hyper-V, para evitarnos posibles problemas de permisos y demás a la hora de asignar hardware al emulador.  Para ello simplemente iremos al administrador de equipos y en la sección de usuarios asignaremos el nuestro al grupo administradores de Hyper-V.

Emulator_WP8_4

Emulator_WP8_3

Bueno, pues listos, una vez realizados estos pasos, la próxima vez que ejecutemos la depuración en el emulador, nos mostrara el aviso de ejecución con permisos elevados, si es que no ejecutamos ya Visual Studio con permisos de administrador.

Emulator_WP8_9

Aquí nuestro flamante emulador listo para comenzar a probar nuestras aplicaciones para Windows Phone 8.

Emulator_WP8_10

Windows Phone 8 SDK y Visual Studio 2012

Hola a todos! Desde ayer está disponible la nueva versión del SDK de Windows Phone, como vimos aquí . Hoy vamos a ver que nos ofrece el nuevo SDK en su integración con Visual Studio 2012. Editor de manifiesto Una de las mayores novedades en este aspecto es el nuevo editor para el archivo WMAppManifest.xml , que en versiones anteriores teníamos que tocar a mano, y ahora nos ofrece una interface gráfica para “casi” todas las opciones disponibles…(read more)

Windows Phone 8 SDK ya está aquí

Hola a todos! Hoy Microsoft a presentado al público el SDK de Windows Phone 8.0 , después de varios meses de espera. Se puede descargar desde aquí . En este artículo quiero dar una vuelta rápida por los aspectos que más me han llamado la atención del SDK. Así mientras descargas e instalas el nuevo Windows Phone 8 SDK puedes enterarte de algunas novedades. Nuevo entorno La primera y mayor novedad es que por fin tendremos el SDK integrado en Visual Studio 2012. Podremos desarrollar tanto para Windows…(read more)

Presentación de Windows Phone 8

Hola a todos! Hoy es el día! Por fin hoy se presentará al mundo la nueva versión de Windows Phone: Windows Phone 8. La presentación tendrá lugar en San Francisco, a las 18:00 hora local de España (GMT +1). Para todos los que no hemos podido ir a la presentación, existe una URL donde podremos seguirla mediante live streaming: http://www.microsoft.com/en-us/news/presskits/windowsphone/ Esta semana pinta interesante para Windows Phone 8, primero esto y luego el Build donde han prometido “revelarnos…(read more)

Test your Java apps on Series 40 phones with the free Remote Device Access service (Featured Video)

With Remote Device Access (RDA) you can test your Java apps on a wide range of real Series 40 phones from the comfort of your office, without having to buy a single phone. Make sure you have a Nokia Developer account, then simply sign into the RDA service, pick a phone, and install your app to be testing on one of 10 different Series 40 phone models.

In this video you will see how to connect to a phone, interact with it through the RDA client, install your software and use the features of the RDA client, including adjusting the display quality to optimise performance, accessing the phone’s file system, and taking screenshots among others.

To use the service, please visit http://www.developer.nokia.com/RDA or follow the RDA service on Twitter: http://www.twitter.com/nokia_rda.

Porting from BlackBerry to Series 40 (Featured Article)

Porting from BlackBerry to Series 40 by inari explains what needs to be taken into account when porting BlackBerry apps to Series 40.

Blackberry app Nokia app

BlackBerry devices (up to BlackBerry OS 7.1) and Series 40 devices share the same development platform – Java ME. This makes porting from BlackBerry to Series 40 quite straightforward and transparent, especially when compared to other mobile platforms. Many generic Java ME libraries can be reused on both platforms “as is”.

Dalvik "Hello World" on Harmattan (in a chroot)

Here’s a quick and boring tutorial on how to get a Java “Hello World” application running on the Dalvik VM of Nitdroid within Harmattan. This requires the Nitdroid Open Mode Kernel (might or might not work with Inception), all Nitdroid files and a bit of patience. This might brick your device or worse, and require a reflash at best. As you can see from the screenshot below, it’s not that exciting ;)

  1. If you want to avoid the Open Mode Warning on each boot, remove the disclaimer from the cal area (this can only be done while in closed mode, as the cal area becomes read-only when flashing open mode until closed mode is re-flashed. This is also the reason why you can’t set a device lock code in open mode – the lock code is saved in the cal area) – this is an optional step, and just a cosmetic fix.
  2. Flash the Nitdroid Open Mode Kernel (be sure to read the “Known limitations” on that post) – this works both on the N950 and N9.
  3. Boot into Harmattan open mode and replace the preinit script to allow booting into Nitdroid (again, read and understand the warnings on that post)
  4. Then, download a Nitdroid tarball (the latest is alpha 5, but I had better luck with alpha 4) and extract it to /home/nitdroid/ – the post explains the steps in great detail, including the kernel flashing and preinit replacement
  5. Reboot into Nitdroid (this might be optional, but do it just to check if your Nitdroid installation is working)
  6. Reboot into Harmattan again – the following commands are all carried out as root user inside Harmattan (using “devel-su“)
  7. Bind mount /dev/ and /sys/ into Nitdroid:
    mount –bind /dev/ /home/nitdroid/dev/
    mount –bind /sys/ /home/nitdroid/sys/
  8. chroot into the Nitdroid hierarchy:
    /usr/sbin/chroot /home/nitdroid/
  9. Set some environment variables (not all of them might be needed, you can find them in “setup the global environment” of init.rc — save these commands into “setupenv.sh” or something in /home/nitdroid/ and save yourself some typing):
    export PATH=/system/bin:/system/xbin:/usr/sbin:/usr/bin:/sbin:/bin
    export LD_LIBRARY_PATH=/system/lib
    export ANDROID_BOOTLOGO=1
    export ANDROID_ROOT=/system
    export ANDROID_ASSETS=/system/app
    export ANDROID_DATA=/data
    export EXTERNAL_STORAGE=/mnt/sdcard
    export ASEC_MOUNTPOINT=/mnt/asec
    export LOOP_MOUNTPOINT=/mnt/obb
    export BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/sys
  10. Start the Dalvik VM:
    / # /system/bin/dalvikvm
    Dalvik VM requires a class name

Ok, great – 10 steps to start the Dalvik VM, but I promised a Hello World. For that, you need the Android SDK (and the corresponding Java JDK) and follow the “Basic Dalvik VM Invocation” instructions (steps 1 to 6 on your host computer, from step 6 on your Harmattan device):

  1. With your favorite editor (mine is vim), create a file “Foo.java” with the following content:
    public class Foo {
        public static void main(String [] args) {
            System.out.println(“Hello, world”);
        }
    }
  2. Compile it:
    javac Foo.java
  3. Use the “dx” utility (from the Android SDK) to package the Foo.class (generated by javac) into a .jar
    dx –dex –output=foo.jar Foo.class
  4. Bonus exercise: “less” the foo.jar file to see its contents:
    % less foo.jar
    Archive:  foo.jar
     Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
    ——–  ——  ——- —- ———- —– ——–  —-
          72  Defl:N       70   3% 2012-10-23 15:51 1294a38f  META-INF/MANIFEST.MF
         732  Defl:N      404  45% 2012-10-23 15:51 b6e3654e  classes.dex
    ——–          ——-  —                            ——-
         804              474  41%                            2 files
  5. Copy this over to your Harmattan device (assuming USB Networking + Developer Mode + “user” access, “developer” should also work):
    scp foo.jar user@192.168.2.15:
  6. SSH into your Harmattan device, become root (devel-su) and copy the .jar file into the Nitdroid hierarchy:
    cp /home/user/foo.jar /home/nitdroid/
  7. chroot into Nitdroid again and set up the environment (see above)
  8. Finally, run Dalvik VM, telling it to run the class “Foo” and using a classpath of “foo.jar”:
    / # /system/bin/dalvikvm -cp foo.jar Foo

Digital Signal Processing (Featured Project)

Digital Signal Processing(DSP) by Sebastiano Galazzo (galazzo to the Nokia Developer Community) is a project which delivers a collection of useful tools that implements DSP algorithms. With the use of 1D Fast Fourier Transform algorithm author has demonstrated Audio Noise Reduction and Sound pattern matching in Windows Phone.

The next action plan of the project is to bring digital image processing like image matching, compression, etc. using 2D Fast Fourier Transform. Till now we are not confirm whether will it be a geometric image matching or a regular image matching or/and will there be a loss-less image compression or not. But this project sounds much promising to bring new and exciting features.

– Somnath Banik (on behalf of the Projects Moderation team)

Updating Your Custom Series 40 Design to Asha Full Touch (Featured Video)

Do you have a custom Series 40 UI design that you want to take to the full-touch UI? Or are you creating a new custom design for the successful Nokia Asha family of Series 40 phones?
Mikko Kaipio, Senior UX Designer, shows you what to consider in your custom app design when taking it from non-touch or touch and type phones to full-touch phones. His advice is equally useful if you are starting with a new app’s design. If your app is based on LCDUI, also check this video:http://www.youtube.com/watch?v=i7FsZ7zEW6M

Try out the aMaze app featured in this video:https://projects.developer.nokia.com/amaze

More information about Series 40 UX resources can be found here:http://bit.ly/Qx757l

HubTile in Windows Phone (Featured Article)

HubTile in Windows Phone by somnathbanik

This week’s featured article is about HubTiles on Windows Phone. By using HubTiles in your application – you can make it look styles and more native.

The author of the article, Somnath, classifies them in 2 types – static HubTiles and dynamic HubTiles. While both types of HubTiles can be animated, data binding can be used to update the content of the dynamic HubTile as it is linked to a remote server.

   

A buildable source code is available for download in the article. Please read the article and try out the available example and let us know if it was helpful!