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…
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…
$bric = array(“Brazil”, “Russia”, “India”, “China”); $ric = $bric; // array copy $br = array_shift($ric); // left shift at $ric. $br stores “Brazil” print_r($bric); //…
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…
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…
Getting the Android’s AlarmClock application source from official repositories: git clone git://android.git.kernel.org/platform/packages/apps/AlarmClock.git To get the head version for an old platform like the 1.4 (codename…
This is a simple program I wrote called Who Am I that shows informations about the device which it is running. Which can be useful…
Here is a simple server for those who are starting studying sockets or just needs a simple socket server example for reuse while writing your…
Today I was programming a toString method for a class widely used in a application, using the very useful String.format that provides a C’s like…
O pre-requisito é o notify-send, um utilitário de linha de comando do libnotify. No Ubuntu: sudo aptitude install libnotify-bin E aqui o script em si:…