Installing APK on BlueStacks

420

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 am up to BlueStacks 9 on my new PC.

It is very configurable.

I vaguely remember seeing a shared directory setting, though I have not tried it yet.

Oops, sorry, wrong emulator.

Here is the MEMUPLAY settings page for disk access.

I won't know my BlueStacks settings until I power up my laptop (if indeed that's where i use BlueStacks)

392

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.

Please explain the following:

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.

Is this the same for both apps ???

Yes I reinstall the same App TrovaRobe

There have been discussions on this board in the past concerning reinstalls.

It would make a good search term for you.

See here

Before uninstalling, go to the app settings and delete its data

Taifun

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 need to correct this sentence. In fact, after installation, the structure is built, but folder files and so on are missing.

OK, I'm back here, more confused than before.
I did the same test with another app.

  1. I uninstalled the app.
  2. I checked in Android/data... nothing about the app exists.
  3. I reinstalled the app.
  4. Folders and files that were there before the uninstallation have reappeared in Android/data.

Where from came the files and why do the two apps behave differently?

See again my previous answer

Taifun

I've tried these two procedures on a phone not with BlueStacks:

  1. I uninstall without deleting the data

  2. There's nothing in Android/data/...

  3. I install

  4. I check before opening the app

  5. The data has been restored

  6. I open the app... everything's OK

Second procedure:

  1. I go to Settings... Applications... My App

  2. I clear cache and data

  3. I uninstall

  4. There's nothing in Android/data/...

  5. I install

  6. I check before opening the app

  7. The data has been restored!!!

  8. 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?

You could try to start the app after clearing data and then uninstalling

Taifun

I modified the app so that it doesn't do anything on startup.

I installed it.

Its files are in the internal memory as normal.

I deleted all the app's files from Settings...Applications...

I reopened the app.

I closed and uninstalled it.

There are no files in the internal memory.

I reinstalled it.

Without running it, the internal memory has its files restored.

Try it on s real device
This looks like a Bluestacks "feature"

Taifun

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?

Taifun