android-8.0-oreo

Android Oreo Notification Crashes System UI

£可爱£侵袭症+ 提交于 2019-12-18 14:47:15
问题 I've managed to get notifications working in older API's, but not Oreo. Creating the notification causes my app to still work fine (no messages in logcat), however SystemUI crashes and reboots in an endless cycle while the Activity is running. The is the error in logcat for the systemui process: java.lang.IllegalArgumentException: width and height must be > 0 My code: private void showPlayingNotification() { NotificationCompat.Builder builder = mNotificationUtils.getAndroidChannelNotification

Notification vibrate issue for android 8.0

自古美人都是妖i 提交于 2019-12-18 13:31:04
问题 i create notification channel to show notification in android 8.0 as below NotificationChannel uploadChannel = new NotificationChannel(Constants.NOTIFICATION_CHANNEL_UPLOAD_ID,"Uploads", NotificationManager.IMPORTANCE_LOW); uploadChannel.enableLights(false); uploadChannel.setDescription("Uploads Channel"); notificationManager.createNotificationChannel(uploadChannel); each time i show notification the phone vibrate many times. i disable vibrate from notification channel as below uploadChannel

Android 8 requires READ_PHONE_STATE when calling SmsManager.sendTextMessage()

蓝咒 提交于 2019-12-18 11:47:19
问题 My application can't send sms on new android 8 update. I get error that I don't have READ_PHONE_STATE permission. java.lang.SecurityException: Neither user 10179 nor current process has android.permission.READ_PHONE_STATE. at android.os.Parcel.readException(Parcel.java:1942) at android.os.Parcel.readException(Parcel.java:1888) at com.android.internal.telephony.ISms$Stub$Proxy.sendTextForSubscriber(ISms.java:789) at android.telephony.SmsManager.sendTextMessageInternal(SmsManager.java:329) at

SYSTEM_ALERT_WINDOW PERMISSION on API 26 not working as expected. Permission denied for window type 2002

倖福魔咒の 提交于 2019-12-18 11:47:12
问题 I am using overlay permission to display certain information in my app. Running it on API 23 - 25 it works fine (asking for permission, granting, etc. according to Unable to add window android.view.ViewRoot$W@44da9bc0 -- permission denied for this window type ). (Many thanks to ceph3us!) Trying the same on API 26 I am getting an error, basically "permission denied for window type 2002" when calling windowManager.addView(frameLayout, params); Did Google change the way, overlay works? Any idea,

Failed to post notification on channel “null” Target Api is 26

ぃ、小莉子 提交于 2019-12-18 10:40:12
问题 Two log showing 1: Use of stream types is deprecated for operations other than volume control 2: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case 回答1: From the developer documentation: When you target Android 8.0 (API level 26), you must implement one or more notification channels to display notifications to your users. int NOTIFICATION_ID = 234; NotificationManager notificationManager = (NotificationManager) ctx

Android O - FLAG_SHOW_WHEN_LOCKED is deprecated

自作多情 提交于 2019-12-17 23:32:49
问题 I'm targetting my application to Android O. In my application I have a job service that shows a window over all other applications, so when it triggered it needs to show this window even when the screen is turned off & unlocked and turn it on. I've achieved this behaviour in preior Android versions, but in Android O it doesn't work as I expected. I've read that I need to use the flag TYPE_APPLICATION_OVERLAY and added also the permission <uses-permission android:name="android.permission

Can I still have a data logging background service in Android 8.0?

非 Y 不嫁゛ 提交于 2019-12-17 22:28:53
问题 My app relies on logging the battery temperature, as well as several other sensor variables, every second in a background service that can be started from the main activity and continues running in the background until it's stopped (by another button in the main activity). This works fine in Android 7.0 and below, but reading into Android 8.0, it looks like it limits background services pretty severely. Can I still do this data logging that I currently do, or is that no longer possible? 回答1:

INSTALL_FAILED_NO_MATCHING_ABIS error on Android 8

无人久伴 提交于 2019-12-17 16:22:03
问题 I am trying to build my app connecting my Pixel phone. I recently upgraded my phone to Android 8. I was able to build and open the app in my phone until the last upgrade, but after this upgrade, I get Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113] error. Below is my gradle file. Can someone please tell me what is the issue ?? apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion '26.0.1' defaultConfig { applicationId

Android O - Detect connectivity change in background

Deadly 提交于 2019-12-17 10:52:59
问题 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

Android O - Detect connectivity change in background

让人想犯罪 __ 提交于 2019-12-17 10:51:33
问题 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