Android - Import CSV File Into SQLite Databse -
i want enable users able import csv files sqlite database, 1 table called inventory
how user can select csv file within app , load in data database without replacing there?
thanks
you must read content of csv file , add content database. this read csv file.
edited
you can using read csv file storage
public class mainactivity extends appcompatactivity { private static final int request_code = 1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); intent intent = new intent(intent.action_get_content); intent.settype("file/*"); startactivityforresult(intent, request_code); } @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if(resultcode == result_ok){ if(requestcode == request_code){ uri fileuri = data.getdata(); log.i(getclass().getname(), "fileuri" + fileuri); } } } }
Comments
Post a Comment