Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 11, 2011 01:28 PM by S1Niz7el2
Aug 26, 2011 03:19 AM|LINK
I create a webpage that will download our APK files to Android Smartphone but when I try to do it on Android, I get HTML instead of download window. But it worked perfectly on my PC. Heres my code.
public static void DownloadFile(string filename, string sContentType, System.Web.UI.Page page)
string path = page.Server.MapPath(filename); //get file object as FileInfo
System.IO.FileInfo file = new System.IO.FileInfo(path); //-- if the file exists on the server
page.Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
if(sContentType.Length > 0)
page.Response.ContentType = sContentType;
page.Response.ContentType = "application/octet-stream";
page.Response.End(); //if file does not exist
Aug 26, 2011 04:35 AM|LINK
when you say it worked on your pc, do you mean on your pc using an android emulator, or do you mean just going to your website with your browser? What is your target ADV. I am new to android developement but depending on your API level and platform, regulat
html will not render the link on your andoid phone. You are going to need to take additional steps.
Aug 26, 2011 04:59 AM|LINK
Well, I am also new to Android, its in my website browser but I used Android phone to open the URL and from there downloading our application MyApp.APK. Its supposed to work the same as downloading Android application from Android Market or GetJar. I used
the code above to download our application but I was not able to do it. What additional steps do I need, I would appreciate it if you can share it with me. Thank you.
Aug 26, 2011 05:03 AM|LINK
what API level and platform is the android phone you are using?
Aug 26, 2011 05:17 AM|LINK
Hi Remo, thanks for your quick response. I am using Android Infuse 4g but this is supposed to work with all Android Phones and the application can be installed with any carriers ATT, Verizon, Tmobile and Sprint. Not sure of what the API Level. I have VS
2010 and I just wanted my code would work.
Aug 26, 2011 05:28 AM|LINK
Is the the download window a popup. Is it specifically a modal popup...if it is it won't work on the android phone. You are going to need a redirect to a page with the link or you are going to have to use a java applet. Do you have an emulator? You could
mess around with it and use the emulator to see if it works. The other problem you are going to have is that it may work on certain phones and not others. That is why the emulator is useful. But using an applet will cure all your problems. That or there
might be a java package that has a class that fixes the problem. You may want to post in the android developer forums.
Aug 28, 2011 01:15 AM|LINK
If your Android Application is available in Android Market and you are using Android phone, then you can use the following URL format to link your application in the Android Market.
Check the below links,
Hope it helps u...
Sep 04, 2011 06:32 PM|LINK
Our application is on our server and I want to download and install it on the Android phone but when I When I tried to download, I get message 'unknown' while downloading, after that I received myApp.htm
www.myWebsite.net 3.26kb Download complete
When I Open it, it looked like the mobile site page and when I click again download, nothing happens.
When I clicked Version History or FAQ. I got error Web Page not Available.
content://com.android.htmlfileprovider/mnt/sdcard/download/Version.aspx?Phone=7 could not be loaded
I hope this helps.
Oct 09, 2011 01:39 PM|LINK
I'm also getting similar problems. I created an android application and posted the .apk onto my server. At first I got 404.3 errors which I handled by adding the mime into the web.config. My PC's download the file no problem but my android devices won't.
My galaxy tab (7 inch) starts to download but then gives me [(Untitled) download unsuccessful] error, and my galaxy tab 10.1 downloads the file but then does nothing. Everything worked fine prior to upgrading my IIS from 5.1 (XP) to 7.5 (Windows 7). Connecting
the device to my PC by USB works fine so I know there's no prob with the app itself. Any suggestions?
Oct 09, 2011 02:12 PM|LINK
Well, after some messing around, I was able to install my app.apk on the galaxy tab 10.1 by navigating to the file location and manually installing it. I'm not sure why the galaxy tab 7 inch won't download the file. At this point I'm still thinking it's
IIS 7.5 that's not allowing it but I have no proof, other than, everything worked fine when I was using IIS 5.1. I'm going to make another server on my XP machine to double check. Stay tuned. ok the problem's fixed...check out the NEXT post..