Context ctx = getContext(); Display display = ((WindowManager)ctx.getSystemService(ctx.WINDOW_SERVICE)).getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight(); Yes, there are easier ways to retrieve the screen width on Android but there are cases that this long code is the only solution. You may already have the Context. WindowManager or the Display and so it would be [...]
As the big subject now is soccer world cup, the main brazilian team uniform is now available on the project. Here a example of character: Gimp source file: open_chars.xcf
Essa quinta-feira, dia 6 de Maio de 2010, conversaremos sobre Android na palestra “Android: Visão Geral” a partir das 18:30 na Faculdade Evolução (R. Pedro I, 1276, no Centro). A ideia é falar por cima sobre o mercado mobile, o desenvolvimento Android, as possibilidades e os conceitos principais sobre suas aplicações. Maiores detalhes sobre inscrição [...]
29 April, 2010 - 10:29 am
Tags: Class, Java, method, programming, Reflection
Posted in english | 2 comments
import java.lang.reflect.*; public class Foo { public void bar(int param){ System.out.println(param); } public static void main(String args[]){ Object f = new Foo(); try { Method m = f.getClass().getMethod("bar", int.class); m.invoke(f, 42); } catch (Exception e){ System.err.println(e); } } } $ java Foo 42
26 April, 2010 - 5:19 am
Tags: art, arte, foto, Gimp, lagoa, lagoa do banana
Posted in português | No comments
23 April, 2010 - 12:47 am
Tags: art, arte, Gimp, mar, psy
Posted in português | No comments
14 April, 2010 - 10:11 pm
Tags: art, arte, Atlântico, bastos, Gimp, ia
Posted in english | 1 comment
Aquele ali no canto é o Bastos.
14 April, 2010 - 2:46 pm
Tags: art, arte, coco bambu, Gimp, pastel, psy
Posted in english | 3 comments
8 April, 2010 - 1:09 pm
Tags: getruntime, Java, programming, runtime
Posted in english | No comments
I don’t like the approach of calling native shell commands in any language instead of using multi platform libraries, but here is a little prof of concept Java program to call native commands. import java.io.*; import java.util.*; public class Exec { public static void main(String args[]) throws IOException { Process proc = Runtime.getRuntime().e xec(args); BufferedReader [...]
Iterating over a HashMap using the enhanced loop (foreach) in Java is a good way to keep your code smaller, more legible and usually more semantically coherent. import java.util.HashMap; import java.util.Map; class Foo {} public class Main { public static void main(String args[]){ Map<Byte, Foo> mHash; mHash = new HashMap<Byte, Foo>(); [...]
31 October, 2007 - 6:47 am
Por causa da droga das aulas tô impossibilitado de ir. Mas quem quiser dar uma olhada no OpenSolaris e também não pode ir, tem vídeos em inglês no site do OpenSolaris: http://www.opensolaris.org/os/community/documentation/
E a documentação tá BEM melhor que há um ano atrás, quando tentei usar Solaris e desisti. Deve ser coisa do Ian Murdock. :)
31 October, 2007 - 6:57 am
É o Ian está ajudando bastante na parte de deixar as coisas mais fácil para quem está começando no sistema.
Tem aquele artigo dele, “Onde eu baixo o solaris?” que fala sobre isso.