Android Studio: emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed!

When you first tried to run your Android Virtual Device to startup, you might run into this error message: emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed! You need to: 1. Install the Intel HAXM emulator. In […]

Ubuntu: how to install Android Studio on Ubuntu 15.10

Install the Open JDK8 on Ubuntu. Go to terminal, type: sudo apt-get install openjdk-8-jdk. Install the lib32stdc (you only need lib32tdc++6 for Ubuntu 15.10, without it, you will see android studio show an error unable to run mksdcard-sdk…) To install, in terminal type: sudo apt-get install lib32stdc++6 Go to browse and open link: http://developer.android.com/sdk/installing/index.html?pkg=studio Click on […]

How to use Android Preference

Android provided a class that makes it easy to implement your preference screen. In this example, I’m going to show you how to easily put in some preference/ settings options in your own android app. 1. You need to create an XML file (something called: userpreference.xml) in the /res/xml/ folder.   2. You simply need […]

Taking a Picture with Camera (using built-in intent)

This example shows you easiest way to instruct Android to run Camera app (comes with android system) to take a photo and returns. import needed for this to work: import java.io.File;   import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; private constants & variable uses in the class: private static int […]

Simple Gesture – Fling

In Android, it’s very easy to implement a simple gesture such as Fling (the action of your finger wipe across the screen in a straight line). for the Event onFling, if you don’t have code to handle finer gesture detection, such as taking into account x,y and velocity, Fling would work whether you swipe up and down […]

Some Android built-in Intents

Examples of how to use some Android built-in intents. public static void invokeWebBrowser(Activity activity) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.google.com")); activity.startActivity(intent); } public static void invokeWebSearch(Activity activity) { Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); intent.setData(Uri.parse("http://www.google.com")); activity.startActivity(intent); } public static void dial(Activity activity) { Intent intent = new Intent(Intent.ACTION_DIAL); activity.startActivity(intent); }   public static void call(Activity […]