[Android Apps and Games] AndroidDeveloperLB:
So, I've noticed that the sharing feature of APK files is a bit problematic for Android Lollipop.

Now all APK files of installed apps are names "base.apk" , so it causes issues with apps that get those files (they either make copies of them, which is ok, or override the others, which is not ok).

Of course, the same issue can occur on the APK tool, if 2 APKs have the same name, but here it will always occur and make this feature quite annoying to use.

I have 2 ideas of how to solve this:

1. merge/compress all files into a new, single file ( a zipped file). Also need to rename the files before merging them.

The good thing about this method is that I could allow the user to choose the file extension, so that it could be sent even to Gmail (which blocks some files types).

Another advantage is that I could put the files in the appropriate folder, and so I could avoid renaming the files at all.

Some day, when I'll probably support batch operations on files, I could allow users to open this single file and batch-install the apps within.

2. copy the original files to new ones with different names, to make their names unique.

The good thing about this method is that all files names are visible, and the user won't need to download and decompress anything. Only the exact files that are needed.

3. use symlinks. Problem is that I'm not sure it would work, and it's not a part of the API, so even if I see it working on my device, it might not work for other devices. I don't even know how well it could work.

Of course, I could allow users to choose what to do, but what should be the default behavior?

For both of the first 2 solutions, I will have to deal with the next issues, which I'm not sure what's the best approach users would like:

1. What to do with the files? I can't monitor if the other apps have finished with them (so that I could delete them).

If I delete files before they've finished being sent, I could stop the sending process of the other apps.

I could let the user decide when to delete those files (maybe via a notification "click here when done with sharing APKs" or something), but this sounds a bit weird thing to ask for.

2. What happens if there's not enough space to create the new files because of other temporary files I've made? should I delete the old ones?

Like #1, if I delete other files I've made, this could be an issue for other apps.

3. What should be the name formatting of the apps? Apps names aren't unique. And you could send multiple APK files that have the same package name but with different version code... I could make it this way:

AppName_PackageName_VersionCode_AdditionalNumberIfNeeded.apk

The last part is in the super rare case where all other parts are identical somehow. Maybe I could also check for identical files.

The first part is problematic since the name might not be allowed for some characters, so maybe I will avoid using it, or try fixing it till it's possible to create the needed file name.

4. Where should I store the temporary files? I think it's the best thing to put them on the public path for my app (on the external storage), which gets deleted in case my app is being uninstalled.

What do you think ?