Feed on
Posts
Comments

Di recente è uscito un post di Strahinja Marković che mette sotto accusa l’introduzione di javascript nel formato EPUB 3. In un primo momento mi sono trovato d’accordo con le posizioni sostenute in tale post, ma poi mi sono accorto che, per chi ha a cuore i libri scolastici o i manuali universitari del futuro, può trovare in javascript un grande alleato, sia per far evolvere il libro da punto di vista didattico (come ho spiegato in un precedente articolo), sia per migliorare la sua accessibilità.

L’esempio che porterò è quello delle formule: non c’è nulla di meno accessibile di una formula in un libro digitale realizzata con una immagine bitmap. Anche in testi non matematici quando si usa una formula, tale elemento è spesso chiave per la comprensione di un concetto e l’impossibilità di poterla leggere può rendere un testo inutile a fini didattici.

Continue Reading »

Nel dibattito tra governo ed editori, si parla spesso di digitalizzazione dei libri scolastici e spesso questo dibattito si ferma all’analisi dei costi, ovvero di quanto i libri debbano costare meno perché non stampati su carta, senza entrare nel merito di come un libro scolastico dovrebbe essere uno strumento migliore per la didattica sfruttando i potenziali offerti dai nuovi media.

Fino ad ora era difficile pensare a un libro scolastico in formato digitale che non fosse il pdf preparato per la stampa poiché i formati alternativi, come il formato ePub o il formato Mobipocket, non erano assolutamente all’altezza di un compito difficile come quello di rappresentare la complessità espositiva di un libro scolastico.

Di recente, però, è stato presentato il primo draft del formato EPUB 3, evoluzione del formato che attualmente viene utilizzato per la vendita di e-book dai principali editori e piattaforme per il delivery di libri in formato digitale.

Tale evoluzione introduce numerosi elementi innovativi in questo campo che permettono di pensare al libro scolastico o al manuale universitario in modo nuovo, creando i presupposti per far evolvere lo strumento libro anche dal punto di vista didattico.
In questa direzione un esempio è quello di integrare apparati dinamici come possono essere i grafici di una funzione matematica alla quale si possono cambiare i parametri che ne determinano l’andamento.

Continue Reading »

Android local HTML viewer

I recently made a very simple Activity to display an HTML file stored within an Android app. This task could be useful to add an help page to your app without dealing with layouts.

First you need the HTML file you want to display and you have to put it in the res/raw directory of your project. We'll access to this directory with the getResources().openRawResource(int id) method.

Now we need a widget that is able to display an HTML string like the android.webkit.WebView and a layout with this widget inside that will be used by our Activity:

XML:
  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <LinearLayout
  3.     xmlns:android="http://schemas.android.com/apk/res/android" 
  4.     android:orientation="vertical" 
  5.     android:layout_width="fill_parent" 
  6.     android:layout_height="fill_parent">
  7.       
  8.     <WebView android:id="@+id/web_engine" 
  9.         android:layout_width="fill_parent" 
  10.         android:layout_height="fill_parent"/> 
  11. </LinearLayout>



Continue Reading »

I often use the C port knocking client developed by Judd Vinet and I also took inspiration from its code to write a PHP implementation of that.

I recently noticed that, sometimes and more often when I use it on 3G Internet connections, the port knocking authentication fails because (I suppose) the connects tried are too fast and arrive at server in the wrong order. So I thought that inserting a delay between connections could help and, based on my experience, it works great!

So I patched the 0.5 version of Judd's code to add a new parameter (-d) to specify a delay in millis between connections.

Continue Reading »

I know I'm a strange boy, with strange problems (at least wrt software development), but recently I had to solve the problem to build a Java project many many times programmatically changing only few parameters on it. One of the change to do was to rename the main package of the project, the package under which all the classes are declared.
To solve this problem I build a very simple bash script that use sed to rename all the occurrences of the old package name with the new one:

#!/bin/bash

PROJECTPATH=$1

mv $PROJECTPATH/src/it/casarini/oldpackage $PROJECT/src/it/casarini/newpackage
export MYLIST=`find $PROJECTPATH/src -type f -name *.java`
for a in $MYLIST; do
    echo $a
    mv $a $a.orig
    sed s/it.casarini.oldpackage/it.casarini.newpackage/g $a.orig > $a
    rm $a.orig
done;

Ho aggiunto una nuova funzionalità di ricerca all'interno dell'applicazione AiC Mobile per Android (rilasciata con la versione 1.2.0). La funzionlità aggiunta è la possibilità di ricercare nel prontuario dei prodotti senza glutine fornito da AIC semplicemente pronunciando le parole che si vogliono usare come chiavi di ricerca.
La funzionalità introdotta sfrutta le API per il riconoscimento vocale introdotte sulla piattaforma Android dalla versione 1.5 e usa come motore per l'analisi fonetica quello introdotto con Google Search. In particolare, per usufruire della nuova funzionalità si deve avere almeno una app in grado di soddisfare una richiesta di Speech Input (RecognizerIntent.ACTION_RECOGNIZE_SPEECH).
Il miglioramento in usabilità della applicazione è notevole e per darne un'idea, ho realizzato un breve video che ne mostra l'utilizzo:

AiC Mobile è disponibile da agosto sul Market Google e viene costantemente migliorata e aggiornata. Per vedere AiC Mobile per Android sul Market o per scaricarla sul proprio telefonino è possibile usufruire del servizio AppBrain qui sotto evidenziato:

I love hacking on my Android device, the SDK is well designed and there's always a new technology to study, but to give a complete user experience to our applications we need icons! In particular, I found very useful (even if discouraged by the Android guidelines) to use, for the option menu, the icons included in the SDK.
The better web resource I found where you can see which icons are include in the SDK is androiddrawableexplorer but, as his author says, some of them are not public. I don't know why they are not public but for two of them (ic_menu_refresh and ic_menu_home) I found the source so I've been able to include them in a recent work.

GlutenBuster è diventata l'applicazione ufficiale per la piattaforma Android dell'Associazione Italiana Celiachia e ora si chiama AiC mobile.
Con questo post segnalo che ho rilascio la versione 1.0.0 di AiC mobile e che ieri l'ho pubblicata sul Market Google in modo che chiunque sia interessato possa installarla e usufruire del prontuario AIC dei prodotti senza glutine sul proprio smartphone.
AiC mobile per Android è sviluppata come software libero (Free Software) ed è distribuita gratuitamente. Per scaricarsi il database dei prodotti, bisogna però essere registrati sul sito www.celiachia.it per creare un legame con l'associazione che certifica i prodotti.

Come ogni prodotto del volontariato, anche AiC mobile per Android, è il risultato della collaborazione di più persone che ringrazio per il loro aiuto e l'incoraggiamento che mi hanno donato: Luca Agostini, Alberto Carlana, Antonio D'Errico, Anna Ferrandino, Davide Fiorello, Mario Mestice, Antonio Pascuccio, Lorenzo Pino.

Per continuare:

  • Presentazione del programma, delle sue caratteristiche principali, screenshots, video dimostrativo e link per il download.
  • Gruppo per avere supporto tecnico nell'utilizzo dell'applicazione e per segnalare eventuali problemi;
  • Sito di sviluppo collaborativo dove è possibile accedere ai sorgenti e contribuire alle idee di sviluppo e alla stesura del codice.
  • Per installare l'applicazione:

Ho rilasciato la prima versione pubblica di GlutenBuster, app per la piattaforma Android per la consultazione del prontuario AIC degli alimenti senza glutine.

GlutenBuster è sviluppato come software libero (Free Software) ed è distribuito gratuitamente da sito di sviluppo collaborativo.

Sono alla ricerca di persone interessate a partecipare alla fase di test prima della pubblicazione nel Google Market. Se qualcuno fosse interassato può scrivere a glutenbuster@casarini.org.

Per continuare:



I recently made an helper class to download a file from the web and save it to the file sytem while updating a ProgressDialog to let the user know the percentage of the download made. This class has the responsibility to manage the network communication and to send messages to the UI to update the status of the ProgressDialog previously built and displayed.

Before starting to write some code it may be useful to remember to declare in the AndroidManifest.xml the request for the permission to make connections over the Internet and, if we want to save the file on the sd card, the permission to write to the external storage:

XML:
  1. <uses-permission android:name="android.permission.INTERNET"/>
  2. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

The class I wrote is called DownloadThread, extends th java.lang.Thread and a constructor with four parameters:

  • the url of the file to download;
  • the path where the downloaded file has to be written;
  • the instance of the ProgressDialog to update;
  • the handler that will receove the messages to update the UI.
JAVA:
  1. public class DownloadThread extends Thread {
  2.     private static final String TAG = Home.class.getSimpleName();
  3.     private static final int BUFFER_LENGTH = 8192;
  4.    
  5.     private Handler handler;
  6.     private ProgressDialog progressDialog;
  7.     private String fileurl;
  8.     private String filepath;
  9.    
  10.     public DownloadThread(String fileurl, String filepath, Handler handler, ProgressDialog dialog) {
  11.         this.fileurl = fileurl;
  12.         this.filepath = filepath;
  13.         this.handler = handler;
  14.         this.progressDialog = dialog;
  15.     }

Continue Reading »

Older Posts »

Creative Commons Attribution 3.0 Unported
Creative Commons Attribution 3.0 Unported