I´m currently developing an app which works as an Update Manager. So far the app has work great whenever I installed or updated any other app. All these apps have been installed on the data/app folder and I have used the android.content.pm.IPackageManager class with the installpackage() method to install them.
Im working on a costum ROM which has a Internal Memory (1 GB), a internal SDCARD (4GB), and the External SD CARD (8GB). Due to the fact that all my apps have been installed on the data/app folder I´m running out of space in my internal memory!. I was wondering if i could use the same installpackage() method to install the apps on the external SDCARD (or the internal).
Here is how i install the apps :
private Class<?> iPackageManagerStubProxyClass;
iPackageManagerStubProxyClass = Class
.forName("android.content.pm.IPackageManager$Stub$Proxy");
public void installPackage(Uri uri) throws NoSuchMethodException,
NumberFormatException, IllegalArgumentException, IllegalAccessException,
InvocationTargetException, ClassNotFoundException {
Log.i(LOG_TAG, "installing without deleting");
Method method = getMethod(iPackageManagerStubProxyClass, "installPackage");
method.invoke(packageManagerServiceProxy, uri, getPackageInstallObserver(),
Integer.valueOf(INSTALL_REPLACE_EXISTING | INSTALL_INTERNAL), "");
System.out.println(method);
}
Im starting to suspect that i can´t do the same to install the aplications on the sdcard. Any sugestions? If not ,could I move my apps programatically to the sdcard after instalation?