I am writing an mobile app using Flutter. I want to change some of the default file paths existing in my device.
For example, whenever I click a picture using my phone, it is stored in the default folder.
/storage/emulated/0/DCIM/Camera
I want to change the default file path so when I click a photo, it gets stored in a location of my choice.
Is there anyway I can do that using Flutter?
Is there anyway I can do that using Flutter?
No. There is no way of doing that without Flutter, either.
Where a camera app stores its photos is up to the developers of that camera app. That may be in the location that you specified. It may be somewhere else on the device. It may be not on the device at all, but instead sent directly to a server. Regardless, other apps do not get to control that behavior for when the user uses the camera app directly.
If your app is asking a camera app to take a picture using an ACTION_IMAGE_CAPTURE Intent, you can request that the camera app store the resulting photo in a particular location, using EXTRA_OUTPUT.
Related
I have the below tag in my website for downloading image
<a href="data:image/png;base64,%20iVBOdfd...." download="myimage.png" />
The above tag is working normally, when it is pressed, it will download the image without any issue.
When I tried this function on ios / android, the web browser will download the image to some "Download" folder instead of writing it to camera roll (IOS) / DCIM (android).
My question is, is it possible to write to camera roll or DCIM? If it is possible, how can I achieve it? This function is crucial to my application as my users always find it hard to navigate on phone to retrieve the downloaded images at later time.
P.S: My concern is more about the writing destination, filesystem access on phone, not the download itself.
P.S: this is a normal website written using html, vuejs. not native, not react native, not vue-native.
Thank you.
That is not possible since it is the web browser who has access to the device and your web application cannot decide where to save the image. You'll need to implement an app to achieve the expected result. Also study Progressive Web Apps to see whether it's possible
I'm working with the camera in Android for the first time and am hung up on a few things that seem to be required. I've given the app Camera permissions and I can see the thumbnail image.
After searching I found this google example that states I must create a file to see the full size image. Why? Also, in creating a file I have to ask the user for permission to write to disk. I have no intention of saving the photos, however I need to create a file and and now need to worry about file cleanup.
Lastly, this full sized image has no EXIF data. I've found a way to create a bitmap with the file to rotate the image. Is this correct? It seems like a lot of work to just see a correctly oriented image that i've just taken.
After searching I found this google example that states I must create a file to see the full size image. Why?
A full-size photo is much larger than the 1MB limit for Intent contents.
I have no intention of saving the photos, however I need to create a file and and now need to worry about file cleanup.
Then do not use ACTION_IMAGE_CAPTURE. Use the camera APIs directly (android.hardware.Camera, android.hardware.camera2.*) or via a third-party wrapper (Fotoapparat, CameraKit-Android).
this full sized image has no EXIF data
With ACTION_IMAGE_CAPTURE, you are delegating to whatever camera app the user happens to choose. That will be one of hundreds of camera apps, whether pre-installed on the user's chosen device or installed by the user from the Play Store or elsewhere. The behavior of those camera apps, with respect to EXIF tags and anything else, is up to the developers of those camera apps.
It is also possible that you are not reading the EXIF tags correctly.
After searching I found this google example that states I must create a file to see the full size image.
That is a nonsense statement in that document. You do not have to create a file yourself. You only need to supply a file path in the intent so the used Camera app knows where to store the image.
Further i never saw a camera app that didnot include an exif header.
I am still new to cloud and mit app inventor.But I would to ask some question regarding cloud and mit app inventor.
But firsty i would like to explain how project should work.
My project is about home security system. When a press button is pressed, it will capture the image of visitor and the home owner will receive picture of the visitor on android app. The android should be able to receive picture and unlock door by pressing button unlock. The camera used is VC0706 Camera connected to Arduino Mega.
My question is that can mit app inventor receive picture from cloud since all of the picture taken will be stored in cloud.
Accessing images and sounds in App Inventor 2
Applications built with App Inventor can access sound, image, and video sources from three different kinds of locations:
Application assets
The sources labeled Media shown in the designer — part of the application's assets — are packaged with the application. Anyone who installs your application will have them, as part of the application. You also specify them in the designer, which is convenient. You can also specify these in programs by their file name: just use the file name without any special prefix. For example, if you have an image asset named kitty.png, you can use it as an image: just set the Picture property of an image component to the text kitty.png. You can similarly use files names for sound (Sound or Player) or video (VideoPlayer).
Assets are the most convenient to use, but the space for them is limited to a few megabytes, because they must be packaged with the application. They are good for small images and short audio selections. Bit you would probably not use them for complete songs or videos.
The phone SD card
You can access files on your phone's SD (secure digital) card using file names that begin with /sdcard . You could play a song on your SDCard by setting the source of a Player component to
/sdcard/Music/Blondie/The Best of Blondie/Heart of Glass.mp3
and starting the Player (assuming of course, that the song file is on the SDCard). Make sure to specify the complete file name, including the "mp3".
The Android system also includes an alternative way to designe SDCard files as URLs. Here you prefix the file name with file:///sdcard and use "URL encoding" for special characters. For example, a space is "%20". So you could designate the same file by setting the player source to
file:///sdcard/Music/Blondie/The%20Best%20of%20Blondie/Heart%20of%20Glass.mp3
Note that you'll want to use a Player component for this, not Sound. A complete song like this is too large for Sound to handle.
Images and videos can be designated similarly.
App Inventor doesn't (yet) include any way to store files on the SD card. It also doesn't (yet) include a way to list the files on the SDCard. You'll have to use other applications or the Android phone file manager for that.
Using the SD Card provides a lot more space for media than trying to package things as assets. The drawback is that users won't automatically get them by installing your application.
URLs and the Web
You can access files on Web using URLs, starting with http:// , for example, setting the picture property of an image to
http://www.google.com/images/srpr/nav_logo14.png
and similarly for music and videos. Make sure you use the link that points to the actual file, not to players for the files, which is much more common on the Web, especially for music and videos.
Other content URLs
The Android system also uses URLs to access various places that media is stored on the phone. For example, the images in the photo gallery can be accessed with file names beginning content://media/external/images/media , as you can see by using the ImagePicker and examining the resulting image path.
App inventor 2 has built-in web storage TinywebDB which stores text strings only.
In your scenario, post the images to somewhere on the web, and then store the image URIs in TinyWebDB insdie App inventor.
Yes, using MIT App Inventor you can send and receive the picture not directly but indirectly. First, you have to convert that image to imagebase64 it means in text formate then decode this text to get the original image. It means you can store any images in clouddb or firebase. Here is the video about that
https://youtu.be/ySruxnxeJgM
I want to display pictures in the Gallery but without giving the user the capability to manipulate/send them or change the settings of the Gallery application.
Currently I am using the following code:
Intent intent = new Intent(Intent.ACTION_VIEW,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivity(intent);
When I am using ACTION_PICK, the Gallery is opened in "clean" mode without all those functions (manipulate image, send image, change settings, etc) and this is what I am looking for but with ACTION_VIEW intent.
There are hundreds, if not thousands, of "gallery" apps, both pre-installed on Android devices and downloaded from places like the Play Store.
There are no options on ACTION_VIEW to allow you to request "manipulate/send them or change the settings". And there is no requirement that every gallery application honor such a request, even if there were a way to express it.
ACTION_VIEW, and similar implicit Intents, are for linking to third-party apps, where those third-party apps can do what they want. In that respect, it is like linking to a Web site -- you cannot control, from your site, what another site shows the user.
If you need absolute control over the UX here, write your own image viewer.
Is it possible to get a video thumbnail from a video that is private to your app? (thats probably the best way to explain it)
I have an app which runs exclusively on a 4.3 device of which the user has no control over. Therefore, the standard getvideothumbnail() function doesn't work as the function requires the user to actually look at the file before creating a thumbnail accessible to other apps.
So, if an app autonomously downloads a video, and the user has no interaction to make android create a thumbnail, how can I obtain a thumbnail?
thank you for any help.