Do not detect device in java.

It has been done in C source.
remove unused variables.
Remove inject() function.