Feeds:
Posts
Comments

Posts Tagged ‘Android’

Intel Edison

Intel Edison

As some of you that follows me on Twitter may already know, I was at MakerFaireRome a few weeks back, and I couldn’t resist to buy the new Intel Edison board, the follow-up of Intel Galileo. Now, the board promises to be a lot of fun: it has a dual core Atom CPU (!), plus an Intel Quark microcontroller, 1 GB of RAM, 4 GB of disk, WiFi and Bluetooth: basically, everything in a really small form factor. There are some interesting things that I would really like to try, for example SparkFun sells a LiPo battery, and I am really curious how long it could last while powering up all the good stuff that I cited above, but that’s not the main topic for this post.

What I really wanted to try actually is the Intel XDK: for some reason, Intel decided to develop its own SDK for mobile applications, that uses open source frameworks such as Apache Cordova (that I didn’t know about, and which I am quite curious about now!) to allow developers to create their applications using HTML5, CSS and JavaScript and deploy them on all the OSes (Android, iOS, Windows Phone). At some point they also decided to extend their SDK to support their IoT efforts (XDK IoT Edition), and that’s what I was finally able to try yesterday: attach some hardware, deploy an app on the Edison and its companion app on Android, and see how the two of them react together (of course, you can develop apps for the Edison using the Android IDE, but there are more powerful ways to do that…).

The hardware

Edison and a couple of sensors and actuators

Edison and a couple of sensors and actuators

I have to admit that I put together a very simple experiment very quickly, so nothing fancy here: I dug up a proto shield for Arduino that I prepared some time ago, with just a couple of LEDs and a couple of buttons, and I put them together on the Intel Edison and Arduino breakout board, which is basically a board that exposes some USB ports, a slot for the Edison itself, and a set of headers to connect Arduino shields.

The thing that took more time was updating the Edison firmware: it is as simple as download the files from the Intel Website and put them in a partition that appears when you connect the board to a computer, except for the fact that noone tells you that the partition should be formatted in FAT32 before doing that (by default it is FAT): if you don’t, when you connect to the board through the serial port and execute the update, Linux is not able to read the files and fails (by the way, they use Yocto, of course!).

XDK, IoT Edition

XDK IoT

XDK IoT

Anyway, once done that, I fired up the XDK: what Intel did was put together a C/C++ library that supports the usual hardware protocols (digital and analog I/O, SPI, PWM…), and they made a wrapper in Python and one in JavaScript, and this one is the one that the IDE uses: basically, you write an app using Node.JS, using any of the Node.JS libraries plus the one interfacing with the hardware, and then the IDE builds up the dependencies (whenever they need to be built) and packages them on the board. It supports deployment, start and stop from the IDE, and remote debugging (“remote” because the computer and the Edison communicate through a LAN, not through serial).

Now, I am quite new to Node.JS (i.e., it was the first time that I used it, since it is known that I consider JavaScript to be one of the worst languages ever), so what I did was take an existing template and play with it: the code that you see up there simply reads the status of the two buttons and updates the two LEDs according to which button is pressed (a standalone application, if you wish, that you can write as easily with the Arduino IDE). The “new” part is that it also fires up a Web server and creates a Websocket that periodically publishes the status of the buttons to whoever is connected to it. Starting the app, thus, means starting the standalone job and the Web server, that waits for anyone to connect to it.

The standalone part of the application was working (I did not make a video: it is too stupid as code to be worth it 🙂 ): it was time to find out how the smartphone counterpart works.

XDK, the smartphone counterpart

XDK smartphone

XDK smartphone

I started another existing template for smartphones, that was designed as a counterpart for another IoT template: basically, it shows a big grey circle and a text field, and it connects to the server that you specify on bootup, listening to the Websocket and updating the circle color and the text field whenever an update message arrives. The code is quite simple, and I made almost no modifications to the template: I maintained the same graphical layout and simply changed the message content that it receives from the Websocket (according to what I developed previously for the IoT app).

Bootup in the emulator

Bootup in the emulator

The editor part of the SDK is basically the same between the IoT and the smartphone parts: you are editing JavaScript in both cases. The smartphone part has several more tabs apart from the editor: first of all, the emulator. I am not sure but I think it uses the Intel virtualized capabilities of the hardware if available, or maybe it is only an emulator with HTML5 support: it was really fast to bootup (I am not sure because I was using it on Windows*, and I have no idea whether the virtualized capabilities are automatically started. I have not read much of the documentation for the XDK yet…); once started, it allows you to execute and debug an application, and see it using different graphical dispositions (the one in the screenshot is Nexus 4, but you have some Apple models and some Windows ones, plus others).

The IDE allows you to upload the app to the cloud and test it somehow: this is something I have to tried yet, so I cannot tell you much about it. If you don’t what to follow that route, you can simply test it on your devices: you need to install an Intel companion app that handles the communication with the XDK, and after that you can launch the execution on the device.

The app waiting for something to happen...

The app waiting for something to happen…

... something happened!

… something happened!

These are two screenshots that I took on my Nexus 5: the messages assume that someone is “knocking” by pressing the buttons on the shield connected to the Edison board. So it works! 🙂

Get the apk

Get the apk

Finally, you can build the APK: the XDK produces an ARM and an Intel version of the app, and you can download them and install them wherever you please, or put the in the various online markets. Of course, you can get the equivalents for iOS and Windows Phone (I have not tried, since I have no devices to try them).

Conclusions

All in all, the XDK is quite nice: it allows you to develop apps for IoT and smartphones using the same IDE, which for me is a very big plus. I found out the IDE to be a little unstable when moving from one app to the other, but then I installed an update and now it may be more stable (I found out about the update when I already finished my tests, so I have not tried it yet). I really need to explore more the Node.JS libraries on the IoT side and the JavaScript client libraries on the smartphone side (the XDK presents you with libraries for Facebook, Dropbox, Flickr, iTunes and much more, but I have no idea what they do or how they work), and also the Cordova API, that should allow the Web code to interact with the sensors inside the smartphone.

I have to say that I am quite interested in the idea of developing apps for all the smartphone OSes in one shot (yeah, I know is not a new idea…): as of today, I have only written native Android code, and I want to see what you can do using the HTML5 + JavaScript pair…

Read Full Post »

Nexus 7

Nexus 7

VM

VM

As you know, for my Ph.D. I’m developing a specialized version of Erlang for IoT scenarios, called ELIoT (ErLang for the Internet of Things); we had it running on some known (or less known) devices, such as the Raspberry Pi or the Carambola, and in the last few days I decided it was time for Android to enter the scene.

So I ported the framework forward a couple of minor versions (from Erlang 15B to 15B03.1), and used the existing patches to cross-compile it on Android. The screenshots show it running on my Nexus 7, pinging a Linux VM running on my computer. Unfortunately, for now it has to be run as root, so the next step is to try this SL4A stuff (which was in the original patch set, but as of now it simply crashes, so being root was the easiest way to try everything).

P.S.: don’t worry about the debugging prints on the VM side, they were there simply to check that no strange bytes were passing as messages on the network.

Read Full Post »

Un breve follow-up della mia precedente recensione del Nexus 7, non tanto perchè io abbia (finalmente?) trovato un caso d’uso (aka un motivo serio) per usare il tablet, quanto piuttosto perchè oggi ho potuto testarlo “su strada” (termine non del tutto fuori luogo). Ho infatti effettuato un Milano – Venezia – Milano in giornata, ed ho portato con me solamente il Nexus come dispositivo (oltre al telefono, naturalmente), e posso perciò spendere due parole su come sia usarlo per intrattenimento e lavoro.

Il Nexus è stato acceso stamattina alle 7.30 circa, con la batteria al 60%, ed al mio arrivo a casa, 13 ore dopo (20.30), la batteria era scesa al 20%; nelle 13 ore è sempre stato acceso nelle seguenti condizioni:

  • 8.5 ore con la WiFi disattivata (perchè non in uso) e lo schermo in pausa (custodia chiusa)
  • 4 ore con la WiFi disattivata, ma utilizzato per guardare un video in 720p (1 ora circa) e per leggere un libro con l’app Kindle (un paio d’ore circa), la restante ora ho scritto alcune cose
  • 0.5 ore con la WiFi attivata, tethering dallo smartphone: di fatto, gestite le email e poco più per qualche minuto durante il viaggio d’andata e qualche minuto durante quello di ritorno

La parte di navigazione e di visualizzazione del video direi che è stata più che soddisfacente, così come avevo potuto sperimentare anche qui a casa; la lettura di un libro non è stata male, nonostante si tratti di uno schermo simile a quello di un computer.

La scrittura è il punto debole della catena: essendo in treno, non ho potuto sfruttare la registrazione vocale (che invece uso qui a casa alcune volte per rispondere alle email), e la tastiera resta abbastanza scomoda: l’uso con i due pollici è più comodo rispetto ad usare una mano (un dito di una mano) mentre si regge il dispositivo con l’altra, unico difetto la necessità di trovare una posizione buona per la mano sinistra, che regge dal lato in cui si chiude la cover, ed in alcune posizioni il magnete interviene anche a dispositivo aperto e fa scattare lo spegnimento dello schermo.

Il giudizio finale della scampagnata direi che è un 7.5: ottimo per gli aspetti ben noti, ma bisogna trovare un equilibro migliore in fase di scrittura: per quanto infatti non lo si usi comunque per scrivere poemi, risulta comodo per prendere qualche breve appunto, e non sarebbe male migliorare questa fase.

Read Full Post »

This slideshow requires JavaScript.

Oggi è arrivato il nuovo Nexus 7, e dato che ci sono forti pressioni affinchè io scriva questa recensione, ecco cosa ne penso dopo poche ore di uso… questa recensione non può essere esaustiva, dato che ho provato solo poche cose ed altre mi aspettano nei prossimi giorni, ma le prime impressioni hanno di certo il loro peso.

Premetto inoltre che questo acquisto non è stato fatto con in mente un caso d’uso specifico, ma semplicemente con la voglia di provare un tablet che fosse venduto ad un prezzo “umano”, ed il fatto che sia 7″ non è male come idea.

Impressioni esterne (i.e., hardware)

Il modello che ho preso, e che peraltro è l’unico che vendono in Italia, è il 16 GB, che se da un lato costa 50 € di più dell’8 GB, dall’altro non dispiace dato che il dispositivo non ha uno slot SD (se vogliamo, unica pecca dell’insieme); esteriormente direi che il tablet è discretamente elegante, ed in portrait si tiene tranquillamente con una mano, con due se volete scrivere qualcosa; non posso fare confronti di peso o sottigliezza con altri tablet, dato che non ne ho mai usati, posso però dire che una custodia è sicuramente necessaria, non tanto e non solo per portarlo in giro, ma anche per avere il modo di tenerlo in verticale: nel momento in cui, infatti, volete metterlo in landscape per vedere un video, dopo qualche minuto la mano si stanca di tenerlo sollevato, e deve quindi essere appoggiato in qualche modo. Amazon vende già diversi modelli di custodia, la scelta non manca di certo.

Un’altra nota riguarda l’altoparlante: è disposto sul retro in basso (portrait), il che vuol dire che se guardate un video in landscape conviene avere delle cuffie, altrimenti l’audio è sbilanciato verso sinistra (o destra) rispetto allo schermo.

La webcam frontale non mi è parsa un gran chè: ho scaricato un’app per avviarla e poterla testare, e la qualità dei video non mi sembra eccezionale (non ho provato a fare foto, dato che essendo frontale non mi sembra una grande idea); d’altro canto, la vera prova del nove è Skype e non ho avuto occasione di provarlo ancora.

Ora, lo schermo: se penso che quest’affare viaggia a 1280×800 in 7″, che è la stessa risoluzione del mio vecchio Asus 15″… anyway, la qualità dell’immagine è spettacolare, direi paragonabile allo schermo di un Mac (e sicuramente superiore al mio HTC, non saprei rispetto ad un iPad), ed i due screenshot riportati sopra dovrebbero dimostrare questa cosa; ho fatto un test all’aperto (su richiesta), e direi che in controluce riflette discretamente il sole o il riverbero del cielo, mentre se rivolto verso una parete in ombra, si riesce a leggere tranquillamente. Direi che da questo punto di vista il mio HTC si comporta meglio (in entrambi i casi con la luminosità dello schermo al massimo), ma d’altronde quest’ultimo non ha uno schermo lucido…

La batteria in questo momento è all’80% dopo 6 ore e mezza di accensione, in cui l’uso reale del dispositivo (ovvero a schermo attivo, gestione della luminosità automatica) penso sia stato qualcosa come 1 ora e mezza – 2 ore massimo, per il resto è rimasto a schermo bloccato ma comunque connesso alla wifi e continuamente sincronizzato con il mondo(TM). Oh, and by the way: il caricabatterie USB fornito spara 2A @ 5V (so che a qualcuno interesserà saperlo…).

Impressioni interne (i.e., software)

Android 4.1.1 (l’ultimo “.1” arrivato al volo dopo 5 minuti dall’avvio) sembra davvero ben curato e sicuramente usabile: nessuno scatto nè sfogliando le app nè i menu nè il Web o altro, gli unici rallentamenti li ho notati con l’app Adobe nello scorrere il pdf riportato in uno dei due screenshot, ma non ho provato l’app integrata per i pdf (magari è ottimizzata meglio).

Non ho ancora esplorato a fondo tutti i menu, ed ho provato quasi esclusivamente le app dei social network (compreso Youtube); i video HD su YT si vedono decisamente bene, non ho provato streaming locale (anche perchè devo ancora configurare decentemente UPnP in casa) e non ho provato musica, che tuttavia non è un mio caso d’uso (per quella ho l’iPod, e comunque fino a che non aprono Google Play/Music/whatever in Italia (sì lo so si può fare comunque con Tor, che sbatti)…).

Una cosa che non avevo mai provato prima è stata la dettatura delle parole, in particolare scrivendo le email (in italiano): funziona direi abbastanza bene, bisogna parlare un po’ con calma (rispetto a me stesso, intendo), ma funziona; non so se/come si possano inserire i segni di interpunzione, ma al momento va bene così. Peraltro, nelle opzioni si può segnare di mettere la cosa in locale (altrimenti credo funzioni solo se connessa).

Ho anche provato a sfogliare un libro con l’app Kindle (c’è anche quella di Google, ma i libri li compro su Amazon, avendo anche un Kindle vero e proprio), e mi sembra si veda piuttosto bene: non che io abbia intenzione di fare grandi letture, ma direi che non è male.

Ora devo trovare qualcosa di buono per scrivere note online e sincronizzarle in giro, se avete consigli fatevi pure avanti; l’ideale sarebbe avere l’integrazione con il programma che già uso (Tomboy), ma la vedo dura…

Concludendo

Direi che il prodotto non è male, e per ora sono discretamente soddisfatto; non faccio ancora i salti di gioia (se li stavate aspettando), mi serve qualche giorno in più di uso ed una custodia adatta prima di poter dare il giudizio ultimo definitivo insindacabile. Siamo comunque sulla buona strada…

Read Full Post »

ADK DemoKit

ADK DemoKit

Con l’aggiornamento del mio HTC Wildfire S ad Android 2.3.5, finalmente ho la possibilità di sfruttare le possibilità offerte dall’Open Accessory kit (ADK), ed ho quindi testato subito l’applicazione demo (ridotta) supportata dalle librerie ufficiali per l’USB Host Shield per Arduino. Il sistema completo richiederebbe un Arduino Mega ed il kit ufficiale distribuito da Google, ma è possibile effettuare qualche progetto più “in piccolo” anche con il semplice Arduino Uno e lo shield offerto da SparkFun, con qualche leggero aggiustamento hardware per rendere compatibile il tutto.

Nella foto il risultato del primissimo esperimento: l’applicazione Android riconosce l’accessorio collegato via USB, anche se nessuno degli elementi previsti (LED, pulsanti etc) non sono collegati al momento… è stato un test rapido, l’esplorazione più approfondita verrà più avanti (appena ho un po’ di tempo da dedicarci).

Read Full Post »

Personalmente amo Android da quando ha trasformato il mio cellulare da “quella cosa irritante che devo portare in giro perché mia moglie possa raggiungermi” in “un pezzo di elettronica realmente utile con cui posso controllare la mia email”. Odio davvero parlare con le persone al telefono, ma una piattaforma mobile per rimanere in contatto attraverso vie differenti è qualcosa di grande. Inoltre avere a disposizione un po’ di videogame per i voli lunghi non è affatto male. Comunque ciò che è veramente importante in merito all’open source è il fatto che Google non abbia alcun bisogno del mio aiuto. Che mi piaccia il mio telefono Android è un fatto relativamente irrilevante. Potrebbero usare Linux indipendentemente da ciò che penso, la cosa giusta da fare, e migliorarlo nel modo che preferiscono. E’ questo l’importante, non Google ed Android. Il fatto che che ognuno possa usare Linux per i propri scopi e possa modificarlo nella direzione che preferisce è importante, come il fatto che non debba chiedere il permesso o firmare un accordo di riservatezza o pagare qualcun’altro. L’Open Source funziona se giochi alla pari con gli altri giocatori, altrimenti no. Ciò è un bene, favorisce una vera competizione sul mercato. Nessuno può fermare gli altri quando tentano di migliorare le cose.

(Intervista completa su Wired.it)

Read Full Post »