After i turn on my phone, my app crashes and does not open after that.
It just crashed although it is not open.
I don't know what the error because it appears after i turn on my phone and the logcat cannot monitor the phone and i don't see any error.
Receivers:
<receiver
android:name=".AlarmReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
android:name=".ActionReceiver"
android:enabled="true" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
Related
I'm planning to add the notification functionality to my android app, I added GCM through Google Developer Console and I got the API key and I used this key at the server side to send notifications to devices, however my GCM receiver is not working I don't know why, moreover, GCM is not present in my google-services.json.Apart from this, I also sent my device token to the server and it's sent successfully.
I cannot find a clue why I'm not receiving my notifications.
Here's my manifest code:
<permission
android:name="com.example.android.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission
android:name="com.example.android.permission.C2D_MESSAGE" />
<!--Services-->
<!--Service for retrieving device token and sending it to the server side-->
<service
android:name=".utils.RegistrationIntentService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<!--Service for checking updated device token-->
<service
android:name=".utils.GCMInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<!--Service to catch notifications sent from the server-->
<service
android:name=".utils.GcmMessageHandler"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<!--Receivers-->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.example.android.utils" />
</intent-filter>
</receiver>
I have been getting two errors in my log once a notification is received
EnhancedIntentService: Service took too long to process intent: com.google.android.c2dm.intent.RECEIVE App may get closed
EnhancedIntentService: binding to the service failed
There is NOTHING on Google of either of these messages or even EnhancedIntentService.
Relevant code:
<service
android:name="---.GcmMCIntentService"
android:exported="false" >
<intent-filter android:priority="10">
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="---.GCMInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service android:name="---.GCMRegIntentService"
android:exported="false" >
<intent-filter android:priority="5">
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
This is on a 8.0 emulator. Play Services 11.4.2
Let me know if I can show any other code. I just find it curious there is nothing on these error messages at all on S.O. or Google.
We are using Parse Push Plugin https://github.com/taivo/parse-push-plugin with custom parse server. Push messages are coming to the device into GCMService but not rendering. The ParsePushBroadcastReceiver not sure if its being invoked. I don't see any errors in logs.
Also on debugging i see that GCM Receive Intent's are getting called, and not
com.parse.push.intent.RECEIVE , not sure if its default behaviour.
I have the following in AndroidManifest.xml , Also i am using parse android version com.parse:parse-android:1.13.1
<receiver android:exported="false" android:name="github.taivo.parsepushplugin.ParsePushPluginReceiver">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
Any help would be of greatly appreciated
The problem is actually in broadcast receiver in Android marshmallow.
<receiver android:name="CallReceiver"
android:enabled="true"
android:exported="true"
android:stopWithTask="false"
android:permission="android.permission.READ_PHONE_STATE"
android:protectionLevel="signature">
<intent-filter>
<action android:name="YouNeverKill"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE"/>
<action android:name="android.intent.action.NEW_OUTGOING_CALL"/>
</intent-filter>
</receiver>
Because Android-M i.e. 6+ versions require runtime permissions.You can refer below document:
https://developer.android.com/training/permissions/requesting.html
https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en
An Android application for Gear VR using Samsung S6 and S7.
Following implementation is for auto launch on mobile insertion to VR.
AndroidManifest.xml
<activity
android:name=".SplashActivity"
android:theme="#style/SplashTheme"
android:launchMode="singleTask"
android:excludeFromRecents="true"
android:configChanges="orientation|keyboardHidden|screenSize"
android:clearTaskOnLaunch="true"
android:screenOrientation="landscape"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.INFO" />
</intent-filter>
<intent-filter> <action android:name="android.intent.action.proximity_sensor" /> </intent-filter>
<intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> </intent-filter>
<intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" /> </intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="#xml/device_filter" />
</activity>
device_filter.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device vendor-id="04e8" product-id="07d2" />
</resources>
It works but there is problem with Oculus app, sometime my app launch before Oculus app and other time Oculus app appear but my app doesn't launch.
Sometime when our app is open before mounting to VR Oculus app crash saying "Unfortunately, Oculus Home has stopped." due to conflict and system shows dialog.
Those docs are helpful :)
https://developer.android.com/guide/topics/connectivity/usb/host.html
For example this is how we can get details about attached device.
UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);