Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Writing Permission Issue  RSS feed

 
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a problem with my backup and restore of a database in my Android App.

I have a few different problems.  The first is it won't create the directory, even though I have write permissions -



The logcat is -



Then, with a backed up database that works fine on other phones, the import wont work either -



The logcat looks like this -



So no errors.  It doesn't say it can't find or access the file, it just seems to ignore the contents of it?

Any ideas?
 
Ranch Hand
Posts: 146
1
Android Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the first code, you getting "Directory is not created" is because the directory is not created.
Modify your code to this way
 
Andy Crowther
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I'll try, but does that not try and make the directory twice?  From what I read, putting it right into the IF statement tried to make it and based the IF statement off the result?
 
Andy Crowther
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To confirm.  I get the same result.
 
Randy Tong
Ranch Hand
Posts: 146
1
Android Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still getting "Directory is not created" ?
 
Andy Crowther
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct.  In my code, I actually had the line you suggested already there, but commented out. I think I'd tried it before.
 
Andy Crowther
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so I needed to ask for permission at run time.  For anyone else with this problem, my code is now -



I will make a new thread for the reading database issue I think, as the thread title isn't really appropriate for that.
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
Download Free Java APIs to Work with Office Files and PDF
htttp://www.e-iceblue.com/free-apis.html
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!