Sunday, October 19, 2014

How to run Android 5.0 samples in Android Studio

(1) Install Android 5.0 and Android SDK Build-tools to 21.0.1 using the latest Android Studio


(2) Download the samples from github
say from https://github.com/googlesamples/android-RecyclerView
and use Import Project in Android Studio


(3) Install HAXM if you run emulator in Windows
After you download it make sure you run the setup located in:
{SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe

If you get the error "VT not supported" during the installation disable Hyper-V on windows features. You can execute this command as administrator dism.exe /Online /Disable-Feature:Microsoft-Hyper-V. You will also need "Virtualization Technology" to be enabled on your BIOS.


If you are using Mac OSX 10.10 Yosemite, run this (to allow ALL UNSIGNED KEXT to be loaded)
sudo nvram boot-args="kext-dev-mode=1"
and reboot before installing the package in
{SDK_FOLDER}/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM_1.1.0_for_10.10.dmg


(4) setup AVD like below
Choose Intel Atom X86 and with Ram 768M (for Windows). You can use 2G for Mac


(5)change build.gradle file compileSdkVersion to 21 and buildToolsVersion to "21.0.1"
and also change AndroidManifest.xml file android:minSdkVersion= to "13"


No comments: