Is it possible to check info about the android:installLocation of my app, if it is installed on /data/app or on SD card?
I need to check if my app moved to SD card then need notify user that the autostart doesn't work.
I used this answer to get application install directory How to get app install directory
Hope it helps
Related
I need some help with granting write permissions to external sd card on an Android TV box (Xiaomi Mi Box).
I plugged a micro SD card using a USB adapter and I can access the files and read them without any problem. I can even write to an app specific folder located at Android\data\app package name.
However, When I try to write files to the root directory of the sd card I'm asked to Grant permission to the app. On a normal Android phone a different app bulit in inside of Android will be opened, where there I will select the sd card and then and give the app a permissions for writing to it. However, this app doesn't exists on the Mi Box.
I side loaded the app to the streamer (it's called my files),and it was installed successfully, but it didn't show me the sd card I plugged in what so ever, so I couldn't give the app a write permissions.
So my question is: is there an alternative way to grant an app a write permissions to an extenal SD card? Maybe through adb?
If someone knows about any solution it would be really helpful.
If your solution doesn't involve rooting it would be wonderful.
Thank you and have a great day!
Requirement: When I install app from the playstore,after clicking on install button I want to show a dialog whether app should be installed in SD card or internal memory. How can I achieve this. Can someone help me out
Check manifest's android:installLocation.
Dynamically changing the android:installLocation is not possible.
I know this is may or may not be possible,but I just want to confirm is it possible in android or not?
So here it goes,Let's say I have an android app ( example my_app.apk) ,I copied my_app.apk from my computer or through pendrive or downloaded from website to my android device( let's say I copied to /sdcard/).I have also activated install app from unknown sources in my phone settings.
Now is there any way through which I can make the App to auto install on the device as soon as I copied to /sdcard folder? I mean my_app.apk should kick auto installation on the device without user navigating to /sdcard of the device and selecting the app and clicking the install option.
I just want to know is this possible in Android? if Yes how can I achieve that? I don't want to use other third party applications to kick off installation,instead the app should kick installation itself as soon as it gets copied to /sdcard folder.
Any help would be appreciated.
I think that is not possible. It is possible to have Android app which checks some folders and detects new file and automatically install new apk files. To install apk package ordinary (from SD card) you should activated installing from Unknown sources in settings. Auto instalation packages aren't possible, because it could be security problem.
I have an app on Google Play market and I added android:installLocation="preferExternal" to manifest.xml file and released long time ago. Now I would like to add Android home screen widget, so I need to change it to android:installLocation="internalOnly". If I do that, what happens when a user upgrades? because a user already installed the old app on SD card. What is the best solution for this situation??
If someone has this kind of experience, please advise me.
Thanks in advance :)
When you set install location to preferExternal the application specific files are stored in .android_secure directory in external sdcard.
These type of application are not available when user mounts the SD Card as USB Mass Storage (feature removed from Android Jelly Bean).
Coming to the question, I believe in your case the application would be installed onto internal memory with the files from .android_secure moved to internal location.
You can confirm this by the following:
Install the application from play store having install Location as preferExternal.
Confirm that your application is installed in external SD card, you can use Settings->App to check that.
Now create your new signed application package.
Install using adb install -r myapp.apk
Again goto Settings->App and confirm the location.
Run functional test to see if nothing is broken.
Old question, but according to my test, if an app is installed on SD card and you change afterwards the Manifest to android:installLocation="internalOnly" (or omit the android:installLocation attribute, which is the same), when the app is upgraded the package manager will automatically move the app from SD Card to internal storage.
No idea what happens if this is not possible (not enough root on internal storage for example).
My requirement is to be able to move all apps installed on the device(tablet) to an external SD card with the click of a button.
My research says, unless a .apk file have a manifest attribute installLocation specified as auto or preferExternal, the app cannot be moved.
Using PackageManager class allows me to get a list of all files installed on the device.
But I cannot find how to move an app, is it possible?
It is not possible to move apps to external storage if they are not specified as being allowed to, unless your device is rooted.