Picture in photo gallery no longer exists once I restart Flutter app (within Android Studio development environment) - android-studio

Within Android Studio Flutter development environment, I'm choosing a picture from its Photo Gallery, getting its file path and saving the path in database as text, and later retrieve the file path to refer back to the picture in the Photo Gallery.
This works fine, but once I restart the app (again, all within Android Studio), then the picture no longer loads as that file path is no longer valid.
Is Photo Gallery somehow specific to each Flutter session or something? Thanks.

That will depend on how the native part is implemented and the plugin you are using. On Android when you request an image from the Gallery using an Intent, you may receive 'temporal access' to the file.
If you do not copy the image you may lose that permission to access the photo. You can ask the maintainer of the plugin or check if they use grantUriPermission to give access to the image file.

Related

How do I open up multple pdf files in Android app

In my app I plan to have a at least 40 different pdf files that come out to about 4gb obviously that's way to much to jave inside an app with out a live data storage so my question is. Is it possible to have the files apart of the app and when the users download the app it goes in there phones or devices internal storage for location to where in side the app the people will click a button and it can open up the pdf file inside the app without it being slow or needed a data connection. Also I'm building this in android studio using kotlin.

How to deal with flutter web project name, icon and description?

I am developing a flutter web application. When I share the link, the link looks like this:
First screenshot - when I tap on share
https://i.stack.imgur.com/tHHzi.jpg
Notice that I changed Flutter default icon into my own icon in the /web/icons folder, which is ok.
Problem 1: The name is showing as the project (package) name (webcatalogo_shop). For Android and Ios I know ways to change the display name, but how to do this for Flutter web?
Second screenshot - after sharing (in this example, sharing via WhatsApp)
[1]: https://i.stack.imgur.com/APOsz.jpg
Same problem 1 above happens here, and I also found 2 other problems:
Problem 2: The Icon is showing as Flutter icon, even though I have replaced these in the /web/icons folder with my App's icon. I can't find Flutter images anywhere else under web folder.
Problem 3: It's also showing the project description "A new Flutter application." Where can I change this?
Can anyone give me some light on how to solve these? Thanks!
In your flutter project folder, you will have a web folder. In the Web folder open manifest.json. You can edit the name, description and icons properties.

Will the play store icon made by Image Asset in Android Studio cause "Hi-res icon" error?

I use Image Asset in Android Studio to generate the Google Play store icon, you can see Image A.
It's 512 x 512, 32-bit PNG.
But Google Play reject it, the following information is displayed
We found an issue in the following area(s): Hi-res icon
Are there some bugs with Image Asset to generate the Google Play store icon?
Image A
Reject Details
Your app is rejected due to the policy here: https://support.google.com/googleplay/android-developer/answer/9888374
Most likely this is the policy that it breaks:
App titles and icons that are so similar to those of existing products or services that users may be misled
Google is probably worried that the icon is just an microphone icon, which is used in other places in the Android system, and may therefore mislead users that the app is related to Android or Google.
Therefore, I suggest modifying your icon to differentiate it and make it unique, and then they should accept it.

How to download file to system on click in electron using react frontend

I am building a desktop app using electronjs and frontend using React, I have a table with each column having a download icon that uses the information of that row to build a URL when opened with directly download a file to your PC.
I have tried using <a href=${download_url} download><a> works perfectly on the browser but fails to work through the electron app, it opens a file selector dialog box asking me to save the file.
I have also tried doing a window.open(url) but that just opens an empty window, and does not download contents from the url.
How am I supposed to do download the file sent over from the URL ?
The behavior on download depends on the browser you are using.
Some browsers ask where to save the file to (e.g. Mozilla Firefox), others ask for permission to save the file (e.g. Windows Edge) or just download the file with the given filename (e.g. Google Chrome by default).
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes for more information on the download attribute.
To solve your problem:
There is a electron-way to do it: https://electronjs.org/docs/api/download-item
And a library to make this process easier: https://github.com/sindresorhus/electron-dl

Where does secondary image in (node.js) Windows 8 toast notification come from?

I'm using node-notifier (link) in node.js to show a toast notification in Windows 8. I have it working and I'm able to adjust the title, text, and main image in the notification just fine. However, in a Windows 8 toast notifications, there is a secondary (smaller) image. See below:
So, node-notifier uses toaster, which in turn uses ToastNotificationManager. But, I cannot find any reference anywhere to this secondary image. I've looked here and here on Microsoft's site.
This secondary image also shows in other notifications I receive from applications like Outlook, Slack, etc.
Where is this secondary image coming from? Is the documentation just out of date? Can Toaster be modified to access this secondary image?
The secondary image is the icon for the shortcut in the Start Menu folder for the program registered to raise a toast. To change it, you'll need to modify the icon on the shortcut.
For a desktop application to use the ToastNotificationManager class, it is required to have a shortcut in the start menu, and an AppUserModelId associated with that shortcut. At ToastNotificationManager creation time, the caller passes in the same AppUserModelId, which ties back to the associated icon for the shortcut. More about registering desktop applications to raise toasts this can be found on this MSDN documentation page.
Looking at the toaster code here, it is installing the shortcut to a file called toast.lnk in the Start Menu:
String shortcutPath =
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"\\Microsoft\\Windows\\Start Menu\\Programs\\toast.lnk";
And, it is creating the shortcut targeting the initial calling process:
String exePath = Process.GetCurrentProcess().MainModule.FileName;
Updating the icon in the shortcut manually should verify that you can change what is shown locally, but an update to toaster to set the icon location is likely required (to support multiple callers with different shortcuts, or by having it call IShellLink::SetIconLocation).

Resources