android-8.0-oreo

Correct way to create Notification Channels from Android O Api

混江龙づ霸主 提交于 2019-12-06 20:29:13
问题 The notification channels which introduced from Android O (API 26) version.I read about it from the following links: Managing notification channels Google Sample for Creating Channel Questions: If I have multiple numbers of notification then Is it a good idea to create notification channels when the application starts and keep it at ApplicationScope ? public void addNotificationChannels(Context context) { List<NotificationChannel> channels = new ArrayList<>(); channels.add("channel_1");

Android Notification Not Showing On API 26

拈花ヽ惹草 提交于 2019-12-06 19:56:38
问题 I recently updated my app to API 26, and notifications are no longer working, without even changing the code. val notification = NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_notification) .setContentTitle("Title") .setContentText("Text") .build() (getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).notify(1, notification) Why isn't it working? Was there some change to the API that I'm not aware of? 回答1: From the documentation: Android O introduces

How to manage installation from Unknown Sources in Android Oreo?

冷暖自知 提交于 2019-12-06 18:30:09
问题 In Android Oreo (8.0), several changes where made on how to allow the installation of apps from Unknown Sources (from the user's point of view) and to the process of getting permission to install them (from the developer's point of view). Since I found it particularly hard to find all the steps necessary on the developer side, I thought it to be useful to ask here for the solution and answer the question myself, now that I found the answers, for future reference to those, who are facing the

Start a JobIntentService Implicitly

爷,独闯天下 提交于 2019-12-06 17:07:39
问题 As you know this is how we fire a JobIntentService : JobIntentService.enqueueWork(this, MyJobIntentService.class, JOB_ID, intent); In this approach we KNOW which service we want to start and pass its class to the method. Here is my question : Is there any way to start a service implicitly ? Why I need this ? I'm developing a library that sometimes should start a service that developer extends and obviously I have no access to it from library What I tried? I implemented it with IntentService

Notification android on foreground not displayed (Oreo)

只愿长相守 提交于 2019-12-06 12:11:49
问题 I'm trying to display an notification with firebase when the app is in the foreground . The onMessageReceived method is called when I push the notification from the server, but the notification is not displayed . Here my code : public class MyFirebaseMessagingService extends FirebaseMessagingService { @Override public void onMessageReceived(final RemoteMessage remoteMessage) { Timber.d("FCM-From: " + remoteMessage.getFrom()); new Handler(Looper.getMainLooper()).post(new Runnable() { public

Failed to create directory in Android Oreo (API 26)

梦想与她 提交于 2019-12-06 09:37:17
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 (!mediaStorageDir.exists()) { if (!mediaStorageDir.mkdirs()) { Toast.makeText(RecordVideoActivity.this, "Failed

Oreo Background Services

不打扰是莪最后的温柔 提交于 2019-12-06 08:06:16
Within our application we use multiple Services and Intent Services for BLE communication, microphone recording, etc. We have noticed the newly Background Limitations and Restrictions (Yes, we did notice it rather late, I know). I've changed the implementations for using ContextCompat.startForegroundService() function and using the startForeground() with a notification like it stated in the docs. But we saw that when the application is killed , the Foreground Service dies also after a few minutes. Should it happen? Should the Foreground Service will only continue to work if the app is in the

Android Oreo: what should I do to publish my app as an Autofill service provider?

我怕爱的太早我们不能终老 提交于 2019-12-06 07:59:26
问题 I'm an independent developer of a password manager app. What should I do, or what should I implement (interface/API/Service), to make my app an Autofill service provider (in a device with Android Oreo API >= 26)? I have read all kinds of related documentation, but I can't understand how to do this. Am I missing something? At the moment I see that only well-known password managers support this feature: Any hints are welcome. 回答1: As usual, Google's own examples repository provides a good

BLE Scan on android 8.0

心不动则不痛 提交于 2019-12-06 06:43:32
问题 I've developed an app that do ble scan for nearby devices (multiple kinds of beacons around). I am scanning using the BluetoothLeScanner with CALLBACK_TYPE_ALL_MATCHES and an empty ScanFilter array (since I want to get callbacks for all nearby devices). My app was working just fine on my OnePlus 5 device Android 7.x (and few other devices) - until I have upgraded to android 8.0 OTA on my device. I am not sure if it is Android 8.0 issue or OnePlus Oxygen bug but I face to following situation:

android sms verification without READ_SMS permission

江枫思渺然 提交于 2019-12-06 06:11:33
问题 I know that with Android O, now we can read SMS verification without requiring READ_SMS permission. It could be done using createAppSpecificSmsToken API. But I need a complete example to demonstrate whole of SMS verification routine. 回答1: There is not much to it. Call createAppSpecificSmsToken() on SmsManager , supplying a PendingIntent . You get a String back which is the token. If the device receives an SMS with that token, your PendingIntent is run, triggering whatever component you