Programmatically collapse or expand CollapsingToolbarLayout

Simple question, but I can’t find an answer. How can I collapse or expand the CollapsingToolbarLayout programmatically? ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

How to achieve ripple animation using support library?

I am trying to add a ripple animation on button click. I did like below but it requires minSdKVersion to 21. ripple.xml <ripple xmlns:android=”” android:color=”?android:colorControlHighlight”> <item> <shape android:shape=”rectangle”> <solid android:color=”?android:colorAccent” /> </shape> </item> </ripple> Button <com.devspark.robototextview.widget.RobotoButton android:id=”@+id/loginButton” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@drawable/ripple” android:text=”@string/login_button” /> I want to make it backward compatible with the design library. How this […]

Android: Rotate image in imageview by an angle

I am using the following code to rotate a image in ImageView by an angle. Is there any simpler and less complex method available. ImageView iv = (ImageView)findViewById(imageviewid); TextView tv = (TextView)findViewById(txtViewsid); Matrix mat = new Matrix(); Bitmap bMap = BitmapFactory.decodeResource(getResources(),imageid); mat.postRotate(Integer.parseInt(degree));===>angle to be rotated Bitmap bMapRotate = Bitmap.createBitmap(bMap, 0, 0,bMap.getWidth(),bMap.getHeight(), mat, true); iv.setImageBitmap(bMapRotate);

adb not finding my device / phone (MacOS X)

Doing Android development on a Mac and this very new phone I have doesn’t show up in the devices list in adb. Lots of other phones and devices work fine for me so I know my setup is good. I have debugging enabled (Settings –> Applications –> Development –> USB debugging) on the phone, but […]

Failed binder transaction when putting an bitmap dynamically in a widget

Can anybody tell me the reason for failed binder transaction error? I can see this error message in logcat. I am getting this error while trying to put an bitmap dynamically in a widget…

WebView and HTML5 <video>

I’m piecing together a cheapo app that amongst other things “frames” some of our websites… Pretty simple with the WebViewClient… until I hit the video. The video is done as HTML5 elements, and these work fine and dandy on Chrome, iPhones, and now that we fixed the encoding issues it works great on Android… in […]

Developing cross platform mobile application

More and more mobile platforms are being launched and sdk’s are available to developers. There are various mobile platform are available: Android, iOS, Moblin, Windows mobile 7, RIM, symbian, bada, maemo etc. And making of cross platform application is headache for developers. I am searching for common things across the platforms which will help to […]

What does “|=” mean? (pipe equal operator)

I tried searching using Google Search and Stack Overflow, but it didn’t show up any results. I have seen this in opensource library code: Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_SOUND; notification.defaults |= Notification.DEFAULT_VIBRATE; What does “|=” ( pipe equal operator ) mean?

Android: When is onCreateOptionsMenu called during Activity lifecycle?

I put a couple of breakpoints in onCreate (one at the beginning, and one at the end of the method), and I also put one at the beginning of onCreateOptionsMenu. The onCreate method is called first, and before it finishes onCreateOptionsMenu is called. I’m trying to separate the Fragment navigation code in my app, so […]

Android Reading from an Input stream efficiently

I am making an HTTP get request to a website for an android application I am making. I am using a DefaultHttpClient and using HttpGet to issue the request. I get the entity response and from this obtain an InputStream object for getting the html of the page. I then cycle through the reply doing […]

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