Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

saving a bitmap to device

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi im trying to save a bitmap from my app;lication but am getting the following error


the code im using to save the bitmap is




this seems to be a permission problem but i have the read write permissions in my manifest file



any ideas why this would happen also the device im using does not have an fysical sd card however it does have a virtual one

thanks
 
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Are you sure that this only needs the name of the file, and not a full path or anything?
 
Author
Posts: 26
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd check what Dave says, but if that doesn't work this may be a permissions problem as you hinted to.

What is your target api level (in the build.gradle file)? If you're targeting Marshmallow (23) or newer (and you're running this on a Marshmallow or newer device) you have to use Android's new on demand permissions modal where you prompt the user for permission.
 
john bean
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the problem was due to android chainging the way permissions are don from sdk23 i fixed it by chainging my target sdk to 22 in gradle now it works
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic