The first “Apples” of my life…
No comments
Well, I’ve decided to start the development of some iPhone applications, just for training and fun. I’ve successfully developed for Windows, J2ME, Gameboy Advanced and something also for the xbox and Playstation portable, and now it’s time to learn another planet: the MACINTOSH! When I was young, people strongly avoid Apple computer because it was poor on software side, and DOS/WIndows was the only way to stay in touch with the Information Technology. Videogames, for example, were 20 years ahead compared with Mac. Now things are radically changed, today we are in the WEB generation, therefore you can have any kind of personal computer (Windows, Linux, MacOS) or phone (Nokia, Sony, Android, iPhone, whatever) with an embedded browser powerful enough to surf on Facebook, mySpace or YouPorn 8) So nowadays, why a Mac should *NOT* be bought? Under a uncontrolled craving to save the world from the economic crisis, I’ve bought a Mac Mini with 4Gb of memory, driven by a 2.26 Ghz Intel Core 2 CPU, wireless keyboard+mouse, VGA adaptor and an iPhone 16 Gb (white): Steve Jobs was happy. Using the apple store was really easy and funny to build my customised PC while the €1184,00 (iPhone excluded) were not easy to digest
Placed the order, checked-out and after a week the package arrives as you can see in the photo shoot behind… Read the rest of this entry »
Trance music: Maor Levi rulez!
18 comments so farI just want to show you a trance music composer on MySpace called Maor Levi. This young boy, at seventeen, has composed one of the best trance tune (IMHO) out there: a track called SHAPES! You can enter into his MySpace page and listen up the tune for free. I don’t know exactly why the trance music isn’t so popular around the world, probably because it lacks on lyrics and sometimes it has “acid” sounds, like the hard trance. By the way, I love this genre of music, even the Vocal Trance which can be considered “commercial”. But … who cares? Ok, if you want waste a bit of time and follow my hint, make a trip into Digitally Imported Radio: an Internet website that stream electronic music (trance, house, techno, hardcore, etc…) for free. Attached in this post you can find a video of another cool trance tune, Deadmau5 - Arguru. Anyone out there love trance music as Enfis??? Please, let me know…
Android: 3D tunnel demo with OpenGL ES
18 comments so farAs promised, here is my personal implementation of a small 3D tunnel demo in Android, with support of OpenGL ES. I have never coded in OpenGL ES before and the first impact was negative, shortly: I don’t like it! Compared with OpenGL (standard version), ES has some limitations, in particular on direct vertex handling. Crudely, the glBegin/glEnd and glVertex## functions are missing. The intensive use of “buffers” (java.nio.Buffer) to render textures and primitives, with all it’s subclasses (ByteBuffer, CharBuffer, DoubleBuffer, FloatBuffer, IntBuffer, LongBuffer and ShortBuffer), is a useless waste of time and memory, in my humble opinion. If you must dynamically build your 3D object, for example to make a morphing mesh like my tunnel, you’ll go crazy. In fact you should hold a copy of vertices in Java memory (for example a float[] array) and a copy of vertices in system memory (a ByteBuffer object instantiated with allocateDirect); then for each frame you must re-calculate the vertices and blit them from the array in Java memory to the buffer in system memory. What the fuck… Alternatively you can use the putFloat method directly on the ByteBuffer object, due to eliminate the Java array, but this is fucking slow compared with a single put method call. I haven’t spent so much time on this topic, probably exists a “cool” method to eliminate that blit phase, please leave me a comment if you knows. I am almost sure, to speed-up an OpenGL system on a mobile device, the best way is hold 3D engine data in system memory, that’s the reason of buffers use. An easy task instead, is hooking the OpenGL surface with a View object. You can also render your OpenGL scene and then write some graphics using the Canvas methods on the same surface: COOL
Next time I’ll do further experiments on OpenGL ES, maybe I’m wrong.
Ok, attached in this post you’ll find the complete source code of my 3D tunnel. Code is not very clean and commented, but you can take a look if you wish: feel free to download and use it. Please, leave me a comment: your ideas will be appreciated!
Used Eclipse IDE with Android SDK version m3-rc37a (Windows system)
Android - Enfis 1-0
No commentsYes, my first (serious) attempt on
platform from Open Handset Alliance and Google was a failure! Android beats Enfis 1-0! Incredible, I’ve coded for Gameboy Advanced, XBOX, Java 2 Micro Edition, PlayStation Portable with success … while Android not! Please man, don’t mess with me, I know that Android platform is cool and really easy to use but today I was not able to clear my screen (a SurfaceView object), in a separate thread, using OpenGL ES. I don’t know if my Java language speaking is so crappy, honestly I’m a “low-lever” and “old-schooler” coder (Asm/C/C++), but I fell embarassed for this. Ok, within next 3-4 days, I’ll try to code a small 3D tunnel demo using OpenGL ES and Android. Now, I’ve got my mission, see you soon, stay tuned…
PS - Eclipse IDE really sux compared with NetBeans.
What the Italians do in office?
3 comments so farWell, if you are not an European, probably you would like to know how Italians spend their time in office. Is a good practice explore different cultures of different countries and it can enrich your life.
Usually, you can think about Italians as “Spaghetti, pizza and mandolino”; otherwise, if you are a fan of the Godfather film, you can think about us like “Mafia, blood and violence”. In both cases, a lot of people, primarly Americans, thinks: “Italians knows best…“. In fact, there are a lot of examples about the cool Italian style in the world, starting from the easiest, like food and wine, then continuing with Ferrari cars, Armani, Versace, Dolce&Gabbana, Gucci and so on. You can also look at the past, if you wish, with the ancient Rome, coliseum and Leonardo Da Vinci. So your curiosity brings you to make the fatal question to Enfis: “What the Italians do in office?”. Yeah, I have the right answer for you man: THEY SLEEP!!!! Attached in this post, there are 2 real examples of what Italian employees do after lunch, in office. These 2 photos was shooted by me and wasn’t prepared as you can think, please trust me: I’ve stolen the instant. Note the advanced level of these sleepers, even a bomb deflagration can’t wake up our heroes… Obviously, if you eat ½ kilograms of pasta (about 1.1 lbs) and 1 liter of wine for lunch, whatcha gonna do? Everything but working
Hey, if you ask this question to an European, you’ll get the same response: Italians sleep like a log
That’s the reason why we have a lot of problems in our “cool” country, now. While the rest of the world plain it’s next businness move, ITALY sleep…
J2ME: how detect Bluetooth API optional package (JSR 82)
5 comments so farSometimes, with a J2ME application, you must detect if the Bluetooth API optional package (JSR 82) is available on target device. For example to dynamically enable or disable networking capabilities of your videogame or to block with an error message, prior execution, your Bluetooth based application. In fact, a J2ME midlet terminates dramatically, if it call an unsupported class or package. Due to the optional nature of this package, I’ve written a small piece of code to detect if the Bluetooth API is available or not on target device. Here is my personal code snippet, embedded in a small MIDlet example. Please leave me a comment if you get troubles or if you have a better solution:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MMain extends MIDlet implements CommandListener
{
private Form form;
// Check if Bluetooth API optional package (JSR 82) is present.
public static boolean hasBluetoothAPI ()
{
try
{
Class.forName ("javax.bluetooth.LocalDevice");
return true;
}
catch (Exception _ex)
{
return false;
}
}
// Return the Bluetooth API version of this device, null if API is not present...
public static String verBluetoothAPI ()
{
// Initialize return value...
String version = null;
// First try with the "System.getProperty" method...
try
{
version = System.getProperty ("bluetooth.api.version");
}
catch (Exception _ex)
{
}
// Make sure version returned is correct...
if ((version != null) && !validVersion (version)) version = null;
// Then try with the "LocalDevice.getProperty" method, if needed...
if ((version == null) && hasBluetoothAPI ())
{
// Here we are sure that BT API is present...
try
{
version = javax.bluetooth.LocalDevice.getProperty ("bluetooth.api.version");
}
catch (Exception _ex)
{
}
// Make sure version returned is correct...
if ((version != null) && !validVersion (version)) version = null;
}
// Finish!
return version;
}
// Check if version string *COULD* be valid...
protected static boolean validVersion (String version)
{
return (version.length () > 0) && !version.equalsIgnoreCase ("null");
}
public MMain ()
{
form = new Form ("Bluetooth detect");
form.addCommand (new Command ("Exit", Command.EXIT, 1));
form.setCommandListener (this);
}
public void startApp ()
{
String ver = verBluetoothAPI ();
form.append ("Bluetooth API: " + (hasBluetoothAPI () ? "present" : "not present"));
form.append ("\r\nAPI version: " + ((ver == null) ? "(none)" : ver));
Display.getDisplay (this).setCurrent (form);
}
public void pauseApp () {}
public void destroyApp (boolean unconditional) {}
public void commandAction (Command arg0, Displayable arg1)
{
notifyDestroyed ();
}
}
Hello world!
No commentsYes, this is the first post of my blog
WordPress correctly mark the first post as “Hello world”, when installed. Every blog should begin with an “Hello world” post, when the blogger is a developer, this becomes a MUST! Here is what Wikipedia says about “Hello world” and this link contains over 300+ code fragments of “Hello world”. As you can see these two words (”hello” and “world”) are very important for every developer.
Well, you’ll flee in a second if you aren’t a developer, because in this blog I’ll talk about hardware, software, programming, technology, hi-tech and all those boring topics about computers… Otherwise, stay tuned, I’ll write something about my work and my life, in short: the history of an Italian developer.
La morte dei PC, la nascita dei PDA: teoria Enfis
3 comments so farIntro
Ebbene si, cari lettori, da oggi dichiaro ufficialmente morto il buon vecchio PC (Personal Computer)! Lo strumento che ci ha accompagnato (almeno) per una parte della nostra vita, che ci ha fatto sognare con i suoi giochi, impressionare con i suoi applicativi ed arrabbiare con i suoi continui errori, oggi è dichiarato ufficialmente morto dal sottoscritto. La datazione esatta della sua morte coincide con l’uscita della tecnologia J2ME (Java 2 Micro Edition) per telefoni cellulari (2001): quel giorno, nel mondo, qualcosa è cambiato. Non disperiamo però, a seguito di un decesso c’è sempre una nuova nascita, è il ciclo della vita non si può evitare, ed il neonato si chiama PDA (Personal Digital Assistant). Devo precisare subito una cosa molto importante, io intendo il PDA come il “telefono cellulare” e/o lo “smartphone“, ossia quel telefono cellulare che ha anche funzioni simil-palmare, attenzione notate bene il grassetto della frase precedente, non ha nulla a che fare con “palmari che hanno anche funzioni di telefono cellulare”. La differenza è sottile, ma fondamentale: i palmari (PocketPC, PalmOS, BlackBerry) hanno già ripercorso gli stessi identici errori commessi dai PC nel passato, si sono destreggiati in modo maldestro sin dal principio, hanno creato una piattaforma di sviluppo troppo confusionaria e vaga, il che ha segnato il loro destino inesorabilmente!
Ora se siete curiosi di seguire la mia autopsia del PC e capire perchè sia morto continuate a leggere, altrimenti se credete che sia un pazzo, chiamate la croce verde e chiudete il browser…
Download 3D tunnel demo source code (618 Kb)