Tag: android-5.0-lollipop

WifiConfiguration enable network in Lollipop

I was working on Wifi project, there is a module that enable user to join wifi programatically. In kitkat and below it’s working successfully, but in Lollipop it’s not working. Here is the code : WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiConfiguration wifiConfiguration = new WifiConfiguration(); wifiConfiguration.SSID = “\”testSSID\””; wifiConfiguration.hiddenSSID = true; wifiConfiguration.status = WifiConfiguration.Status.ENABLED; wifiConfiguration.allowedKeyManagement […]

What is ScrimInsetsFrameLayout?

What is ScrimInsetsFrameLayout? I am working in Navigation Drawer with ToolBar,In most of the tutorial they using ScrimInsetsFrameLayout, For what purpose it use can any one explain breif?

Notification background in Android Lollipop is white. How can I change it?

I want to show a notification for a message in my app. In previous versions of Android everything is ok, but in Lollipop the notification background is white. I used this XML code for my notification layout in layout_message_notification.xml: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/layout_messageNotification” android:orientation=”horizontal” android:layout_width=”match_parent” android:layout_height=”match_parent” android:background=”@android:color/transparent”> <LinearLayout android:layout_width=”0dp” android:layout_weight=”.2″ android:layout_height=”wrap_content” android:background=”@android:color/transparent”> <ImageView […]

Android PopupWindow elevation does not show shadow

Android Popwindow does not show shadows when the elevation is set. It appears to support it from the documentation. I am using 5.0 Lollipop. Creating the popup as follows: popupWindow = new PopupWindow(context); popupWindow.setOutsideTouchable(true); popupWindow.setFocusable(true); popupWindow.setElevation(10); popupWindow.setContentView(rootView); popupWindow.showAtLocation(anchorView, Gravity.NO_GRAVITY, xPos, yPos);

Path.approximate() not supported on android studio 0.8.14 beta

Rendering Problems Path.approximate() not supported. Failed to parse file ~\sdk\platforms\android-21\data\res\drawable\progress_medium_material.xml error after add ProgressBar to Layout How to resolve?

Android READ_EXTERNAL_STORAGE permission not working

I’m trying to create a simple app that can get an image from the Gallery app and display it on an imageButton. I’m testing with API 21 on a phone running Android 5.0.1. Unfortunately, no matter what I try I keep getting a security error – even when I specify the permissions. My code for […]

Lollipop: Disabled button –> which style?

I tried to track down, how Lollipop displays a button, which is disabled with android:enabled=”false” in the layout file. Holo With Holo, it’s easy: In the styles_holo.xml, I find the style Widget.Holo.Button, which gives me a reference to @drawable/btn_default_holo_dark. There I find the selector: <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_window_focused=”false” android:state_enabled=”true” android:drawable=”@drawable/btn_default_normal_holo_dark” /> <item android:state_window_focused=”false” android:state_enabled=”false” android:drawable=”@drawable/btn_default_disabled_holo_dark” […]

SVG Vs PNG on Android

Which is the best way of dealing with images in Android. Recently in Android Lollipop We had given support for SVG(Scalable Vector Graphics) concept. Which is the best way of working with images to support all resolutions PNG(placing images in particular drawable resources) or SVG(Small file sizes that compress well, Scales to any size without […]

Handling media buttons in Android 5.0 Lollipop

Pre API 21 I was using a call like audioManager.registerMediaButtonEventReceiver(receiver); to handle media button events when a user pressed a button on his headset. As of API 21, it seems that MediaSession should be used. However, I’m not getting any response whatsoever. final MediaSession session = new MediaSession(context, “TAG”); session.setCallback(new Callback() { @Override public boolean […]

Device Owner on Android 5.0 (and others) whitout rooted devices, device provisioning by NFC

I need to know how to set my application as Device owner in Android 5.0, 4.4 and 4.3(?). I’ve yet tried the method for rooted devices (described in there), successfully. I saw that works great in android 5.0 and 4.4.2 emulator and in CyanoGen AOSP 4.4.4 (all rooted devices). But I must need to try […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.