Why not use always android:configChanges=”keyboardHidden|orientation”?

I was wondering why not use android:configChanges=”keyboardHidden|orientation” in every (almost every ;)) activity? Goods: no need to worry about your activity been rotated it’s faster Not so nice: need to change your layouts if they are depending on screen size (e.g. layouts with two columns or so) Bad: no flexible way to have different layouts … Read more

How to parse the AndroidManifest.xml file inside an .apk package

This file appears to be in a binary XML format. What is this format and how can it be parsed programmatically (as opposed to using the aapt dump tool in the SDK)? This binary format is not discussed in the documentation here. Note: I want to access this information from outside the Android environment, preferably … Read more

How to get rid of Incremental annotation processing requested warning?

I have just started using android development and trying to use Room library. Since yesterday I am facing this warning message w: [kapt] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: androidx.lifecycle.LifecycleProcessor (NON_INCREMENTAL), androidx.room.RoomProcessor (NON_INCREMENTAL). I have tried to research and fix but unable to avoid this error … Read more

Disable soft keyboard on NumberPicker

I’m trying to deactivate the soft keyboard when using a NumberPicker to enter numerical values (for aesthetic reasons). This is my layout-xml-code: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” > <LinearLayout android:id=”@+id/linearLayout2″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”center_horizontal” android:layout_marginBottom=”30dp” android:layout_marginTop=”30dp” > <NumberPicker android:id=”@+id/repetitionPicker” android:layout_width=”40dp” android:layout_height=”wrap_content” /> <TextView android:id=”@+id/textView1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”center_vertical” android:text=”@string/repetitions_short_divider” android:textAppearance=”?android:attr/textAppearanceMedium” /> <NumberPicker android:id=”@+id/weightPicker” android:layout_width=”40dp” … Read more

How to create directory automatically on SD card

I’m trying to save my file to the following location FileOutputStream fos = new FileOutputStream(“/sdcard/Wallpaper/”+fileName); but I’m getting the exception java.io.FileNotFoundException However, when I put the path as “/sdcard/” it works. Now I’m assuming that I’m not able to create directory automatically this way. Can someone suggest how to create a directory and sub-directory using … Read more