venerdì 27 agosto 2010

Oracle vs Google over heavy use of java in Android

In April 2009 Oracle purchased Sun, and for the rest of story click on the link at the end of page.

in riferimento a: Oracle sues Google over use of Java in Android (visualizza su Google Sidewiki)

Apache Armony - Open Source Java SE

It's an open source java vm under Apache Licence v2 and includes all sources for different O.S. (Windows,Linux etc..etc...)

in riferimento a: Apache Harmony - Open Source Java Platform (visualizza su Google Sidewiki)

giovedì 26 agosto 2010

Open Source Bluetooth classes for Java

BlueCove try to become java standard for bluetooh application.

in riferimento a: BlueCove - BlueCove JSR-82 project (visualizza su Google Sidewiki)

venerdì 13 agosto 2010

HTML 5 new TAG

HTML evolution gives us two new tags for managing multimedia audio/video format on a web site.

in riferimento a: How HTML 5 Makes Using Audio and Video in Web Pages Easy (visualizza su Google Sidewiki)

giovedì 12 agosto 2010

Multi thead accessing via java


public class ThreadIDMain extends Object implements Runnable {
private ThreadID var;

public ThreadIDMain(ThreadID var) {
this.var = var;
}

public void run() {
try {
print("var.getThreadID()=" + var.getThreadID());
Thread.sleep(2000);
print("var.getThreadID()=" + var.getThreadID());
} catch (InterruptedException x) {
}
}

private static void print(String msg) {
String name = Thread.currentThread().getName();
System.out.println(name + ": " + msg);
}

public static void main(String[] args) {
ThreadID tid = new ThreadID();
ThreadIDMain shared = new ThreadIDMain(tid);

try {
Thread threadA = new Thread(shared, "threadA");
threadA.start();

Thread.sleep(500);

Thread threadB = new Thread(shared, "threadB");
threadB.start();

Thread.sleep(500);

Thread threadC = new Thread(shared, "threadC");
threadC.start();
} catch (InterruptedException x) {
}
}
}

class ThreadID extends ThreadLocal {
private int nextID;

public ThreadID() {
nextID = 10001;
}

private synchronized Integer getNewID() {
Integer id = new Integer(nextID);
nextID++;
return id;
}

// override ThreadLocal's version
protected Object initialValue() {
print("in initialValue()");
return getNewID();
}

public int getThreadID() {
Integer id = (Integer) get();
return id.intValue();
}

private static void print(String msg) {
String name = Thread.currentThread().getName();
System.out.println(name + ": " + msg);
}
}


in riferimento a: Thread ID : Thread Attributes « Threads « Java (visualizza su Google Sidewiki)