Questions tagged [android-5.1.1-lollipop]

Android 5.1 (LOLLIPOP_MR1) is an update to the Lollipop release. It supports API Level 22.

Overview

Multiple SIM Card Support

Android 5.1 adds support for using more than one cellular carrier SIM card at a time. This feature lets users activate and use additional SIMs on devices that have two or more SIM card slots.

You can access information about the currently active SIM through the SubscriptionManager class, including whether or not the device is considered to be roaming on the current network. This information is useful for developers who want to throttle their apps' data access down or off for device users who are sensitive to data access charges. Your app can be alerted to changes in a device's current network connection by requesting the READ_PHONE_STATE permission and setting SubscriptionManager.OnSubscriptionsChangedListener on the SubscriptionManager object.

Deprecated HTTP Classes

The org.apache.http classes and the AndroidHttpClient class have been deprecated in Android 5.1. These classes are no longer being maintained and you should migrate any app code using these APIs to the URLConnection classes as soon as possible.

Carrier Services

Android 5.1 provides support for telecommunication service providers to create apps that can perform carrier provisioning tasks on an Android device. These APIs provide a secure and flexible way for carrier-developed apps to perform these tasks and be distributed through Google Play. Apps that use these functions must be signed by a certificate that matches the certificate in the device's Universal Integrated Circuit Card (UICC).

The carrier service APIs have been added to the TelephonyManager class, the SmsManager class, and the new CarrierMessagingService class. Apps can check for access to these APIs by calling the hasCarrierPrivileges() method. Apps that call these APIs without access receive a SecurityException.

See More

283 questions
847
votes
16 answers

Android getResources().getDrawable() deprecated API 22

With new android API 22 getResources().getDrawable() is now deprecated. Now the best approach is to use only getDrawable(). What changed?
38
votes
3 answers

Android XML: android:elevation vs. app:elevation

When do I use android:elevation and when app:elevation? What's the difference between those two?
31
votes
11 answers

Android 5.x ClassNotFoundException works fine on 6.0+

I have updated my project's minSdkVersion from 19 to 21. This has caused an issue on 5.0/5.1 devices where I can't run the app. I keep getting a ClassNotFoundException on my Application class. The full log, Application class, and gradle file are…
ganlaw
  • 1,303
  • 4
  • 18
  • 32
26
votes
2 answers

How to check if Android Lollipop battery saver is on

Android Lollipop introduced a battery saver mode that can be turned on at any time, and turns on by default when the battery is at 15% or lower. This poses a problem for my app, since the battery saver disables animations that provide crucial…
23
votes
2 answers

Android MediaCodec Encode and Decode In Asynchronous Mode

I am trying to decode a video from a file and encode it into a different format with MediaCodec in the new Asynchronous Mode supported in API Level 21 and up (Android OS 5.0 Lollipop). There are many examples for doing this in Synchronous Mode on…
17
votes
1 answer

Update Android System WebView on SDK Emulator

I have a problem with my cordova app after the latest Android System WebView update (44.0.2403.39) on Android 5.x devices. I would like to update the replicate the problem on the SDK Emulator. But the standard image of Android 5.1 comes with the…
Carlos487
  • 1,459
  • 13
  • 17
15
votes
1 answer

Android - How to detect when 3d party app is starting

I'm currently developing an app for tablets which will show commercials in stores. I need to add a password protection for the settings application. To achieve this I need to detect that the settings app is started in a background service. For…
dephinera
  • 3,703
  • 11
  • 41
  • 75
15
votes
2 answers

SubscriptionInfo.getMnc() returns the same value for both the SIMs with different carriers

I was trying to get the MCC and MNC number (basically I want the IMSI number but these will also suffice) in Android 5.1 device having dual Sim (both active). As 5.1 supports dual Sim so I used the Subscription manager like this: SubscriptionManager…
14
votes
4 answers

surfaceview for camera is not working in android lollipop os

Today I had faced an issue in android surfaceview for camera customization. I tried the below code. The Issue occurred when I captured the image, it stops the camera preview and doesn't return to the activity. Following code will be implemented…
14
votes
3 answers

Creating A Digital Clock Widget With A Custom Font

I'm trying to create a digital clock widget with a custom font. And this has proven to be the biggest challenge of my Android experience. (Thought it would be as simple as tc.setTypeFace("whatever") and be done with it) The best way seems to be…
11
votes
1 answer

How to prevent BluetoothGattCallback from being executed multiple times at a time

I have a service that has one instance of BluetoothGattCallback public class MyService extends Service { private BluetoothGattCallback callback; @Override public void onCreate() { super.onCreate(); callback =…
Kevin D.
  • 1,500
  • 1
  • 18
  • 41
10
votes
1 answer

Toast: Difference between "this" and "getApplicationContext()"?

My device runs Android 5.1.1 and I found out that if I use Toast.makeText(this, "This is a toast", Toast.LENGTH_SHORT).show(); I got this: But if I use getApplicationContext() instead of this, Toast.makeText(getApplicationContext(), "This is a…
9
votes
2 answers

AlarmManager not working on Samsung devices in Lollipop

I develop an app that uses AlarmManager to set a bunch alarms (usually around 50) that need to be fired at a certain time during the year. This is the code I'm using since 4.4 kitkat changed the AlarmManager. AlarmManager am = (AlarmManager)…
9
votes
2 answers

Shared Element Transition into a View in a RecyclerView, possible?

In view of normal Lollipop transition of Activity having shared elements, e.g. https://github.com/codepath/android_guides/wiki/Shared-Element-Activity-Transition, it is quite common one is transitioning from a View from a Recycler View into a normal…
9
votes
4 answers

Button style working in Android 5 but not Android 4

I have a button style with a blue background that works fine in API 22, but the same button appears in dark grey without the applied style in Android 4. This is my style: