android-9.0-pie

Getting the caller ID in Android 9

对着背影说爱祢 提交于 2019-11-29 03:51:34
I have been using the following code in a BroadcastReceiver to get the caller ID of incoming calls: @Override public void onReceive(Context aContext, Intent aIntent) { String action = aIntent.getAction(); if (action==null) return; if (!action.equals("android.intent.action.PHONE_STATE")) return; String curState = aIntent.getStringExtra(TelephonyManager.EXTRA_STATE); if ((TelephonyManager.EXTRA_STATE_RINGING.equals(curState)) &&(TelephonyManager.EXTRA_STATE_IDLE.equals(oldState)))){ String incNumber = aIntent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER); // do something here } oldState

Vertical ViewPager and Android Pie Inconsistent Behavior with Swipe Gesture

核能气质少年 提交于 2019-11-28 23:42:37
问题 My problem is closely related to two other questions that haven't been answered yet. ViewPager not responding to touch in layout area created dynamically in Fragment https://stackoverflow.com/questions/53469581/problem-with-vertical-viewpager-like-inshorts My Vertical ViewPager works wonderfully and consistently within any device I have tested and with any OS 5 - 8. I recently upgraded a pixel 2XL with Android Pie and now my Vertical ViewPager appears to be unresponsive, then works, then it

Android 9.0 wifi hotspot API

流过昼夜 提交于 2019-11-28 11:57:10
问题 What is the API call I need to make in Android 9.0 (Android P) to get a Wifi hotspot name? public static String getWifiApSSID(Context context) { try { WifiManager manager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); Method method = manager.getClass().getDeclaredMethod("getWifiApConfiguration"); WifiConfiguration configuration = (WifiConfiguration) method.invoke(manager); if (configuration != null) { return configuration.SSID; } } catch (NoSuchMethodException e) { e

Can not build the project after upgrading to android - P

荒凉一梦 提交于 2019-11-28 10:03:42
Below are the errors which I am getting C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\51cd62c84e9404bd66ab4daf252c48a1\res\values-v28\values-v28.xml Error:(9, 5) error: resource android:attr/dialogCornerRadius not found. C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\51cd62c84e9404bd66ab4daf252c48a1\res\values\values.xml Error:(252, 5) error: resource android:attr/fontVariationSettings not found. Error:(252, 5) error: resource android:attr/ttcIndex not found. E:\20thJune2017_7PM\trunk\app\build\intermediates\incremental

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

旧时模样 提交于 2019-11-28 08:27:05
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:allowBackup="false" android:usesCleartextTraffic="true" android:networkSecurityConfig="@xml/network

Fragments deprecated in Android P

此生再无相见时 提交于 2019-11-28 06:44:23
I was looking at the documentation and found this This class was deprecated in API level P. Why are fragments deprecated in android P? The rewrite in Support Library 27.1.0 Ian's medium post (Feb 28, 2018) gives us an explanation about it. He is Android Framework Developer at Google. Loaders in Support Library 27.1.0 For Support Library 27.1.0, I rewrote the internals of LoaderManager, the class powering the Loaders API and I wanted to explain the reasoning behind the changes and what to expect going forward. Loaders and Fragments, a history From the beginning, Loaders and Fragments were

startScan() in WifiManager deprecated in Android P

跟風遠走 提交于 2019-11-28 05:57:21
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/issues/112688545 marko.tm Google has now documented the limitations for startScan() function in

Database Import and Export not working in Android Pie

半腔热情 提交于 2019-11-28 04:19:05
问题 Below is the working method to Import and Export SQLite database. Its Working just fine in all android versions excluding Android Pie. When I am trying to import in Android pie, it shows successful toast but database is not being restored. Can anybody help me workaround in Android Pie(API 28). private void importDB() { try { File sd = Environment.getExternalStorageDirectory(); File cur_db_pat = new File(this.getDatabasePath(DATABASE_NAME).getAbsolutePath()); if (sd.canWrite()) { String

Install APK using root, handling new limitations of “/data/local/tmp/” folder

寵の児 提交于 2019-11-28 01:29:27
问题 Background So far, I was able to install APK files using root (within the app), via this code: pm install -t -f fullPathToApkFile and if I want to (try to) install to sd-card : pm install -t -s fullPathToApkFile The problem Recently, not sure from which Android version (issue exists on Android P beta, at least), the above method fails, showing me this message: avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=0 System server has no

Determine if biometric hardware is present and the user has enrolled biometrics on Android P

痞子三分冷 提交于 2019-11-27 20:22:37
问题 I'm asked to show certain UI elements depending on the presence of biometric hardware. For Android 23-27 I use FingerprintManager#isHardwareDetected() and FingerprintManager#hasEnrolledFingerprints() . Both of which are deprecated in Android 28. I understand that I can get this information by using BiometricPrompt#authenticate(...) and receiving either BiometricPrompt#BIOMETRIC_ERROR_HW_NOT_PRESENT or BiometricPrompt#BIOMETRIC_ERROR_NO_BIOMETRICS in the BiometricPrompt.AuthenticationCallback