Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tablet can't download .apk file in some browsers

I am trying to download an apk file from my website and it works on every android phone (downloads and installs). I tried this on a Galaxy Tab 3 and it failed to just download the file. It shows that its downloading but its stuck on the progress bar forever and never downloads. It failed with these browsers:

  • Default Android Browser
  • Chrome
  • Dolphin

I tried it with Firefox and Firefox worked. It downloaded successfully and I was able to install it successfully after. So it does work (plus it worked on the phones I tested)

I thought maybe it had something to do with the mimetype so I checked that out and while inspecting the headers Content-Type I noticed it was "application/vnd.android.package-archive". This is the mime type according to Wikipedia

So just for safe measures I added this to my htaccess file

AddType application/vnd.android.package-archive .apk

It still failed.

I then tried this test on the following test site url and I was able to download it just fine on all browsers.

http://misc.commonsware.com/Now-debug.apk

So I figured that maybe because our site is in https that that might be the issue. I tested the same browsers with the "http://misc.commonsware.com/Now-debug.apk" url again except under https this time. It functioned the exact same way as it did on our site. All browsers except Firefox failed to download this. They just say downloading but nothing downloads.

Now I assume that maybe this test site just wasn't setup for SSL to begin with (I don't know as I didn't setup the server) so thats why its failing on most tablet browsers. Is there some weird SSL setting that could be super picky with some of the tablet browsers? Or do most tablet browsers just suck and I have to deal with it? I really don't understand why download this apk file on ever browser besides the main ones on the tablet (except Firefox, that still works)

Update

The Firefox browser on my phone does not download the application either. So I have the Chrome browser on Galaxy Tab 3 not downloading but its working on my phone Nexus 5. Firefox downloads it on Galaxy Tab 3 but not on my Nexus 5.

I setup remote developer tools on my desktop and connected to my phone for more info. My firefox browser makes a request to the url for download and receives the correct content-type application/vnd.android.package-archive.

So I decided to create a script that forces the content-type to be application/octet-stream and download it through the php script. I managed to get this to work on my Nexus 5 Firefox browser however, all of the Galaxy Tab 3 browsers still do not work. It was a very minor breakthrough but maybe it hints to what the problem could be.

like image 929
JoeMoe1984 Avatar asked Jun 30 '14 21:06

JoeMoe1984


1 Answers

I found this on stack overflow about the same issue.

Apparantly has to do with the HTTPS certificate authority not being excepted by android.

"The only solution is to use a certificate provided from a trusted CA."

like image 145
avk Avatar answered Oct 15 '22 04:10

avk