I created an app that uses files located in its internal folders (FileScope=App, referring to them as /folder/file).
I had no problem installing its APK on another phone. However, when I installed the APK on a PC and BlueStacks, it didn't find the files and, apparently, didn't install them. To install on the PC, I simply click on the APK file I transferred to the PC. It installs everything except those files. What should I do?
I have an app installed on BlueStacks that works fine and creates a folder with a file. I found this using the BlueStacks file manager. So for now, I think that when installing the APK, it doesn't install the files located in .....data/files. So I think the app itself must create them initially, perhaps by transferring them from the canned files //file. I'll look for better solutions.
I have never seen any other way to package files with an app other than the Media folder at build time, then finding them in the Assets folder at run time.
The FAQ linked above has my meager knowledge of files, with some run time loading samples.
I have an app installed on my phone that uses files in a folder located in Internal Memory\Android\data\appinventor.ai_renato_bolognesi.TrovaRobe\files\SAVE\file.txt
It writes to and reads files.
I uninstall it.
I reinstall it from an APK file produced by an app that uses the same files in the same locations.
The newly reinstalled app has the same files in the same locations.
OK, sorry, I wasn't precise and I was confused.
Now I tried with an app that writes to /SAVE/PROVA.txt and reads the same file.
After simply installing the APK, there's nothing in the internal memory related to the app.
If I read immediately, it obviously gives an error.
If I write, the entire structure \Internal memory\Android\data\appinventor.ai_blabla\files\SAVE\PROVA.txt is created.
So the app itself has to recreate the folders and files it needs.
If, however, we are only updating the app, the structure is not touched and the app continues to use it.
I've tried these two procedures on a phone not with BlueStacks:
I uninstall without deleting the data
There's nothing in Android/data/...
I install
I check before opening the app
The data has been restored
I open the app... everything's OK
Second procedure:
I go to Settings... Applications... My App
I clear cache and data
I uninstall
There's nothing in Android/data/...
I install
I check before opening the app
The data has been restored!!!
I open the app... everything's OK
Should I also delete the data from the program before the uninstallation procedure? Or sould I wait a while before reinstalling?
From post 5 im not talking about BlueStacks but on real phone.
I also used, for another test, an app I use for various tests. I completely changed the blocks. Well, when I installed it, its internal memory had the folder and files from the last time I installed it. I tried changing the revision in 'Project Properties' and it reloaded everything. The only way to get the internal memory clean was to change its name.
I deleted manually the internal memory folder and file. After this operation the subsequent installation leaves the internal memory clean.
Do you like to share your test project so others can test, too?
Which device/Android version are you using for your tests?
Did you try on other devices?