I am very new to android development and have some problems about application.
I have a database in Download folder named database.sqlite, this database contains name, surname, age and job.
I want my application to read database from Download folder and print retrieved information to text view. I want to execute query when I click on find button: SELECT * FROM NAMES WHERE name="John" AND surname="Doe";
, Name and Surname should be got from editText control.
Here's my activity.xml:
<?xml version="1.0" encoding="utf-8"?>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Name, Surname" android:id="@+id/textView" android:fontFamily="sans-serif"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:backgroundTint="@android:color/holo_green_light"
android:layout_marginTop="13dp" android:id="@+id/editText"
android:layout_below="@+id/textView" android:layout_alignParentStart="true"
android:hint="Name"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:backgroundTint="@android:color/holo_green_light"
android:id="@+id/editText2"
android:layout_below="@+id/editText" android:layout_alignParentStart="true" android:hint="Surname"/>
<Button
android:text="Find"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button2" android:layout_alignTop="@+id/editText" android:layout_alignParentEnd="true"
android:layout_toEndOf="@+id/editText" android:layout_alignBottom="@+id/editText2"
android:textAllCaps="false"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/editText2" android:layout_alignParentStart="true"/>
I tried other solutions from here, but failed, The database 1 GB, I use API 25
Thanks for attention, please help