Contact type change trick in Android 1.5

    It so happened that I became the owner of the brand new HTC Hero.
    The first time you turn on the phone, set up your Google account. All contacts were synchronized with the phone. According to Google’s video presentation, it’s very convenient. For example, if you lose your phone, your contacts will still be on Google.

    Everything would be fine, but I just don’t really want to store personal data on a remote Googl server. I looked in the contact settings - there are no type changes. That is, when creating a contact, you can choose: google, phone, SIM. But in the future, change the type of contact is not.

    But for every tricky one, there is certainly something.

    1) Install the Android SDK on the computer.

    2) Using the adb utility (from the SDK, located in the TOOLS directory) we connect to the phone:
    ./adb shell

    3) Next, open the database of contacts:
    # sqlite3 /data/data/com.android.providers.contacts/databases/contacts.db
    Note: I have an unofficial root firmware. In official firmware, I did not check the operation of this method.

    4) For the most curious, you can enable the display of table headers:
    sqlite> .headers ON
    and also see a list of all the tables in the database:
    sqlite> .tables

    5) We look at all the contacts:
    sqlite> select * from people;
    Note: we remember the '_id' (the first number in the line) of the contact we need. For example, 164.

    6) And, lo and behold, we change the type of contact from Google to Phone:
    sqlite> update people set extra_group='2' where _id='164';
    Or if you need to change all contacts (point 5 - skip):
    sqlite> update people set extra_group='2';

    Now this contact will be stored in the phone, and you can turn off the display of Google contacts.

    PS: I hope the article helps someone. Comments are welcome!
    UPD:
    If the firmware without root and sqlite3 is not in the phone, then we will use it on the computer. Download the database on the computer:
    adb pull /data/data/com.android.providers.contacts/databases/contacts.db contacts.db
    run sqlite3 on the computer:
    sqlite3 contacts.db
    then change the type of contacts and exit sqlite3.
    And then upload the modified file to the phone:
    adb push contacts.db /data/data/com.android.providers.contacts/databases/contacts.db
    Installing sqlite3 is easier on a computer than in a non-rooted hero.

    Also popular now: