android-8.0-oreo

Foreground service not receiving location updates in Doze mode in Android O

风流意气都作罢 提交于 2019-12-01 07:01:25
问题 I have a foreground service that needs to get a single location update. It is started by a specific broadcast, and upon starting it simply does a request on our backend. When it receives another broadcast, it requests a location update (once), does another backend request and then stops itself. Edit: to clarify, the service itself does the location updates and backend requests. It is independent from the main app in that regard. This works well on Lollipop and Marshmallow, both when the phone

Permanent services on android oreo

独自空忆成欢 提交于 2019-12-01 06:58:52
问题 Android 8's battery consumption improvements are nice to the user but I am a bit afraid if my service will work as expected. First of all: Thank you for any suggestions but I cannot just schedule my service. I want to make a OK Google -like keyword listener running in the background all the time. It will be based on the open source pocketsphinx-android library. I know that this will consume much battery power and I will inform the user about this. Can we create a permanent background service

Package id platform: android-O not available

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 04:47:25
While trying to clone Android O sample from github, project can't able to sync and give below error. Android studio give package unavailable , which can't able to install missing platform (android o). I am using android studio 2.3 and cloning android o example: https://developer.android.com/preview/o-samples.html#nc Can any one suggest, how can I able to run cloned example? To add the Android O items to Android Studio 2.3, I had to temporarily switch to the Canary channel in Android Studio: Then, in the SDK Manager, I could download the O Developer Preview items: ...along with the 26-rc1 build

How to check if a service is running on Android 8 (API 26)?

回眸只為那壹抹淺笑 提交于 2019-12-01 04:45:28
I had some functionalities of my app broken once upgrading to Android 8, even not targeting the API 26 explicitly. In particular, the good old function to check if a Service is running (as documented on StackOverflow here: How to check if a service is running on Android? ) is not working anymore. Just to refresh our collective memory, it was this classic method: private boolean isMyServiceRunning(Class<?> serviceClass) { ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { if

Android O - fingerprint gesture callback not working

谁说胖子不能爱 提交于 2019-12-01 03:52:33
I am testing on Pixel device with Fingerprint Gestures ON from accessibility. I am trying to get the gesture callbacks using FingerprintGestureController but never getting any gestures in return even after I turn the accessibility ON for this app from Settings->Accessibility. isGestureDetectionAvailable() is always returning false to me. Can someone please help. Here is the code: my_gesture_service.xml <accessibility-service xmlns:android="http://schemas.android.com/apk/res/android" android:accessibilityFeedbackType="feedbackGeneric" android:accessibilityFlags="flagDefault" android

Receiving broadcast from notification on Android Oreo

吃可爱长大的小学妹 提交于 2019-12-01 02:59:31
I have a custom button in a sticky notification. I used to attach a PendingIntent to it for receiving button clicks: Intent intent = new Intent(); intent.setAction("com.example.app.intent.action.BUTTON_CLICK"); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 2000, intent, PendingIntent.FLAG_UPDATE_CURRENT); contentViewExpanded.setOnClickPendingIntent(R.id.button, pendingIntent); When i run this code on Oreo , i get BroadcastQueue: Background execution not allowed in logcat and don't receive button click. I registered receiver with manifest: <receiver android:name="

Media controls notification emits alert on Android O

笑着哭i 提交于 2019-12-01 02:18:08
问题 Ever since adding support for Android O, Android devices running O receive an alert (tone or vibration) whenever my app's media controls notification gets updated (metadata or playback state changes). I'm looking for a way to disable this alert since it's not applicable to media style notifications. Here is the code I use to create a media controls notification: MediaDescriptionCompat description = metadata.getDescription(); String artistName = metadata.getString(MediaMetadataCompat.METADATA

android.permission.ANSWER_PHONE_CALLS How I can use? for auto answer

隐身守侯 提交于 2019-12-01 01:15:18
As per android developer documentation Android 8.0 (API level 26) introduces several new permissions related to telephony: The ANSWER_PHONE_CALLS permission allows your app to answer incoming phone calls programmatically. To handle an incoming phone call in your app, you can use the acceptRingingCall() method. How my app give voice answer to incoming call ? but I have not found any guide or examples about of this . so I want automatic answer with voice(from raw folder in app) (I have need guide or example code like answering machine) https://developer.android.com/reference/android/telecom

Registering BOOT_COMPLETED receiver in Android 8

时光毁灭记忆、已成空白 提交于 2019-11-30 22:52:41
问题 We are about to update our App Android API 26. In the documentation about Broadcast receiver it says that Apps that target Android 8.0 or higher can no longer register broadcast receivers for implicit broadcasts in their manifest Implicit broadcast receivers are described as a broadcast that does not target that app specifically. For example, ACTION_PACKAGE_REPLACED So I assume that android.intent.action.BOOT_COMPLETED is considered an implicit receiver. Further it states that implicit

Receiving broadcast from notification on Android Oreo

戏子无情 提交于 2019-11-30 22:49:37
问题 I have a custom button in a sticky notification. I used to attach a PendingIntent to it for receiving button clicks: Intent intent = new Intent(); intent.setAction("com.example.app.intent.action.BUTTON_CLICK"); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 2000, intent, PendingIntent.FLAG_UPDATE_CURRENT); contentViewExpanded.setOnClickPendingIntent(R.id.button, pendingIntent); When i run this code on Oreo , i get BroadcastQueue: Background execution not allowed in logcat