Android Question I just finished a simple app and need to publish it

Stephen A Wolfe

Member
Licensed User
I found everything I need to publish my app to Google Play, but am also interested in publishing this to my asp website. Will this work under the Windows web platform? I uploaded the .apk to my site then tried navigating to it using my Android, but it keeps telling me the file isn't found even though it's there. Is it only possible to install apps through the B4A app and through Google Play?

Thanks.
 

josejad

Expert
Licensed User
Longtime User
Upvote 0

Stephen A Wolfe

Member
Licensed User
You should be able to download to your phone and install it (you have to allow install third party apps)
https://www.google.es/search?source=hp&ei=_JiVW5rwMsTlkwWm4pSYAw&ins=false&q=android+install+third+party+apps&oq=android+install+third+party+apps

Can you download it accessing to your website thought a pc web browser?

I tried using a hyperlink that links to the file and both my PC and phone browser says the document could not be found. I'm known for overlooking simple things, so I'll keep trying to get it working. I am going to publish through Google Play though. I guess I can just direct my website visitors there instead.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
If I recall it correctly, you should configure IIS (or whathever is your webserver) to serve apk files.
Have a look at posts like this for further infos.
 
Upvote 0

Stephen A Wolfe

Member
Licensed User
If I recall it correctly, you should configure IIS (or whathever is your webserver) to serve apk files.
Have a look at posts like this for further infos.
Thanks for the replies (everyone).

I was just on the phone with Godaddy tech support for over an hour and we discovered a weird anomaly. I linked a text file and a .apk file on my site page. Everything was done correctly. The text file opened without any issue, but it would give a very generic not found error for the .apk file. It was noted in their system so other techs can look into this. I have a theory that the higher ups have an agreement with Google Play to disallow .apk files from being accessed, essentially forcing users to direct customers to the Google Play app, which makes sense if they are generating ad revenue.

So that's what I'm going to do. I'll just direct those interested in the Android app version of my winforms apps that I created to my Google Play app. Maybe this will be useful for those who have had issues making a direct download of an app on their site.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
As you wrote, it seems a GD issue.
I subscribed for a very cheap (1€/month) VPS and I can upload/download whatever I like from it. Not to mention running b4J server apps..

udg
 
Upvote 0

Stephen A Wolfe

Member
Licensed User
Add this to webconfig:
B4X:
<system.webServer>
   <staticContent>
     <mimeMap fileExtension="apk" mimeType="application/vnd.android.package-archive" />
   </staticContent>
<system.webServer>
I really had high hopes that would solve the issue, but I still get a "not found" error.

Not Found
The requested document was not found on this server.


Web Server at MySite.org

It isn't all that important to me to do this, but if someone does find a solution, I'll be happy to use it as long as it isn't a lot of effort.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
I've used the above web config change several times without a problem. You know, you _could_ just provide a link to the Google Play download page for your app ;)

Also, be sure that you have placed the APK file that will be downloaded in a publicly-accessible area of your website if you're linking to it directly.
 
Upvote 0

Stephen A Wolfe

Member
Licensed User
I've used the above web config change several times without a problem. You know, you _could_ just provide a link to the Google Play download page for your app ;)

Also, be sure that you have placed the APK file that will be downloaded in a publicly-accessible area of your website if you're linking to it directly.
It is in a publicly accessible folder. I went in and set the file permission to full control - no change. Here's what I've done: I put the .apk file in the same folder as a test text file. I linked to each file in exactly the same way on the page. The text file works as expected on both the PC and my phone. The .apk file gives a 404 for both the PC and phone. I do plan to just link to Google Play for my app because this has wasted too much of my time and seems clear to me GD has some sort of agreement with GP to force developers to only host apps in GP, and they get the ad revenue in return. Those of you who seem to be able to get this working, congrats, but I seriously tried so many things that I give up.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
The websites I use are hosted by GoDaddy, I don't recall having to do any special configuration on the IIS console to make this work. The link is generic:
B4X:
//*
    <asp:HyperLink ID="lnkApp" runat="server" NavigateUrl="~/MyAndroidAppName.apk">Download App</asp:HyperLink>
//*
you might try calling the file something simple as "1.apk" just to make sure the spelling is ok, as a 404 error is 99% of the time what you're addressing is not where you think it is.

I've had issue with IIS and GoDaddy not seeing eye-to-eye on the file list as well, you might try using the "delete all files before publishing" option if possible, if not use a FTP browser to verify the file is _actually_ in the website folder in the wild.
 
Last edited:
Upvote 0

wstein25

Member
Licensed User
Compressing the file ...might ... help. The extension would then be .zip. I recall having zip files available for download on my web site. It's easy to try.
 
Upvote 0

GeoffT660

Active Member
Licensed User
Longtime User
upload_2018-9-16_8-50-6.png
Have you set up your MIME settings in IIS to download this type of file
upload_2018-9-16_8-50-6.png
 
Upvote 0

tekh2999

Member
Licensed User
Longtime User
I've had this problem before. What you can try and although this may not be your problem but it seems the url address your link is pointing to may be incorrect. This will happen on some servers where you may have an https and not a regular http. If you see an htaccess file in your folder on the server it's more and likely your url is being rerouted, and you don't have authorization to change it. So here's what you can try to test it if the url is indeed what it says. Your gonna have to make yourself an app with a webview and editTextbox, put the textbox above the webview to you can see the text, have the webview load the link to your app. put this code I listed
B4X:
 EditText1.Text = WebView1.Url

Once the webpage loads you can check to make sure the address is what is says it is. If it's different then there's your problem. You'll need to put the address that appears in the textbox as the link to your app.
 
Upvote 0

Stephen A Wolfe

Member
Licensed User
I've had this problem before. What you can try and although this may not be your problem but it seems the url address your link is pointing to may be incorrect. This will happen on some servers where you may have an https and not a regular http. If you see an htaccess file in your folder on the server it's more and likely your url is being rerouted, and you don't have authorization to change it. So here's what you can try to test it if the url is indeed what it says. Your gonna have to make yourself an app with a webview and editTextbox, put the textbox above the webview to you can see the text, have the webview load the link to your app. put this code I listed
B4X:
 EditText1.Text = WebView1.Url

Once the webpage loads you can check to make sure the address is what is says it is. If it's different then there's your problem. You'll need to put the address that appears in the textbox as the link to your app.
That definitely isn't the issue, but thanks. I can see the URL in my web browser.
 
Upvote 0

tekh2999

Member
Licensed User
Longtime User
this will not work on a regular browser like chrome, IE, firefox. Only in the B4x webview will you be able to do this. any other browser is just gonna show the same link.
 
Upvote 0
Top