小编Cod*_*oga的帖子

Android Studio不会检测.aidl文件

我从互联网上找到了一个样本(https://github.com/manishkpr/Android-AIDL-Example)并在Android Studio上运行,它运行良好.

但是现在当我尝试重新创建项目时,无论我放在哪里,Android Studio都无法识别.aidl文件.任何人都可以告诉我在Android Studio中放置.aidl文件的正确位置是什么?

ps我已将以下代码添加到build.gradle并将.aidl文件放在java目录中,但未能使其正常工作.

sourceSets {
main {
    aidl.srcDirs = ['src/main/java']
}
Run Code Online (Sandbox Code Playgroud)

aidl android-studio

17
推荐指数
3
解决办法
3万
查看次数

如何在Android模拟器中模拟陀螺仪

我正在尝试研究与陀螺仪相关的东西.我的手机没有内置陀螺仪.有没有办法在模拟器中包含陀螺仪功能,至少要使仿真器设置为具有真实陀螺仪的行为?

ps我不需要从陀螺仪读取任何值,我只是希望模拟器认为它有一个.

我已经彻底搜索了所有我发现的是:http://code.google.com/p/openintents/wiki/SensorSimulator

但这并不能让仿真器感觉它有内置的陀螺仪,而是在仿真器中运行应用程序并从"SensorSimulator"中模拟的传感器获取读数.

任何信息都会有帮助

android emulation gyroscope

9
推荐指数
2
解决办法
1万
查看次数

无法解决:com.firebase:firebase-client-android:2.3.1

我正在研究下面博客中的Sample

https://www.firebase.com/blog/2015-10-01-firebase-android-app-engine-tutorial.html

添加依赖项后,项目无法编译

compile 'com.firebase:firebase-client-android:2.3.1'
Run Code Online (Sandbox Code Playgroud)

其他依赖项编译没有任何问题.

'com.android.support:appcompat-v7:23.0.1'
'compile 'com.android.support:design:23.0.1'
Run Code Online (Sandbox Code Playgroud)

我哪里错了?

这是我的模块build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.tri.todoapp"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
//    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.firebase:firebase-client-android:2.4.0'
}
Run Code Online (Sandbox Code Playgroud)

顶级gradle

// Top-level build file where you can add …
Run Code Online (Sandbox Code Playgroud)

android firebase android-gradle-plugin

6
推荐指数
1
解决办法
2万
查看次数

Android:“androidTest”的单独资源

我想在运行测试时使用单独的资源集,因此我在中设置了一个名为“configs.xml”的文件

\n\n
\n

'src/androidTest/res/values'

\n
\n\n

并将其添加到 gradle

\n\n
\n

sourceSets {\n androidTest {\n resources.srcDirs = ['src/androidTest/res'] }\n } }

\n
\n\n

但是当我尝试使用以下行获取资源时

\n\n
\n

String s1 = getInstrumentation().getContext().getResources().getString(R.string.test_config);

\n
\n\n

我收到以下错误

\n\n
\n

01-08 18:06:13.814 16761-16774/com.example.hellodroid I/TestRunner\xef\xb9\x95 android.content.res.Resources$NotFoundException:字符串资源 ID #0x7f070008\n 位于 android.content.res。 Resources.getText(Resources.java:1382)\n 位于 android.content.res.Resources.getString(Resources.java:1476)

\n
\n\n

有人可以指出我哪里错了吗?

\n

android android-resources android-testing

5
推荐指数
1
解决办法
1505
查看次数

查找设备支持的触摸次数

有什么方法可以找出设备支持的触摸次数。有没有办法以编程方式找到值,而不是手动触摸并找出实际值?

android multi-touch touch

1
推荐指数
1
解决办法
309
查看次数

Android分割操作栏图标仅在底栏中

我想强制将图标放在Android的分割操作栏的底栏中,同时确保顶部操作栏保持为空.我已经做了很多实验,但还是没能弄清楚如何做到这一点.

我确信这是可能的,因为我已经在Google地图应用中看到了它.见下图:

拆分动作栏图标http://imageshack.us/a/img856/3592/portraito.png

android android-ui android-actionbar

0
推荐指数
1
解决办法
3521
查看次数

卸载我自己的其他应用

我想知道是否可以从我自己的应用程序中卸载其他应用程序。Android 操作系统允许我们这样做吗?

在 stackoverflow 上遇到类似的问题

但是在上面的问题中,app A 是系统管理员。就我而言,我的应用程序是一个普通的应用程序。系统管理应用程序和常规应用程序有什么区别?

permissions android uninstallation

0
推荐指数
1
解决办法
1094
查看次数

Android:ImageView底部带有TextView

我试图在图像下面放置一个带有标签的图像,我一直在尝试很多但是无法阻止图像和文本重叠,这是我的layout.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:gravity="center"     >

<ImageView
        android:id="@+id/grid_item_image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingTop="15dp"
        android:paddingLeft="15dp"/>


<TextView
        android:id="@+id/grid_item_label"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:gravity="center"
        android:singleLine="true"
        android:layout_marginLeft="20dp"
        android:paddingLeft="15dp"
        android:textSize="20dp">
</TextView>
Run Code Online (Sandbox Code Playgroud)

android android-layout

0
推荐指数
1
解决办法
5258
查看次数

停止超时活动

我开始了ActivityBActivityA使用startActivity(intent),然后我开始CountDownTimer.现在暂停,我想结束ActivityBActivityA再次拥有前景.是否有可能阻止Activity另一个?

android android-activity

0
推荐指数
1
解决办法
3233
查看次数