Function
Easy to import the text table data into the database, so as not to manually add a strip of simulation data.
How to use
Place the text table in the appropriate location, similar to the following:
File location:/assets/mock_table.csv: File contents: name#string, Age#int, course#stringxesam_1, 1, desc_axesam_2, 2, Desc_bxesam_3, 3, Desc_cxesam_4, 4, Desc_dxesam_5, 5, Desc_exesam_6, 6, desc_fxesam_7, 7, Desc_g
Then call the following method in application or activity or other appropriate places:
Mocksqliteinflater sqliteinflater = new Mocksqliteinflater (); Sqlitedatabase DB2 = Sqliteinflater. AddTable (mocktable.newassettable ("Mock_table.csv", Aliastablename)) . Reinflateto (this, dbName);
The above call creates a database named DBName, and then imports the contents of the Mock_table.csv file into the aliastablename database table
Demo
Other methods have been demo see Https://github.com/xesam/MockSQLiteInflater
Android Share Q Group: 315658668