file - How to Store Android Pictures to Prevent User Deletion but Still Give User Access -


i'm working on first real android application, , have run use case problem cannot seem find best practice. application has main screen recyclerview has imageview part of view makes individual list items. clicking on item in recyclerview takes activity viewpager giving details selected item , allowing user swipe through details of items displayed in recyclerview. part of workflow of adding or editing item, user can take picture used generating thumbnail recyclerview , display in details fragment in viewpager. plan provide ability user share detail entry, including picture, on social media or email or google photos. dilema how picture should stored on user's device. can store public external storage, scanned media scanner , can accessed user copying computer or sharing.

file file = new file(environment.getexternalstoragepublicdirectory(environment.directory_pictures), albumname); 

however, user can delete pictures stored there poses problem generating thumbnails , display in detail fragment.

another approach store pictures applications internal storage, so:

file file = new file(getexternalfilesdir(null), "demofile.jpg"); 

of course, protect pictures being deleted. however, user not able access storage location computer or other photo apps on device.

i store copy in both locations. however, seems waste of device space. there best practices such use case? others have experience scenario willing share?

the best approach be, upload picture user takes server via small .php script, guranteed, user cannot delete picture , causing app malfunction, while still giving user ability have local copy of image(s) on device.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -