Wearable.NodeApi.getConnectedNodes result never called

i developing an app for android wear. Below code with explanation of the problem if(mGoogleApiClient.isConnected()){ K.i(“Always called!”); Wearable.NodeApi.getConnectedNodes(mGoogleApiClient).setResultCallback(new ResultCallback<NodeApi.GetConnectedNodesResult>() { @Override public void onResult(NodeApi.GetConnectedNodesResult nodes) { K.i(“Never called 🙁 “); for (Node node : nodes.getNodes()) { Wearable.MessageApi.sendMessage(mGoogleApiClient, node.getId(), message, null); } } }); } UPD: I solve problem by turn off and turn on my […]

How can I set view shadow only on sides for view with elevation

I have a RecyclerView with various view types. Each view has own background with top, bottom or no rounded corners. Each use the same view elevation. This is one of the backgrounds in XML <?xml version=”1.0″ encoding=”utf-8″?> <ripple xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:color=”@color/card_background_pressed” tools:targetApi=”lollipop”> <item> <shape> <size android:width=”1dp” android:height=”1dp” /> <solid android:color=”@color/card_background_normal” /> </shape> </item> </ripple> When […]

Change Android Dialog button text size via styles

I am trying to enlarge the text size on all of my applications dialog buttons via styles. The following code will change the buttons background colour and even the text case but for some reason the textSize item is not honoured: <style name=”MyAppTheme” parent=”@android:style/Theme.Holo”> <item name=”android:dialogTheme”>@style/MyApp.Dialog</item> <item name=”android:alertDialogTheme”>@style/MyApp.Dialog.Alert</item> </style> <style name=”MyApp.Dialog” parent=”@android:style/Theme.Holo.Dialog”> <item name=”android:borderlessButtonStyle”>@style/MyApp.BorderlessButton</item> </style> […]

Preload multiple images with Glide

We are trying to preload images into cache memory to load them later (the images are located in the Asset folder of the application) What we tried: Glide.with(this) .load(pictureUri) .diskCacheStrategy(DiskCacheStrategy.ALL); Glide.with(this) .load(picture_uri) .diskCacheStrategy(DiskCacheStrategy.ALL) .preload(); The issue: Images are cached only when we are trying to load/display them: They have to be loaded in memory before […]

Android setOnMyLocationChangeListener is deprecated

Android Google Map’s setOnMyLocationChangeListener method is now deprecated. Does anyone know how to go around it? Thanks.

Some Android devices extremely slow when rendering canvas elements

Im developing an app for android devices, and found that samsung galaxy S4 specifically, has extremely poor performance when app/web page uses canvas. Odd thing is, that its not always the case. I have tested 2 sample apps. http://ie.microsoft.com/testdrive/Performance/FishIETank/Default.html and http://ie.microsoft.com/testdrive/Graphics/TouchEffects/Default.html the first one works fine, and outperforms my Nokia (which is dual core) and […]

Floating Action Buttons disappearing on scroll

I’ve just installed the FutureSimple library for Floating Action Buttons, and I think it’s just beautiful. Although it doesn’t contain the disappear on scroll logic, I love it. However, I would like to implement a Quick Return pattern and I’m looking for a simple way to do it. Basically, I set up an ObservableListView listener […]

Android thread wait until visible

I’ve made a custom pie chart view that I want to animate starting when the pie chart is visible. Currently what I have is the pie chart animating but by the time you can actually see it on the screen the animation is half over. This is what I have: public class SinglePieChart extends SurfaceView […]

How can i dim the background when Bottomsheet is displayed, without using Dialog?

I know BottomSheetDialog does so already, but I need to use the regular BottomSheet and behavior generated from BottomSheetBehavior.from(). This BottomSheet doesn’t dim the background and also touch outside would not close it. Is there a way to dim the background when BottomSheet is displayed? and maybe dismiss when touch outside. Basically the behavior just […]

Broadcast Receiver calles twice

Trying to check Internet connection in my app. There is a code of my manifest: <uses-permission android:name=”android.permission.INTERNET” /> <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> <receiver android:name=”.MyReceiver” > <intent-filter> <action android:name=”android.net.conn.CONNECTIVITY_CHANGE”/> </intent-filter> </receiver> And there is a handle class: public class MyReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction() != null && intent.getAction().equals(“android.net.conn.CONNECTIVITY_CHANGE”)); { […]

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