About the Android file apk download that little thing

Source: Internet
Author: User
Tags nginx server

1. android file apk Download zip archive package Solution

If your download server is an Nginx server, then in the Nginx installation directory of the Conf/mime.types file corresponding location, plus the following line of statements, the specified APK file MIME type is application/ Vnd.android.package-archive can:

[HTML]View Plaincopy
    1. Application/vnd.android.package-archive apk;


If the Java-web server only needs to modify Web. XML, add the following text

[HTML]View Plaincopy
  1. <span style="FONT-SIZE:18PX;" > <mime-mapping>
  2. <extension>apk</extension>
  3. <mime-type>application/vnd.android.package-archive</mime-type>
  4. </mime-mapping></span>

2, about sharing links can not download the problem

If you are now:/http/www.baidu.com/1.apk

You need to create a new folder named Down.myapp.com in the project directory, and put 1.apk into

:/httpwww.baidu.com/down.myapp.com/1.apk

So you can use direct sharing, change the link after the click for the jump to the browser to download

3. System type to obtain requests based on request

Take the Java-web server as an example, you can differentiate between iOS and Android by requesting a request from HTTP for category download

[Java]View Plaincopy
  1. <span style="FONT-SIZE:18PX;"  >string useragent = Request.getheader ("user-agent");
  2. if (useragent = = null)
  3. useragent = "";
  4. if (Useragent.touppercase (). Contains ("Android". toUpperCase ())) {
  5. Response.sendredirect ("/1.apk");
  6. }
  7. else if (Useragent.touppercase (). Contains ("IPhone". toUpperCase ())
  8. || Useragent.touppercase (). Contains ("ios". toUpperCase ())
  9. || Useragent.touppercase (). Contains ("ipad". toUpperCase ())) {
  10. Response.sendredirect (https://itunes.apple.com/***);
  11. } Else {
  12. Response.sendredirect ("/1.apk");
  13. }
  14. </span>



4. Other

About link addresses: Generate short links from the server and facilitate user input.

For example:www.baidu.com/test1.apk can be written as Www.baidu.com/test1 based on the request header optimization
About sharing: Join the sharing feature on the local client, use Sina Weibo, share the client's QR code, or download the link

About the market submission: 360 mobile phone assistant, AZ market, etc. are good, packaging can make UF Alliance and other third-party packaging tools

About the Android file apk download that little thing

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.