android-8.0-oreo

Setting up Gradle for api 26 (Android)

家住魔仙堡 提交于 2019-11-27 17:41:03
Since I have upgraded my Nexus 5x to Android O DP3 I am not able to test my applications. I get the error for not having configured my Gradle-file to work with the new API-level (26). So I changed this and the dependencies, but I keep getting errors on ALL my support libraries like Failed to resolve: com.android.support:design:26.0.0-beta2 Clicking on Install repository and sync project Pops up a progressdialog for downloading the right dependency but does not remove the error. Cleaning up project, installing repositories and then rebuilding the project won't work either. appcompat-v7 On

Android Oreo notification keep making Sound even if I do not set sound. On Older version, works perfectly

允我心安 提交于 2019-11-27 15:39:55
问题 So I am making my app compatible with Oreo and facing issue with notification. I added notification channel according to documentation and everything is working smooth except notification keep making sound on every posting, tried setting defaults to 0 as well. I am testing my app in emulator, any help is highly appreciated. Used this code for creating channel NotificationCompat.Builder builder = new NotificationCompat.Builder(PlayerService.this, "channel_01") .setAutoCancel(false)

Broadcast receiver registered in manifest not getting called in Android Oreo

夙愿已清 提交于 2019-11-27 15:38:05
I have registered following receiver which is not getting called in Android Oreo but works on lower version devices. <receiver android:name=".common.receiver.ConsultReceiver" android:exported="false"> <intent-filter> <action android:name="APP_STARTED" /> <action android:name="APP_STARTED_FROM_ORGANIC" /> </intent-filter> </receiver> Any help would be appreciated? In general, you cannot use an implicit Intent (e.g., one with just an action string) for a broadcast on Android 8.0+ . Your <receiver> is not exported. This suggests one of three things: You are using this with a PendingIntent , such

How to end an incoming call programmatically on Android 8.0 Oreo

半城伤御伤魂 提交于 2019-11-27 14:42:43
Up to Android 7.1 it was possible to end an incoming call by using the ITelephony.endCall() method and giving your app the permissions android.permission.CALL_PHONE and android.permission.READ_PHONE_STATE . When doing the same on Android 8.0 Oreo (API 26) , i get this error 12-09 18:11:25.195 16833-16833/li.doerf.leavemealone E/TelephonyServiceCallHangup: Missing permission MODIFY_PHONE_STATE, cannot hangup call Since MODIFY_PHONE_STATE is a protected permission, my app cannot get it. Is there a way to programmatically end an incoming call on Android 8.0+ ? Changed App Target and Compile level

Differentiate implicit broadcast receiver vs explicit broadcast receiver in the manifest

房东的猫 提交于 2019-11-27 13:53:32
问题 According to the migration guide to Android O given by Google, most of the implicit broadcast intent should not be registered in the Manifest (minus a few exceptions found here) but explicit broadcast intents remain untouched. We are looking to move any needed broadcast away from the manifest. But how do we recognise if a receiver is implicit? Is there a general rule? Here is a sample of the broadcasts we register in the manifest. Should we look only at the "action" tag and see if it is

Android O - Detect connectivity change in background

你。 提交于 2019-11-27 13:41:30
First off: I know that ConnectivityManager.CONNECTIVITY_ACTION has been deprecated and I know how to use connectivityManager.registerNetworkCallback . Furthermore if read about JobScheduler , but I am not entirely sure whether I got it right. My problem is that I want to execute some code when the phone is connected / disconnected to/from a network. This should happen when the app is in the background as well. Starting with Android O I would have to show a notification if I want to run a service in the background what I want to avoid. I tried getting info on when the phone connects /

LocalNotification with AlarmManager and BroadcastReceiver not firing up in Android O (oreo)

心已入冬 提交于 2019-11-27 13:36:26
I've got my local notifications running on androids prior to SDK 26 But in a Android O I've got the following warning, and the broadcast receiver is not fired. W/BroadcastQueue: Background execution not allowed: receiving Intent { act=package.name.action.LOCAL_NOTIFICATION cat=[com.category.LocalNotification] flg=0x14 (has extras) } to package.name/com.category.localnotifications.LocalNotificationReceiver From what I've read broadcast receivers are more restricted in android O, but if so, how should I schedule the broadcast if I want it launching even if the main activity is not running?

Android O reporting notification not posted to channel - but it is

我与影子孤独终老i 提交于 2019-11-27 12:35:14
Couple Android O notification questions: 1) I have created a Notification Channel (see below), am calling the builder with .setChannelId() (passing in the name of the channel I created, "wakey"; and yet, when I run the app, I get a message that I've failed to post a notification to channel "null". What might be causing this? 2) I suspect the answer to #1 can be found in the "log" that it says to check, but I've checked logcat & don't see anything about notifications or channels. Where is the log that it says to look in? Here's the code I'm using to create the channel: NotificationManager

Autosizing of TextView doesn't work (Android O)

て烟熏妆下的殇ゞ 提交于 2019-11-27 11:29:17
问题 I use new autosize feature added in support library 26. I read a documentation which can be found here : https://developer.android.com/preview/features/autosizing-textview.html I suppose that it should work this way: You can enable auto-sizing with this attribute: app:autoSizeTextType="uniform" . I think that TextView should use all available space to display a whole text (not just a part - it shouldn't be cropped) and the textSize should be as big as possible. If you need to limit a maximum

PendingIntent is not working on Android O

落花浮王杯 提交于 2019-11-27 09:31:20
I have download notification in my application. I've added "Cancel" button to NotificationCompat.Builder by calling addAction() method. But button not working on Android O device. When I press "Cancel" button nothing happens. But button working on Android < O. My Notification : NotificationCompat.Builder notification = new NotificationCompat.Builder(context, channelId) .setContentTitle(title) .setSmallIcon(R.drawable.network_download) .setContentText(contentText) .setOngoing(true) .setContentIntent(null) .addExtras(idBundle) .addAction(R.drawable.cancel, context.getString(R.string.cancel),