1. Are you ready for the Galaxy S20? Here is everything we know so far!

File creation

Discussion in 'Android Development' started by Raviraj2018, Dec 13, 2008.

  1. Raviraj2018

    Raviraj2018 Lurker
    Thread Starter

    Hi,

    I am new to Android debelopment. I want to write an application which reads from a file stored on the device (Like a configuration file) and takes necessary actions. Here my problem is with respect to the file creation.. Where is the file getting vreated. I used

    File file = new file("/data/data/myApp");
    file.mkdir();

    File file = new file("data/data/myApp/textFile");
    file.Createfile();

    I am not able to see any new file getting created??Can any one help me please??
     



    1. Download the Forums for Android™ app!


      Download

       
  2. rschilling

    rschilling Lurker

    Give the method Context.getDir(path, mode) a try. It seems to create a directory on the device well, but the phone controls the specific name that's ultimately used.

    Code (Text):
    1. getDir("test", Context.MODE_WORLD_READABLE)
    seems to create a directory called "app_test". This suggests you have to use Context functions to manage files.

    Hope that helps...
     
Loading...
Similar Threads - File creation
  1. shakushinnen
    Replies:
    8
    Views:
    377
  2. Quaerimus Scientiam
    Replies:
    10
    Views:
    551
  3. regressist
    Replies:
    11
    Views:
    519
  4. parthag
    Replies:
    0
    Views:
    324
  5. Luca Franceschini
    Replies:
    6
    Views:
    432
  6. MikeHunt555
    Replies:
    5
    Views:
    364
  7. FeriM
    Replies:
    9
    Views:
    440
  8. Andy Perrett
    Replies:
    7
    Views:
    433
  9. July Hoang
    Replies:
    0
    Views:
    390
  10. SYOB SYOT
    Replies:
    13
    Views:
    904

Share This Page

Loading...