How do I take pictures with the camera and ensure that the taken pictures are only visible from within my own application. ie I don't want the pictures to appear in the gallery app?
EDIT:
Can someone show some code on how to set this path such that when the picture is taken and the user presses save in the camera app, it saves to getFilesDir path ?
How do I take pictures with the camera and ensure that the taken pictures are only visible from within my own application.
Don't store them someplace that is indexed by the MediaScanner. That could be in your application-local file store (e.g., getFilesDir()), or on external storage in a directory that has a .nomedia file.
I have tried storing image as blob in sqlite db, but the image still appears in the gallery
Either you did not store the "image as blob in sqlite db", or the images also existed in the file system somewhere. I am very confident that an "image as blob in sqlite db" did not get indexed.
Related
I have made custom camera and want to store images in same application instead of built-in gallery.I am taking pictures with my custom camera and want to make separate gallery for that application. A small thumbnail should appear on corner after taking the pictures then on clicking thumbnail it should open my custom galley. So far i have made custom camera which is taking pictures and videos now i want to store them in separate gallery. Please help me out how can i do this task and share your code if you have done already. Your help will be appreciated
You can learn about android file storage management using this link.
Android File Storage. You can read here about differences between Internal storage(Private Location) and external storage(Public location) .
Data Storage Internal/External
As you are not very clear with the description, so there can be 2 possibilities
You want a private location for your images with no other app can access. Private location has benefit that data which you save in this location is app specific. But at the same time you'll also be not able to access the images from file explorer.
You want a public location for your images but a specific place where only your app images are available. Public location has benefit that data (files, images) which you save can be publicly accessible via file explorer, at the same time it can be accessed by other apps in your phone which are granted storage permission.
Saving file in Internal Storage (Private location for app)
Hope this helps and resolves your query.
I'm writting an app on android that needs to access the profile pictures of someones WhatsApp contacts.
I know that when I click on the contact and then enlarge the profile picture it will be saved on the sdcard under /sdcard/WhatsApp/Profile Pictures.
So my question is there any possible way to trigger this saving image process for all contacts once in java?
I have the absoluite path of an image file name in sdcard. Is there a way to get the thumbnail of it just like the way they show in android gallery? The reason i need is I have few images selected from the android gallery and http post it to a server. If the size of the file is huge, it takes a long time to upload because of slow mobile data. Instead of the file, if i can get the thumbnail of it, it will be easy to upload.
I can work on image resize to resize the image on my own before uploading it. But I would like to explore if there is a easier way?
I have installed a number of apps that have their own image gallery functionality (not using another app via intents). The default view is usually a list of the folders in my SD card that contain images (usually with some kind of thumbnail representing the folder), and then when I drill down into one of these folders they display the thumbs of the images that the folder contains.
Is the folder list part of the MediaStore api, or are the developers doing this manually (query the file system for a list of folders, scan files in folder for common image extensions, etc)? The tutorials I'm finding online for creating an image gallery using the MediaStore api usually just query the whole SD card and fill a GridView with a Cursor returned from managedQuery. Are there better tutorials and documentation for making a custom image gallery?
I know you can use
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, null);
to get the blackberry camera application to be shown and allow the user to take photos. From which you can use a FileJournalListener to find any created files.
(As shown/implied in this forum post: http://supportforums.blackberry.com/t5/Java-Development/How-to-use-FileJournalListener/td-p/295424)
There are times however, when the user chooses not to take a photo but selects one from the file system. Since this wasn't created at the time I opened it, using the FileJournalListener is not going to meet my needs.
What should I use to get the selected file?
EDIT: The functionality I'm trying to produce I've seen in the Twitter for blackberry application
I think you should create a file picker first,
http://docs.blackberry.com/en/developers/deliverables/11958/Create_a_file_picker_856986_11.jsp
After that in the application, user could select whether to capture new picture or browse from their storage.
If user select the later, open up this file picker and for every images found user can view the image, and the application can save the path where the images located for further processing.