android-8.0-oreo

Android Notification Actions with Notification Channeling

情到浓时终转凉″ 提交于 2019-12-24 09:58:57
问题 I am working on an application where we have to generate a notification with action buttons. It was working fine till the date we decided to update our notification handling to support notification channels (released with Android Oreo 8.0). I don't know if this is the reason or there is something missing in our implementation that made notification action buttons unResponsive. Below mentioned is the code snippet... NotificationCompat.Builder localCallNotificationBuilder = new

How to use Google Maps Android API by Google Play Services 11 on an Emulator with Android 8

你离开我真会死。 提交于 2019-12-24 08:21:59
问题 I want to run my Google Maps Application on an Android 8 Emulator. As Google is suggesting, one should use the Google Maps Android API provided by the Google Play Services in the Version 11. For this I put compile 'com.google.android.gms:play-services-maps:11.0.0' in my gradle file. When I start my emulator with android 8 its only providing google play services with version 10.9.30 and the map is not showing up. I'm running the emulator with android studio 2.3.3 on Mac. How can I get my

What happens if I run an Android thread in the background indefinitely

自闭症网瘾萝莉.ら 提交于 2019-12-24 08:04:46
问题 Android docs indicate that Oreo has new restrictions on background execution: https://developer.android.com/about/versions/oreo/background. This seems reasonable and they're clearly aiming to make their platform more like iOS and prevent apps running rampant in the background. The thing that's unclear to me (in fact, not documented at all) is what can you do on a thread when the UI goes to the background. Specifically, GIVEN I create a thread with new Thread(() -> { // Naughty thread doing

Failed to fire broadcast receiver in Android Oreo

余生长醉 提交于 2019-12-24 05:52:44
问题 Using SyncAdapter and AbstractThreadedSyncAdapter https://riptutorial.com/android/example/32303/sync-adapter-with-every-min-requesting-value-from-server- I have registered receiver in manifest and from SyncAdapter broadcast register its working fine before Oreo but in Oreo, broadcast receiver failed to fire. Intent intent = new Intent(); intent.setAction("package.qa.ACTION_SYNC"); intent.putExtra("OUTBOX_ID", outboxId); intent.putExtra("JSON_RESPONSE", jsonResponse); intent.putExtra("TRANS

Failed to create directory in Android Oreo (API 26)

邮差的信 提交于 2019-12-24 04:24:11
问题 I have already read the documentation for Android Oreo's Behavior and changes. I know there is different procedure to create file directory for Android Oreo (API 26) Code : File mediaStorageDir = null; if (Build.VERSION.SDK_INT >= 26) { mediaStorageDir = new File(Environment.getExternalStorageDirectory().toString(), "MyDirectory"); Log.v("HEREEEEE","YES"); } else { mediaStorageDir = new File(Environment.getExternalStorageDirectory().toString() + File.separator + "MyDirectory"); } if (

How to offer actions of my app to other apps, via Smart-Linkify (AKA “smart text selection”)?

偶尔善良 提交于 2019-12-24 02:07:59
问题 Background For some time, as a user, I've noticed that on some apps I can perform common operations on partial texts, as such: This is called "smart text selection" (video here), and it has being around from Android O, as shown here. The problem Recently Google has shown how to make your app show the actions within itself (meaning inside its TextView). This is called "Smart-Linkify" and the video about it can be found here. It shows there how to show the actions: What I can't find is how to

HTTP Volley headers in Android 8.0

元气小坏坏 提交于 2019-12-24 00:48:30
问题 Since Android 8.0 has been released, I have problem with authorization header. Is there any other way to add header into Volley request? This doesn't work properly on the last Android version. @override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> params = new HashMap<String, String>(); params.put("x-api-key", App.apiAuth); return params; } Update: It's work fine on all devices but Android 8.0. In Android studio simulator for 8.0 it works too. So,

Default priority of notification channel on Android 8

江枫思渺然 提交于 2019-12-23 20:08:41
问题 I am in the process of changing the target SDK version to 26 and trying to use notification channels. I have some notifications for which I would like to hide the icon in the notification bar. Is this possible by default using Notification channels? Even if I set the channel's importance (and the notification's priority to MIN), the icon is displayed. I can then long click the notification and go to the system settings for notifications in my app. Then click the notification channel and then

onMessageReceived in android O not called when app in background

我怕爱的太早我们不能终老 提交于 2019-12-23 12:16:57
问题 I am sending data payload notifications from my server. here is example: url= "https://fcm.googleapis.com/fcm/send" { "to" : "userToken", "data" : { //some json here } } in such way i am successfully sending messages to users, even if app isn't running, in all pre Android O devices. But on Android O device, onMessageReceived not called when app is not launched... is there some new rules in O ? how it can be fixed? thanks! UPDATES This question is not about notifications, but about firebase

Notification not showing up in Android O despite creating a channel

本秂侑毒 提交于 2019-12-23 07:46:24
问题 This is my code given below. This is unable to create any notifications on Android O, inspite of creating the Notification Channel. private void weatherNotification(WeatherInfo weather) { Intent intent = new Intent(this, WeatherActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0); String temperatureScale = prefs.getUnits().equals("metric") ? getString(R.string.c) : getString(R.string.f); String speedScale = prefs.getUnits().equals("metric") ? getString