android - Adding folder in Internal Storage in public? -
am create excel file store in internal storage,but not able do.it create within app storage directory.not visible in public.how create folder , store file in folder?can 1 know help me solve issue.
file creation coding
public string generate(string file_name,string path) { seek { f = new file(activity.getfilesdir(), path); if (!f.exists()) { f.mkdirs(); } file = new file(f.getabsolutepath(), file_name); if (file.createnewfile()) { file.createnewfile(); } wb_setting = new workbooksettings(); wb_setting.setlocale(new locale("en", "en")); workbook = workbook.createworkbook(file, wb_setting); workbook.createsheet("report", 0); excelsheet = workbook.getsheet(0); createlabel(excelsheet); createcontent(excelsheet); workbook.write(); workbook.close(); file_path_alert_builder = new alertdialog.builder(activity); file_path_alert_builder.settitle("file path"); file_path_alert_builder.setmessage(""+file).setcancelable(true).setpositivebutton("ok",new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialoginterface, int i) { dialoginterface.dismiss(); } }); file_path_dialog = file_path_alert_builder.create(); file_path_dialog.show(); }catch (jxlexception jxl_e) { jxl_e.printstacktrace(); } grab (malformedurlexception e) { e.printstacktrace(); } grab (ioexception e) { e.printstacktrace(); } homecoming null; }
you have take right path store files. there multiple options
internal storage
internal app (not accessible end users outside) cache directory (it can cleared if scheme running out of space)external storage (verify if available , utilize it) although public there 2 types
public private (technically accessible user , other apps because on external storage, files realistically don't provide value user outside app. )each path location can accessed different api provided android. see http://developer.android.com/training/basics/data-storage/files.html
android jxls
No comments:
Post a Comment