Questions tagged [android-9.0-pie]

Android 9.0 Pie (API level 28), formerly known as "Android P".

Android 9.0 Pie is the ninth major update and the 16th version of the Android operating system. It was first announced by Google on March 7, 2018. Android "P" was officially released on August 6, 2018 under the name "Pie". Android P harnesses the power of machine learning to make phone smarter, simpler, and tailored.

Summary of new features

You can find more info over here.

Android 9 features and APIs: official documentation

Behavior changes: official documentation

635 questions
364
votes
12 answers

java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion

I'm encountering this error when I use Android Studio to build my app. The APK is compiled, but when I attempt to run the app on Android P emulator, it will crash and throw the following error. Please see more details in the…
216
votes
10 answers

How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?

From Android 9 Pie now, requests without encryption will never work. And by default, the System will expect you to use TLS by default.You can read this feature here So if you only make requests via HTTPS you are safe. But what about apps that make…
152
votes
8 answers

Android P visibilityawareimagebutton.setVisibility can only be called from the same library group

I'm trying to use the new Android P FloatingActionButton that's part of the com.google.android.material.floatingactionbutton.FloatingActionButton and I'm getting this warning: VisibilityAwareImageButton.setVisibility can only be called from the…
Kyle Falconer
  • 8,302
  • 6
  • 48
  • 68
118
votes
18 answers

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

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:…
80
votes
8 answers

Android 9.0: Not allowed to start service: app is in background.. after onResume()

I've got a music player which attempts to start a Service in onResume() of an Activity. I've removed a few lines for clarity, but the code is effectively: @Override protected void onResume() { super.onResume(); startService(new Intent(this,…
Tim Malseed
  • 6,003
  • 6
  • 48
  • 66
66
votes
4 answers

Fragments deprecated in Android P

I was looking at the documentation and found this This class was deprecated in API level P. Why are fragments deprecated in android P?
RoyalGriffin
  • 1,987
  • 1
  • 12
  • 25
53
votes
14 answers

Android P - 'SQLite: No Such Table Error' after copying database from assets

I have a database saved in my apps assets folder and I copy the database using the below code when the app first opens. inputStream = mContext.getAssets().open(Utils.getDatabaseName()); if(inputStream != null) { int mFileLength…
Michael J
  • 825
  • 1
  • 9
  • 18
52
votes
6 answers

Android SDK 28 - versionCode in PackageInfo has been deprecated

I just upgraded my app's compileSdkVersion to 28 (Pie). I'm getting a compilation warning: warning: [deprecation] versionCode in PackageInfo has been deprecated The warning is coming from this code: final PackageInfo info =…
Doron Yakovlev Golani
  • 5,188
  • 9
  • 36
  • 60
49
votes
3 answers

USE_FINGERPRINT is deprecated in API level 28

Constant USE_FINGERPRINT was deprecated in API level 28 and we should use more generic USE_BIOMETRIC which has been added in same API level. I swap these constants in my Manifest and I'm getting error when calling…
49
votes
8 answers

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

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…
sirius
  • 1,019
  • 1
  • 10
  • 16
47
votes
6 answers

Is there an API to detect which theme the OS is using - dark or light (or other)?

Background On recent Android versions, ever since Android 8.1, the OS got more and more support for themes. More specifically dark theme. The problem Even though there is a lot of talk about dark mode in the point-of-view for users, there is almost…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
41
votes
1 answer

what is a non-SDK interface

After searching new Android P features, I came across the non-SDK interfaces restriction. and my question is, What is a non-SDK interface or an SDK interface? What is the difference between them? specially that makes non-SDK once better. Examples of…
aya salama
  • 903
  • 1
  • 10
  • 29
41
votes
10 answers

Fullscreen App With DisplayCutout

How do you make an app with an actual fullscreen capabilities, that has the layout to be rendered underneath the notch? Here's what I want: Here's the code of what I've tried: class MainActivity : Activity() { override fun…
Alvin Rusli
  • 1,026
  • 1
  • 11
  • 19
38
votes
1 answer

Robolectric RuntimeEnvironment.application is deprecated, where is ApplicationProvider.getApplicationContext()?

I switched to Robolectric 4.0 Beta 1 from 3.8 because I need compatibility with Android 9 (API 28). With this change, RuntimeEnvironment.application is now deprecated. The replacement is apparently to…
Charles Madere
  • 6,642
  • 5
  • 35
  • 34
33
votes
3 answers

Android Q: file.mkdirs() returns false

We have an app that uses external storage to store some temporary files: images, binary data. The code for that has been working for a few years without big changes until recently. On Android Q it doesn't work: File f = new…
khusrav
  • 5,267
  • 5
  • 27
  • 38
1
2 3
42 43