How to emulate a gyroscope in an Android Emulator

Gyroscope is newly supported in the Emulator of Android Studio 3.0, released to the Canary Channel on 5/17/17. Note that (as of today) Android Studio 2.3.3 is the latest official (i.e. “stable”) version. Here is how you setup the Preview Version of Android Studio, which can exist concurrently with the official version. Note that running the emulator out of … Read more

android edittext onchange listener

First, you can see if the user finished editing the text if the EditText loses focus or if the user presses the done button (this depends on your implementation and on what fits the best for you). Second, you can’t get an EditText instance within the TextWatcher only if you have declared the EditText as … Read more

How to “wait” a Thread in Android

You need the sleep method of the Thread class. public static void sleep (long time) Causes the thread which sent this message to sleep for the given interval of time (given in milliseconds). The precision is not guaranteed – the Thread may sleep more or less than requested. Parameters time The time to sleep in … Read more

Android dismiss keyboard

You want to disable or dismiss a virtual Keyboard? If you want to just dismiss it you can use the following lines of code in your button’s on click Event

Android ADB doesn’t see device

I tried all the ways listed on the web for a whole day, but I didn’t get any solutions. Then, I followed a link and in just two minutes my problem was solved! By the way, it’s for Windows users! Find out the vendor id of the device from device manager.To do this, connect the … Read more

Aspect Ratio with 800×480

800×480 is the most common resolution on Android powered devices. Your aspect ratio would be: 5:3 (which is the same as 800:480 just put in its simplest form). All your graphics should be created on a composition with the size 800×480, not to have stretched graphics when you run your game. I would suggest you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)