Android L Developer Preview is an early release of the upcoming Android platform. This post shows how to get your development environment ready, how to create a simple app & how to use Material Design theme.
(1) Run Android SDK Manger Update
- Run Android SDK Manager.
- Under Tools section, select the latest Android SDK Tools, Platform-tools, and Build-tools.
- Select everything under the Android L Developer Preview section
- Click Install packages…
- Accept the Licensing Agreement for all of the packages and click Install
(2) Configuring AVD or Emulator
- Star Android Virtual Device manger (AVD)
- Click Create…
- Use the following settings:
- AVD Name: pick a name e.g. L-Preview
- Device: Either Nexus 5 or Nexus 7
- Target: Android L (Preview) – API Level L
- CPU: Intel Atom (x86)
- Run the Emulator (it may take long time the first time you run it)
( 3 ) Create Your First Android L Project
- Create a new Project use the following settings:
- Application Name: Android L
- Project Name: android-L-preview
- Package Name: com.panayiotisgeorgiou.android.L
- Minimum SDK: L Preview
- Target SDK: L Preview
- Click Next
- When you reach Activity window Select Empty Activity
- Click Finish
- If the MainActivity is not created under src folder, right click on the project and select New >> Other >> under Android select Android Activity >> Empty Activity
(4) Use The new Material Theme
- res/values/styles.xml
<resources> <style name="AppTheme" parent="android:Theme.Material.Light"> </style> </resources>
- AndroidManifest.xml
Notice: minSdkVersion=”L”
<?xmlversion="1.0"encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.panayiotisgeorgiou.android.L" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="L" android:targetSdkVersion="21" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
This article used to create a simple app and how to use Material Design theme & how to get your development environment ready.