All posts in Android

When you create and restore a TWRP backup (as example because you tried out a custom ROM and saw that it’s not good) you’ll be greeted with:

a) A “enter PIN before boot” screen
b) A wrong lockscreen code (either PIN or Pattern) when booted to Android

————————
HOW TO FIX
————————

  1. Simply boot into TWRP and enter your PIN (if you’ve set one) to decrypt the stroage. If you don’t have TWRP (for whatever reason) you can do so via ADB too but ONLY if you’ve connected your phone to your PC beforehand and also accepted it’s fingerprint on the phone itself.
  2. Delete (or rename) the following files inside /data/system (note that probably not all of them exist for you, simply delete those you can find):
    • password.key
    • pattern.key
    • locksettings.db-wal
    • locksettings.db-shm
    • locksettings.db
  3. Reboot the phone and (if you’ve set a PIN) enter it to decrypt the storage one more time. After that you can simply unlock your phone with a swipe.
  4. Go into Settings > Security and set your preferred unlock method again, Android will ask you if you want to set a boot-time code too. Select whatever you want here, it’s a nice security addition but can be annoying sometimes.
  5. Enjoy your phone again!

I hope this helps some people here since I was searching on how to fix this for almost an hour after restoring a backup. This is probably due to another ROM overwriting existing lockdata when you set a code there, then again you’d wipe the /data partition anyways so I have no clue why it’s still acting up like this…

Just found out from somewhere than syncfusion is offering free license for lifetime which includes all the products. No Strings attached.


Here’s the link. Please tell everyone there’s nothing better than getting everything for free with future support and everything legit too!

If you want to split a Single Linear layout into a Two Columns(Like newspaper Columns). Here’s the layout for it. Use recursively as per your requirement:


 <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/item" />

            <TextView
                android:id="@+id/text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

        </LinearLayout>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical" >

            <ImageView
                content here/>

            <TextView
                content here/>

        </LinearLayout>
    </LinearLayout>

If anyone wants to split the android layout into two parts horizontally then use the below snippet.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FF0000"
    android:weightSum="4"
    android:padding="5dp"> <!-- to show what the parent is -->
    <LinearLayout
        android:background="#0000FF"
        android:layout_height="0dp"
        android:layout_width="match_parent"
        android:layout_weight="2" />
    <LinearLayout
        android:background="#00FF00"
        android:layout_height="0dp"
        android:layout_width="match_parent"
        android:layout_weight="1" />
</LinearLayout>

 

You can recursively use this layout as per your requirement.

I’ve tried a lot of android’s adb drivers and honestly it’s not easy to install. Recently I tried to install Oneplus 2/x driver on my system which somehow messed up my android’s sdk and somehow corrupted every app that I made using it. The problem is that these drivers mess up the adb_usb.ini file which we are not supposed to modify (This makes me post about how to solve this issue).

So here it is:

Android USB UnifL

Among other projects, leshcatlabs.net is developing so called Androidadb-USBUnifL Driver.

Those drivers are based on latest Google adb-USB Drivers and aimed to support wide range of Android devices.

Key benefits of adb-USBUnifL drivers as follows:

1. Latest Google adb-USB driver

2. Wide range of already supported non-Google Android devices.

3.Androidadb-USB UnifL driver is using private certificate, that means you don’t have toenableTest Mode“.

Isn’t that wonderful?

Now go test it out!