android-8.0-oreo

How to turn off wifi hotspot programmatically in Android 8.0 (Oreo) (setWifiApEnabled is not support this version anymore)

最后都变了- 提交于 2020-01-04 07:10:49
问题 I reference the code to turn on hotspot in Android 8.0, it is work. But I have no idea about how to disable it @RequiresApi(api = Build.VERSION_CODES.O) private void turnOnHotspot(){ WifiManager manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); manager.startLocalOnlyHotspot(new WifiManager.LocalOnlyHotspotCallback(){ @Override public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) { super.onStarted(reservation); Log.d(TAG, "Wifi

Android: What is the best way to make repetitive Background Tasks Android Oreo ready?

北战南征 提交于 2020-01-03 17:17:40
问题 I heard Background Services won't work that free on android Oreo. I'm kinda confused how I should rewrite my Code. I'm working with android for a month or so now, so please try to answer as simple as possible. I have a Service that is called On Boot and in the onCreate() of my MainActivity. In the service's onStartCommand it is calling a Handler . This handler will postDelay() itself every half minute and call a function. This function does some api requests and will push a notification when

Registering Static Broadcast receiver in Oreo

懵懂的女人 提交于 2020-01-03 16:00:08
问题 I'm Working on a project which records incoming calls and outgoing calls, but with Oreo static broadcast receivers (Broadcast receivers which are registered in the manifest) are not getting triggered. if I register with context, the broadcast will not be triggered once app gets killed. I want the broadcast receiver to work even if app is closed. is there any possible way to achieve this Oreo? or any other alternative approach to achieve this? any help will be appreciated. I'm registering in

How to copy some text to android system clipboard using ADB?

こ雲淡風輕ζ 提交于 2020-01-03 11:02:31
问题 I want to automate some stuff on my rooted android Oreo and can't seem to find a way to copy some text to clipboard. I can paste the copied text adb shell input keyevent 279 so hoping to get some way to copy text also. P.S: not looking for answers suggesting adb shell input text [text] cause it's slow. 回答1: It seems there are 2 ways to copy a text into android clipboard using adb shell . Using service call clipboard 2 i32 1 i32 0 s16 "text" (Deprecated and doesn't work on android 8) Using an

How to copy some text to android system clipboard using ADB?

纵饮孤独 提交于 2020-01-03 11:02:29
问题 I want to automate some stuff on my rooted android Oreo and can't seem to find a way to copy some text to clipboard. I can paste the copied text adb shell input keyevent 279 so hoping to get some way to copy text also. P.S: not looking for answers suggesting adb shell input text [text] cause it's slow. 回答1: It seems there are 2 ways to copy a text into android clipboard using adb shell . Using service call clipboard 2 i32 1 i32 0 s16 "text" (Deprecated and doesn't work on android 8) Using an

Doze mode on Oreo

谁都会走 提交于 2020-01-03 03:56:09
问题 I am facing issue in my app regarding doze mode. I am making a chat application and when app is in backgroud during doze mode and receive any message . Device does not show notification in orea. I have followed the proper procedure for OREO notification by building channel for it. I need to find if there is a way to whiteList my app from doze mode so that I can have notifications. Or any other process to optimize notification building. 回答1: I do not need to whitelist my application to get

How to have Read + Write external storage after targeting android O (26) 8.0

白昼怎懂夜的黑 提交于 2020-01-02 05:23:16
问题 Before targetting android O code below worked perfectly. After setting targetApi=27 (8.1) this stopped working. context.requestPermissions(new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode); I am presented with a permission dialog we all know, I gladly allow App to access photos media and files on a device. and in onRequestPermissionResult() it returns android.permission.READ_EXTERNAL_STORAGE == 0, android.permission.WRITE

Android : Not able to sync data between applications above Oreo + devices

删除回忆录丶 提交于 2020-01-01 19:22:37
问题 I am stuck on sync real time data between 2 app only in Oreo+ devices, Like if different user login to the app then it should be immediately effect in other app and It should also change in other app.(e.g. Facebook and Facebook Messenger. If you logout from Facebook, it will automatically logout from FB Messenger or If you log into Facebook then it will automatically logged into FB Messenger and vice versa) I created broadcast receiver in both app and if login changes from one app then send

JobScheduler behaviour on Android O

好久不见. 提交于 2020-01-01 19:20:20
问题 According to the documentation, as of Android O services will be stopped several minutes after the app is no longer in the foreground. The documentation suggests most services can be replaced with JobScheduler jobs. My question is - do jobs have any kind of special behavior as well, or do they behave the same as services pre-Android O? Can they live "forever" (as long as the system doesn't need the memory, of course), or do the system also kills them off at the end of a certain window? 回答1:

Android O, Background Service is running for more than 30 minutes. Why?

微笑、不失礼 提交于 2020-01-01 11:37:12
问题 I am using FusedLocationProvider API to register some Geofences with PendingIntent, when my app gets started (app was manually killed to trigger this behavior) via Geofence event, I start a background service to do some work. In this Service I create a separate background thread to do some long running tasks and I acquire a wake-lock so that I am sure my tasks are completed. The Service keeps running for longer period of times (30 - 50 minutes) even though It shouldn't be. It shouldn't be