I'm new to android
app developing and I'm following these step from Set up a GCM Client App on Android in the line 29
,36
it keep saying cannot resolve symbol MyGcmListenerService
and cannot resolve symbol
MyInstanceIDListenerService
.
<service
android:name="com.example.MyGcmListenerService" <<<<<<<<<<<<<<<<<<<<<this
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="com.example.MyInstanceIDListenerService" <<<<<<<<<<<<<<<<<<<<<this
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
Do I have to make these files ? and how to make the file ? or another way how to solve this problem
I'm really sorry if this question is too simple, but I have been stuck with this problem for a few days so I really appreciate for all the answers
You have to write your own Java class for MyGCMListenerService and MyInstanceIDListenerService, and include it under Manifest.xml like this.
<service
android:name="<package-name>.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="<package-name>.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With