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
- Application/vnd.android.package-archive apk;
If the Java-web server only needs to modify Web. XML, add the following text
[HTML]View Plaincopy
- <span style="FONT-SIZE:18PX;" > <mime-mapping>
- <extension>apk</extension>
- <mime-type>application/vnd.android.package-archive</mime-type>
- </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
- <span style="FONT-SIZE:18PX;" >string useragent = Request.getheader ("user-agent");
- if (useragent = = null)
- useragent = "";
- if (Useragent.touppercase (). Contains ("Android". toUpperCase ())) {
- Response.sendredirect ("/1.apk");
- }
- else if (Useragent.touppercase (). Contains ("IPhone". toUpperCase ())
- || Useragent.touppercase (). Contains ("ios". toUpperCase ())
- || Useragent.touppercase (). Contains ("ipad". toUpperCase ())) {
- Response.sendredirect (https://itunes.apple.com/***);
- } Else {
- Response.sendredirect ("/1.apk");
- }
- </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