Check Mobile App
Read now
Start a Project

Getting read and write permission from External Storage in android

Save

How we get Read and Write Storage permission?

References: StackOverflow and android developer site.

 

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


8 comments

  • hari shankar
    kindly share source code, yr site is awesome. thank u
    • Shubham Agarwal
      Thanks for comment, I have already share code snippets.
  • wannassi rahma
    Hello sir ,i want to import data from xls file and insert it in my sqlite ,but when i click the button to import data my app stopped any help plz //

    btnimport.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(final View v) {
    File file = new File(directory_path);
    if (!file.exists()) {
    Utils.showSnackBar(v, “No file”);
    return;
    }
    dbQueries.open();
    ExcelToSQLite excelToSQLite = new ExcelToSQLite(getApplicationContext(), DBHelper.DBinfo.dataBase_Name, true);

    // Import EXCEL FILE to SQLite
    excelToSQLite.importFromFile(directory_path, new ExcelToSQLite.ImportListener() {
    @Override
    public void onStart() {

    }

    @Override
    public void onCompleted(String dbName) {
    Toast.makeText(Excel2SQLitActivity.this,”Data imported”,Toast.LENGTH_LONG).show();

    }

    @Override
    public void onError(Exception e) {
    Toast.makeText(Excel2SQLitActivity.this,”somthing go wrong”,Toast.LENGTH_LONG).show();

    }
    });
    dbQueries.close();
    }
    });

  • gee12
    Thanks, it helped me.
  • Gurudas
    Thanks .. it was very helpful
  • emmet ray
    Good piece of info, helped me to learn smthng. Thank you
  • Madiha Iqbal
    hey
    this is madiha iqbal
    can you please tell me that in which activity i have to write this code?
    menifest’s activity or main activity
    • anchit (Moderator)
      the first two lines of code needs to be written in the Manifest file.

      Rest of the code needs to be written in any of the acitivity file where you need to use this permission

  • css.php

    When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

    Michael Urresta

    Michael Urresta

    Talk to Sales

    Global

    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home