我想尝试从AS 2.0进行即时运行 - 为此我必须更新到build-plugin到2.0.0-alpha1 - 但是当我这样做时,我不能再对该项目进行gradle-sync,因为我得到了:
Gradle 'SCR' project refresh failed
Error:Cause: com.android.sdklib.repository.FullRevision
Run Code Online (Sandbox Code Playgroud)
任何人都知道原因/解决方法吗?
我正在构建一个Android应用程序,该应用程序利用清单广播接收器来了解设备何时插入.我认为Android 5.0 JobScheduler API是一种更好的方法,但我有一个问题:是否可能在早期版本的Android上使用此API或类似的API?如果不可能,最好的选择是什么(而不是清单广播接收器)?
这必须是4.4,但我没有发现这方面的文件 - 谁知道如何使状态栏/系统ui透明/半透明?
我正在使用Genymotion模拟器在android上开发,但是当我运行它时,会发生以下错误:
genymotion version and virtual device version do not match
Run Code Online (Sandbox Code Playgroud)
这是为了细节 错误
我正在使用Genymotion ver.2.2.0和VirtualBox ver.4.3.12
谁能帮我?
在某些情况下,Android-Lint给了我这个暗示:
此标签及其子代可以替换为一个和复合drawable
我可以在某些地方这样做,但在其他地方,缩放图像很重要,我无法做到.有没有选项可以设置复合可绘制的大小?
我试图让测试(junit和robolectric)在Android项目中工作,但我完全陷入困境.我的主要问题是我用gradle找到的所有测试都以某种方式拉入java插件然后我得到了这个错误:
The 'java' plugin has been applied, but it is not compatible with the Android plugins.
Run Code Online (Sandbox Code Playgroud)
我目前看到的唯一出路是分成测试和应用项目 - 但我想避免这种情况.任何示例/提示都将受到高度赞赏!
在官方文档中没有提到单元测试 - 只有仪器测试 - 但我希望单元测试能够快速获得结果.
有没有办法使用kapt作为androidtest范围?目前我正在从com.neenbedankt.gradle.plugins android-apt迁移到kapt - 这工作正常 - 但我不知道如何为androidTest范围做到这一点 - 所以替换:
apt "com.github.hotchemi:permissionsdispatcher-processor:$permissiondispatcher_version"
apt "com.google.dagger:dagger-compiler:$dagger_version"
Run Code Online (Sandbox Code Playgroud)
同
kapt "com.github.hotchemi:permissionsdispatcher-processor:$permissiondispatcher_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
Run Code Online (Sandbox Code Playgroud)
工作正常 - 但我发现无法迁移:
androidTestApt "com.google.dagger:dagger-compiler:$dagger_version"
Run Code Online (Sandbox Code Playgroud) 我想在Android中开发以下屏幕.
我使用CircleLayout但我仍然无法实现所需的输出.请参阅以下代码和屏幕截图
<com.example.hl.CircleLayout
android:id="@+id/pie"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
custom:dividerWidth="5dp"
custom:innerCircle="@drawable/profile_pic_icon"
custom:innerRadius="50dp"
custom:layoutMode="pie"
custom:sliceDivider="@android:color/transparent" >
<RelativeLayout
android:id="@+id/appt_center_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/appt_center_bg" >
<TextView
android:id="@+id/one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:onClick="onClick"
android:text="APP CENTER"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/meds_cabinet_bg" >
<TextView
android:id="@+id/two"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="onClick"
android:text="MEDS CABINET"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/check_in_bg" >
<TextView
android:id="@+id/three"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="onClick"
android:text="CHECK-IN"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/my_tracker_bg" >
<TextView
android:id="@+id/four"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="onClick"
android:text="MY TRACKERS"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout …Run Code Online (Sandbox Code Playgroud) 有没有办法在不需要用户凭据的情况下查询Play商店的应用程序版本.我知道这个非正式的API:
http://code.google.com/p/android-market-api/
但我不想依赖用户凭据 - 我也可以通过Chrome也以隐身模式访问Google Play网站 - 所以它必须以某种方式可能.但是我找不到任何方法,我不想回避刮擦;-)
我有一个使用fitsSystemWindows的应用程序能够在Navigation-和Status-Bar后面绘制背景 - 不幸的是,SnackBar似乎忽略了容器中的fitsSystemWindows = true.我将问题归结为这个最小的应用程序:

风格:
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowBackground">@color/accent_material_dark</item>
<item name="android:fitsSystemWindows">false</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
布局:
<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"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<Button
android:id="@+id/button"
android:text="@string/hello_world"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
活动:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
Snackbar.make(v,"This Snackbar should fitSystemWindows",Snackbar.LENGTH_INDEFINITE).show();
}
});
}
}
Run Code Online (Sandbox Code Playgroud)
有人知道一些解决方法吗?
我发布了最小的应用程序来显示问题:https: //github.com/ligi/SnackBarFitsSystemWindowProblem
android ×10
annotations ×1
apt ×1
genymotion ×1
google-play ×1
gradle ×1
instant-run ×1
junit ×1
junit4 ×1
kapt ×1
kotlin ×1
robolectric ×1