• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android APK file gives parse error on download

sakula

Lurker
May 15, 2012
5
2
I am getting a parse error when i try to download the .apk file from one of our custom web sites. We are using IIS 7 and i did set the MIME type to "
application/vnd.android.package-archive
".

Can you anyone please let me know if you have come across similar issue while downloading the apk file from a web site and not from Android Market.
 
We dont want to use Android Market so we wanted to make it work through a web site. I have seen articles where people say its simple and straight forward to download it from a web site but nothing seems to be working for me. I did check the APK file to see if its properly singed against jarsigner etc. Also, i was able to uninstall and install this app on the emulator but not sure why it doesnt work on Android Phone.
 
Upvote 0
Try using the market instead of a warez site?

It doesn't necessarily have to be a warez site, there are plenty of legitimate sites where you can download apk's directly. That's how Getjar works as far as I'm aware. :)

That being said Sakula, is this an app you're developing yourself? Any reason why you don't want to go via Play?
 
Upvote 0
I make my app available via market and direct link

For direct I do it PHP (just a language of choice than anything else) and send in following headers (apologies for cut & paste):
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: application/vnd.android.package-archive");
header('Content-Disposition: attachment; filename="'.$filename.'"');
header('Content-Transfer-Encoding: binary');
header("Content-length: $size");
header('Expires: 0');

Would suggest to use header('Content-Transfer-Encoding: binary') in particular in addition to content-type. http://roundere.com/apk.php just in case you want to test against known good download. So that you're assured before downloading you can also find the app on Google Play @ https://play.google.com/store/apps/details?id=com.roundere and read its description etc.

@El Presidente, in addition to reason cited by @sakula, I can say that I want mine to be used on devices that Google Play does not support, un-certified android devices are one such category, sensor restriction (based on permission) on supported devices is another, yet another one is for those people that google has booted out due to some reason (read corporate tie-ups/revenue in particular). Maybe we should start a new topic in development forum to get feedback, seems to be an important issue.
 
  • Like
Reactions: El Presidente
Upvote 0
I made some progress here. After adding the custom headers as mentioned above i was able to download the app from my GMAIL and install it but when i try to do the same from the web site it wouldn't let me do so, i am thinking there is may be some configuration setting in IIS 7 thats preventing me from downloading it to my android phone. Does anyone have any idea what the reason would be in this scenario? Please let me know.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones