android-9.0-pie

Android Pie (9.0) WebView in multi-process

最后都变了- 提交于 2019-12-18 10:54:36
问题 Starting Android Pie (API 28), Google isn't allowing using a single WebView instance in 2 different processes. Documentation: https://developer.android.com/reference/android/webkit/WebView.html#setDataDirectorySuffix(java.lang.String) As required, I called WebView.setDataDirectorySuffix("dir_name_no_separator") but unfortunately, I get an exception. I tried to call this method inside the 2nd process Service onCreate(). java.lang.RuntimeException: Unable to create service com.myapp.service

Unable to open database in Android Pie (Android 9)

流过昼夜 提交于 2019-12-18 03:40:29
问题 I used checkDataBase function to ensure if the database already exist to avoid re-copying the file each time you open the application in Oreo. But in Android Pie it is not working. private boolean checkDataBase (String dbName, int dbVersion) { SQLiteDatabase checkDB = null; try { String myPath = DB_PATH + dbName; checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.CONFLICT_ABORT); if (checkDB.getVersion() < dbVersion) { Timber.d("Delete database called"); myContext

How to solve Android P DownloadManager stopping with “Cleartext HTTP traffic to 127.0.0.1 not permitted”?

回眸只為那壹抹淺笑 提交于 2019-12-17 18:33:17
问题 I have already defined a custom network security config and included it in my manifest as recommended here res/xml/network_security_config.xml: <?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">127.0.0.1</domain> <domain includeSubdomains="true">localhost</domain> </domain-config> </network-security-config> and this is in my Android.manifest : <application android:icon="@drawable/icon" android

startScan() in WifiManager deprecated in Android P

不羁的心 提交于 2019-12-17 17:56:19
问题 How to get scan result from wifi for example every 3 seconds, without mWifimanager.startScan(); Google says : startScan() This method was deprecated in API level P. The ability for apps to trigger scan requests will be removed in a future release. Notice for this API level i'm using List<ScanResult> results = mWifiManager.getScanResults(); without calling startScan , the list contains the wifi AP's but it makes updated very very slow Update to 12 January 2019 : https://issuetracker.google.com

Android design support library for API 28 (P) not working

爱⌒轻易说出口 提交于 2019-12-17 02:35:09
问题 I've configured android-P SDK environment successfully. When I attempt to use the android design support library I face project build errors. Project configurations are: IDE: 3.2 Canary 17 Target API: 28 Compile API: 28 apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 28 defaultConfig { applicationId "com.app.navigationpoc" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0"

How to know programmatically whether MobileData is enabled on Android P?

心不动则不痛 提交于 2019-12-13 20:30:24
问题 Is there a way to check programmatically whether MobileData is enabled on Android P? Before P, we can use getMobileDataEnabled() with reflection like this answer. https://stackoverflow.com/a/12864897/3752013 But after P, reflection methods throw exception... https://developer.android.com/about/versions/pie/restrictions-non-sdk-interfaces#results-of-keeping-non-sdk Any ideas? 回答1: Use the following class public class NetworkEventReceiver extends ConnectivityManager.NetworkCallback { private

Lauching a task when WIFI connects on Android Oreo or newer

て烟熏妆下的殇ゞ 提交于 2019-12-13 20:23:47
问题 I have an app that run some security checks and alerts the user using notifications when the device connects to a WIFI network with an specific SSID. The app run checks in background and if there is some security issue alerts the user using notifications. The issue is that I was using a broadcast receiver for this but with Android Oreo or newer is not working any more. I was reading a lot and I can't find a way for running some background action exactly when the WIFI connection is turned on.

Biometrics - FingerprintManager Xamarin forms on Android PIE - 9

不问归期 提交于 2019-12-13 18:16:59
问题 FingerprintManager#isHardwareDetected() and FingerprintManager#hasEnrolledFingerprints(). Both of which are deprecated in Android 28. What else could I use in order to see if fingerprints are enrolled in this version? I saw this as an option. KeyguardManager keyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE); if that option is ok, how to translate it into xamarin forms for example () FingerprintManagerCompat fpm= FingerprintManagerCompat.From(CrossCurrentActivity.Current

SSL issue on Android 9 Google Pixel One

99封情书 提交于 2019-12-13 15:48:10
问题 I am trying to perform HTTPS requests to a host 10.10.10.1 from Android host with 10.10.10.2 in network without Internet connection - only WiFi 2 peers AP and Android 9 Google Pixel One device. I've created network_security_config.xml with my cert that is self-signed and has CN=10.10.10.1 and SAN= DNS: 10.10.10.1 PI: 10.10.10.1. <?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" />

JobService does not get rescheduled in android 9

依然范特西╮ 提交于 2019-12-13 13:27:24
问题 I'm trying to get my app working on Android 9. The following code works fine up to Android 8, but for some reason, the JobService does not get rescheduled on android 9. It gets scheduled the first time but does not get rescheduled according to the set periodic. class RetrieveJobService : JobService() { override fun onStartJob(params: JobParameters): Boolean { doBackgroundWork(params) return true } private fun doBackgroundWork(params: JobParameters) { Thread { try { doRetrieveBackgroundStuff