如何运行Android';L预览应用程序&x27;在最低设备(以前)版本上?
我目前正在安卓工作室工作。我的疑问是,如何在安卓2.2、安卓2.3.3(API 10)等最低版本的设备上运行安卓Studio——“L预览”应用程序 当我使用当前版本作为“L”时,我的“L预览”应用程序在模拟器中运行良好,但它没有在实际设备中运行。(我没有“L预览”设备)。所以,我尝试将Minsdk版本更改为最低版本 build.gradle-“作为“L预览”的最小sdk版本” 要在最低版本上运行此L预览应用程序,只需在build.gradle中进行更改如何运行Android';L预览应用程序&x27;在最低设备(以前)版本上?,android,android-studio,ripple,rippledrawable,Android,Android Studio,Ripple,Rippledrawable,我目前正在安卓工作室工作。我的疑问是,如何在安卓2.2、安卓2.3.3(API 10)等最低版本的设备上运行安卓Studio——“L预览”应用程序 当我使用当前版本作为“L”时,我的“L预览”应用程序在模拟器中运行良好,但它没有在实际设备中运行。(我没有“L预览”设备)。所以,我尝试将Minsdk版本更改为最低版本 build.gradle-“作为“L预览”的最小sdk版本” 要在最低版本上运行此L预览应用程序,只需在build.gradle中进行更改 minSdkVersion 8
minSdkVersion 8
targetSdkVersion 'L'
在layout fab->ie.res/layout/layoutfab中,我创建了一个具有波纹背景功能的图像按钮
layoutfab
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ImageButton
android:id="@+id/fab"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_width="@dimen/fab_size"
android:layout_height="@dimen/fab_size"
android:layout_gravity="bottom|right"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:background="@drawable/ripple"
android:stateListAnimator="@anim/anim"
android:src="@drawable/ic_action_content_new"
android:elevation="4dp"
/>
</RelativeLayout>
ripple.xml
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item>
<shape android:shape="oval">
<solid android:color="#819FF7" />
</shape>
</item>
如果我将minsdkVersion更改为8,那么它将在ripple.xml文件中显示错误
错误是,
错误1:需要API级别21,但当前最低版本为8
错误2:?android:colorControlHighlight需要API级别21(当前最小值为8)
我的怀疑:
是否有其他支持和兼容性库可用于在最低设备上运行“L preview”应用程序?我需要一个连锁反应,当我点击按钮,所以有没有任何其他的可能性运行'L预览'应用程序的连锁反应
如何在最低设备上运行“L预览”应用程序
如何在最低设备上运行“L预览”应用程序
你不能。错误消息中说明了原因:
错误1:需要API级别21,但当前最小版本为8
涟漪效应是通过仅在Android L中可用的API实现的。因此,应用程序不能进行后端口。@rciovati-即使没有支持库也可以吗?所以唯一的办法是我应该在L preview设备上测试这个应用程序吗?@rciovati-好的,谢谢!唯一的可能是单独检查L预览设备,对吗?
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item>
<shape android:shape="oval">
<solid android:color="#819FF7" />
</shape>
</item>