• 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

Need logic to store an image

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
In my project i want to capture an image.(i done this)
That captured image should be uploaded to the server(i will do it)
But the problem is- the image which has taken only uploaded to the server.

Now, how can i check this condition?

If the user replaced the original captured image with the same name then i cannot accomplish what i need to.

Please correct me, if i'm wrong.
1) storing the image in the internal memory
2) storing the image in the sqlite using blob
(in both cases after uploading ,the images should be deleted)

If i store the image in the sd card, is it possible to write protected the image ?

Thanks kindly,
Anand

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think I understand the problem. If you don't want to overwrite an existing file, why are you allowing the user to do so? Your code can pick a unique name for it, no?
 
Anand Damodaran
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf,

Ulf Dittmer wrote:If you don't want to overwrite an existing file, why are you allowing the user to do so?



Yes, i should not keep the image in the sd card.

Just asking for my curiosity, is it possible to make the image write protected by using any classes in android api?

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There seems to be a disconnect between the question I asked, and the answer you gave, so I'm still not sure why you are allowing the user to overwrite the file. If you store it in Internal Storage, then no other app can get at it.
 
Anand Damodaran
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:There seems to be a disconnect between the question I asked, and the answer you gave, so I'm still not sure why you are allowing the user to overwrite the file. If you store it in Internal Storage, then no other app can get at it.



Dear Ulf,

I tried to store the image in the internal memory. But,

This doesn't allows me to store the image in the internal memory.

please give any suggestions to store the image in internal memory or sqlite.

Also my camera activity crashes after clicking OK, why is it so?



Thanks kindly,
Anand


 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even if that Intent does not store in Internal memory directly, you could move the file data to Internal memory afterwards.

Also my camera activity crashes after clicking OK, why is it so?


You need to TellTheDetails: Post the stack trace and the code that's causing the crash.
 
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic