How do I install APK from memory when Android has no SD card?

Source: Internet
Author: User

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 );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.