• 大小: 0.17M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-01-21
  • 标签: Android  监听  开发  

资源简介

一个简单的Android按键监听程序,通过通过BroadcastReceiver监听Home,电源Power,和音量变化Volume键

资源截图

代码片段和文件信息

package com.spacesoftwares.spacecapture;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumented test which will execute on an Android device.
 *
 * @see Testing documentation
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals(“com.spacesoftwares.spacecapture“ appContext.getPackageName());
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        545  2018-07-27 14:56  .idea\caches\build_file_checksums.ser

     文件       1803  2018-07-27 14:20  .idea\codestyles\Project.xml

     文件        626  2018-07-27 14:20  .idea\gradle.xml

     文件        541  2018-07-27 14:21  .idea\libraries\Gradle__android_arch_core_common_1_1_1_jar.xml

     文件        655  2018-07-27 14:21  .idea\libraries\Gradle__android_arch_core_runtime_1_1_1.xml

     文件        556  2018-07-27 14:21  .idea\libraries\Gradle__android_arch_lifecycle_common_1_1_1_jar.xml

     文件        695  2018-07-27 14:21  .idea\libraries\Gradle__android_arch_lifecycle_livedata_core_1_1_1.xml

     文件        666  2018-07-27 14:21  .idea\libraries\Gradle__android_arch_lifecycle_runtime_1_1_1.xml

     文件        676  2018-07-27 14:21  .idea\libraries\Gradle__android_arch_lifecycle_viewmodel_1_1_1.xml

     文件        543  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_animated_vector_drawable_28_0_0_alpha3.xml

     文件        507  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_appcompat_v7_28_0_0_alpha3.xml

     文件        528  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_asynclayoutinflater_28_0_0_alpha3.xml

     文件        396  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_collections_28_0_0_alpha3_jar.xml

     文件        509  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_constraint_constraint_layout_1_1_2.xml

     文件        433  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_constraint_constraint_layout_solver_1_1_2_jar.xml

     文件        522  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_coordinatorlayout_28_0_0_alpha3.xml

     文件        510  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_cursoradapter_28_0_0_alpha3.xml

     文件        501  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_customview_28_0_0_alpha3.xml

     文件        507  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_documentfile_28_0_0_alpha3.xml

     文件        507  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_drawerlayout_28_0_0_alpha3.xml

     文件        507  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_interpolator_28_0_0_alpha3.xml

     文件        489  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_loader_28_0_0_alpha3.xml

     文件        534  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_localbroadcastmanager_28_0_0_alpha3.xml

     文件        486  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_print_28_0_0_alpha3.xml

     文件        522  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_slidingpanelayout_28_0_0_alpha3.xml

     文件        420  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_support_annotations_28_0_0_alpha3_jar.xml

     文件        513  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_support_compat_28_0_0_alpha3.xml

     文件        516  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_support_core_ui_28_0_0_alpha3.xml

     文件        525  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_support_core_utils_28_0_0_alpha3.xml

     文件        519  2018-07-27 14:21  .idea\libraries\Gradle__com_android_support_support_fragment_28_0_0_alpha3.xml

............此处省略121个文件信息

评论

共有 条评论