User Tag List

Page 9 of 9 FirstFirst ... 7 8 9
Results 81 to 86 of 86

Thread: Android copy/Load image using file object

  1. #81
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2020
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about?

    android:fullBackupContent="false"

    also a post here said:
    If you are targeting android 10 then you have to put android:hasFragileUserData="true" in application tag of AndroidManifest.xml

    the full post:


    If you are targeting android 10 then you have to put android:hasFragileUserData="true" in application tag of AndroidManifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
    android:name=".MyApplication"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"
    android:allowBackup="true"
    android:hasFragileUserData="true">

    .....

    </application>

    </manifest>
    android:hasFragileUserData is a new manifest setting (I’m guessing on ). “If true the user is prompted to keep the app’s data on uninstall”. This seems ripe for abuse, but I can see where it might be useful for some apps.

    See https://commonsware.com/blog/2019/06...-q-beta-4.html

  2. #82
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    7,184
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    we have no fragile in the manifest and we don't set backup for data in google drive, so all data must be removed when you uninstall, unless something else in the OS is keeping it.

    again not my case here

    ==============================

    android:allowBackup
    Whether to allow the application to participate in the backup and restore infrastructure. If this attribute is set to false, no backup or restore of the application will ever be performed, even by a full-system backup that would otherwise cause all application data to be saved via adb. The default value of this attribute is true.


    Note: If your app targets Android 11 (API level 30) or higher, you cannot disable device-to-device migration of your app's files. The system automatically allows this functionality.


    You can still disable cloud-based backup and restore of your app's files by setting this attribute to false, even if your app targets Android 11 (API level 30) or higher.

    android:hasFragileUserData
    When the user uninstalls an app, whether or not to show the user a prompt to keep the app's data. The default value is "false".
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  3. #83
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2020
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The truth is I don't understand how the issue happens, all I know is it happens on both of my devices, the lg wing (android 10) and the samsung galaxy tab (android 11).

    Please let me know if there is something I can do to help narrow down a solution. This fix is crucial for data privacy and security for my app.

  4. #84
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2020
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fernando, I believe I figured out the issue.

    I load a originalimage.jpg into data storage directory using file object load operation we did, copied file is now called imageloaded.jpg

    File in data storage: imageloaded.jpg

    perform copy from data storage to scoped storage folder: creates new file in scoped storage/imageloaded.jpg

    I then manually copy imageloaded.jpg from scoped storage to internal storage/backup folder/imageloaded.jpg.

    Uninstalling the app deletes data storage/imageloaded.jpg and scoped storage/imageloaded.jpg

    I reinstall the app and the image is still present in the app.

    It turns out it is loading internal storage/backup folder/imageloaded.jpg

    If i delete internal storage/backup folder/imageloaded.jpg it then deletes the image in app.

    ---------------------------------------------------------------------------------------------------
    This behavior is not correct. The image in app is only supposed to be loaded into the active picture from data storage/ imageloaded.jpg NOT internal storage.

  5. #85
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    7,184
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    One big question do you have backup ON in google drive for your applications?

    Uninstalling the app deletes data storage/imageloaded.jpg and scoped storage/imageloaded.jpg
    Nice so the OS is doing what is supposed to do.

    It turns out it is loading internal storage/backup folder/imageloaded.jpg

    If I delete internal storage/backup folder/imageloaded.jpg it then deletes the image in app.
    You need to check your backup settings or do you have Google 1 app?

    Go to settings, Google services and check what setting you have there, TURN OFF and see if this still happens.

    BUT before you can check in backup details, what application are in Apps. OR maybe you have a full device backup ON?

    The manifest information from runtime show that not backup is allowed, which is what as developer must be done to not make the data be backed-up

    <application android:icon="@mipmap/ic_launcher" android:largeHeap="true" android:allowBackup="false" android:networkSecurityConfig="@xml/network_security_config"
    android:hardwareAccelerated="true"
    android:requestLegacyExternalStorage="${Legacy}"
    android:theme="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"
    android:label="@string/app_name" android:allowTaskReparenting="true">

    OK this is what is happening you have the application installed in two devices so migration between them in android 11+ can't be stopped

    from https://developer.android.com/guide/...nt#allowbackup


    Note: If your app targets Android 11 (API level 30) or higher, you cannot disable device-to-device migration of your app's files. The system automatically allows this functionality.


    You can still disable cloud-based backup and restore of your app's files by setting this attribute to false, even if your app targets Android 11 (API level 30) or higher.
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  6. #86
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2020
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried this and I am not sure it is making a difference.

    To clarify:
    I have a active picture in my app that is set to load app data storage/apple.jpg

    I use file object:
    copy 0/pictures/userpicture.jpg -> app data storage/apple.jpg

    I use file object:
    copy app data storage/apple.jpg -> scoped storage 0/android/data/com.myapp.myapp/files/documents/data backup

    Open file manager app and make new folder 0/backup files
    use file manager copy to copy 0/android/data/com.myapp.myapp/files/documents/data backup/apple.jpg -> 0/backup files

    uninstall my app (this deletes all of app data storage so app data/apple.jpg is gone)

    reinstall app

    active picture shows apple.jpg (where IS NOT in app data storage)

    open file manager
    Delete 0/backup files/apple.jpg

    open my app
    active picture shows empty
    ---------------------------------------------------------
    My active picture is only set to load from app data storage/apple.jpg NOT 0/backup files/apple.jpg
    but it is loading from internal storage folder even though app data storage is empty

    take note: when deleting 0/backup files/apple.jpg in file manager, make sure file manager recycle bin is empty. if 0/backup files/apple.jpg is in recycle bin then it will show in app still

Page 9 of 9 FirstFirst ... 7 8 9

Similar Threads

  1. WebView2 cannot load image in android
    By pradeep in forum Android Export Module 2.5
    Replies: 3
    Last Post: 5th July 2019, 03:36 PM
  2. Replies: 0
    Last Post: 25th April 2015, 06:01 PM
  3. How to load An Animated Image from file?
    By path in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 28th August 2012, 07:40 PM
  4. file object won't copy? or create new directory?
    By Skeets in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 23rd June 2010, 11:37 PM
  5. file object ... Does the copy action...
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 22nd April 2008, 10:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •