Novità:
ho trovato un modo per creare un'App Android per visualizzare i palinsesti sky.
Questo file esempio in HTML5 scarica ed elabora il file JSON contenente la lista dei canali del genere "intrattenimento":
Codice:
<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.3.1.js">
</script>
<script>
function doDataLink(data) {
Android.dataLink(data);
}
</script>
</head>
<body>
<script>
/*
STRINGA_GENERE = "http://guidatv.sky.it/app/guidatv/contenuti/data/grid/grid_GGGGGGGG_channels.js"
STRINGA_CANALE = "http://guidatv.sky.it/app/guidatv/contenuti/data/grid/AA_MM_GG/ch_CCCCCCCC.js"
STRINGA_EVENTO = "http://guidatv.sky.it/EpgBackend/event_description.do?eid=EEEEEEEE"
STRINGA_MENSILE = "http://guidatv.sky.it/EpgBackend/getprogrammazione.do?idprogramma=" ' Seguita da id interno programma
*/
$( document ).ready(function() {
var filename = "test.json";
var ChannelList = "";
var ChannelName;
var ChannelNumber;
var ChannelId;
var ChannelServiceNumber;
$.getJSON(filename, function(FileContents){
$.each(FileContents, function(i, item) {
ChannelName=FileContents[i].name;
ChannelNumber=FileContents[i].number;
ChannelId=FileContents[i].id;
ChannelServiceNumber=FileContents[i].service;
ChannelList=ChannelList + ChannelNumber + ": " + ChannelName + " (" + ChannelId + "," + ChannelServiceNumber + ")\n";
});
alert (ChannelList);
doDataLink(ChannelList); // Send data to RFOBASIC
});
});
</script>
<br>
<br>
<br>
<a href="http://www.google.it">Test link</a>
</body>
</html>
Per poter funzionare, il file HTML richiede il file jquery-1.3.1.js nella sua cartella.
Inoltre, il file HTML contiene una chiamata alla funzione
doDataLink(data) , molto specifica, che serve a passare parametri al parser HTML incorporato nel linguaggio
RFOBASIC, che permette appunto di programmare i dispositivi Android in BASIC invece che in Java o C++ , quindi in modo molto più semplice.
Il programma RFOBASIC che legge questi dati è semplicemente questo:
Codice:
!!
This program demonstrats some
of the possibilities
when using the BASIC! html commands.
!!
! html must be opened before doing
! any html command
HTML.OPEN
! Load the file, htmlDemo1.html
HTML.LOAD.URL "android-rfobasic-json.html"
!The user now sees the html
! We can now monitor the user
! actions
xnextUserAction:
! loop until data$ is not ""
DO
HTML.GET.DATALINK data$
UNTIL data$ <> ""
print "Dati ricevuti: "
print data$
Affinchè il tutto possa funzionare, il file HTML si deve chiamare android-rfobasic-json.html e risedere nella cartella /rfo-basic/data .
Inoltre, nella stessa cartella ci deve essere il file "test.json" scaricato dai server sky (ad esempio da
http://guidatv.sky.it/app/guidatv/contenuti/data/grid/grid_cinema_channels.js ), oppure lo si può scaricare direttamente, se il dispositivo lo permette, sostituendo
"test.json" con
"http://guidatv.sky.it/app/guidatv/contenuti/data/grid/grid_cinema_channels.js" nel file HTML.
Il resto è lasciato alla fantasia del programmatore!
Inoltre, in questo vecchio Thread si parla di una macro compatibile con OpenOffice:
http://www.htpcpoint.it/forum/index.php?topic=463.msg3485#msg3485