Recently, I have an i9000 Android mobile phone with 16 GB memory and no SD card. How can I download it?ProgramTo the memory and then install it?
I started one program a to download another program B. The Downloaded Program B can only be saved in the installation directory of program a ("/data//"), you are not authorized to save the settings elsewhere. You cannot obtain the input/output stream. However, when I download and prepare for installation, use Uri. parse (""/data/A/B .apk ") will report a parsing error, which should be the directory where the installer has no permission to access"/data/.
If I want to download the program for installation, where should I have the permission to install it (if it is not a problem to install it in SD ), or what permissions do I need to add to read the APK installation from the installed program directory?
CodeThe installation procedure is as follows:
File file = new file ("/data/A/B .apk ");
Util. printlog (TAG, "Get File OK ~!!!! ");
Uri uri = URI. fromfile (File );
Util. printlog (TAG, "Get URI OK ~!!!! ");
Intent startgameintent = new intent (intent. action_view, Uri );
Startgameintent. setdata (URI );
Startgameintent. addflags (intent. flag_grant_read_uri_permission );
Startgameintent
. Setclassname ("com. Android. packageinstaller ",
"Com. Android. packageinstaller. packageinstalleractivity ");
Startactivity (startgameintent );