Google Play服务添加额外的流程并导致额外的内存消耗

时间:2016-03-31 10:52:05

标签: android google-cloud-messaging gcmlistenerservice

我在应用中使用谷歌GCM,它的工作正常,但问题是它增加了额外的流程(参见 Screenpic 显示2流程),名为 Google Play服务(com.google.android.gms)消耗大约 20MB ,这会将应用使用量增加到 28MB

问题 Screenshot of the App Settings View

注意:我没有在 AndroidManifest.xml

中的任何地方使用 android:process

即使关闭应用程序仍然显示1个服务和2个进程

附加流程在哪里?在多个设备中测试过 (奇巧,棒棒糖)

   <receiver android:name=".gcm.services.simple.GcmBroadcastReceiver"  android:permission="com.google.android.c2dm.permission.SEND"    android:exported="true">
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
            <action android:name="android.intent.action.QUICKBOOT_POWERON" />
            <category android:name="com.tempapp" />
        </intent-filter>
    </receiver>
    <service android:name=".gcm.services.simple.GcmIntentService" />
    <service android:name=".gcm.services.listeners.InstanceIDListener" android:exported="false">
        <intent-filter>
            <action android:name="com.google.android.gms.iid.InstanceID" />
        </intent-filter>
    </service>

摇篮:

模块级

  compile 'com.google.android.gms:play-services-appindexing:8.4.0'
  compile 'com.google.android.gms:play-services-gcm:8.4.0'

项目级别

classpath 'com.android.tools.build:gradle:2.1.0-alpha4'
classpath 'com.google.gms:google-services:2.0.0-alpha6'

1 个答案:

答案 0 :(得分:0)

您的应用我不是唯一一个在手机上使用Google Play服务的应用。超过一半的应用程序使用GPS,它可能是其中之一。我不认为这是值得担心的。