Entradas

Mostrando entradas de noviembre, 2021

How to fix Android emulator "System UI isn't responding"

 1.Open AVD Manager.  2.Click to edit button for your device.  3. Wipe data 4. Relaunch your emulator.

Idea storming for a game? How?

How do you make idea storming? I've tried to take a fixed time every day to squeeze my brain, but it isn't particularly effective. Many ideas just come as I'm in the bed or in the bathroom. What is the correct way to do brainstorming?

Android programming is a shithole (part I)

 How do you get the screen dimmensions in Android? You could say that this code would work: DisplayMetrics displayMetrics = new DisplayMetrics (); getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); int height = displayMetrics.heightPixels; int width = displayMetrics.widthPixels; Well, no. Not quite. The returned height is not always the screen height because it includes things like the height Android buttons take and etc.  You have to resort to tricks like creating a View that takes all the screen and reading its height instead.  Simple, isn't it? No it isn't. You can't read a View dimmensions just like that, because the View isn't actually drawn until much later than you do the SetContentView . You have do to asycronous things like: final View view= //smth; ... view.post( new Runnable () { @Override public void run () { view.getHeight(); //height is ready } });