- Home /
Android Downloading Packages Online
Hey Unitarians!
In my Android game, I want to add music, but I realize that music takes a lot of mb, and android users like APKs with the least size possible. So, I wanted to add a feature where my users can download music files online if they wish.
How would I do this? I want it so that when my users click the button, the app permanently downloads the music files (where should I store them? Dropbox?) and then puts the music files in a folder. Then I want my system to play whatever files are in that folder. How would I do this?
Answer by kacyesp · Sep 02, 2014 at 02:27 PM
This link seems to have some pretty good answers: http://stackoverflow.com/questions/7357270/save-audio-and-video-file-in-sql-server-database
Good question by the way. I didn't think music files would be a big deal in terms of space.
They are :). $$anonymous$$ost of the music files I choose are 2-4 mb, and that adds directly to the apk file size. Thanks for the link!
Ok I read it (I'm a pretty fast reader lol). So I can store audio files in there, but how would I use Unity to download those files? I don't know how to connect Unity to a SQL Server, and if it's even possible.
It's totally possible! Just google around and you'll find answers. If you're coding in Javascript, here's a little tutorial to get you started: http://forum.unity3d.com/threads/starting-my-mmo-with-sql-server-in-javascript.77447/ Even if you're not coding in javascript, I would still take a look to get a basic idea.
That looks awesome! I'm assu$$anonymous$$g I can use this in the free version? Because I can't use AssetBundles because it's pro, so this seems like the workaround. I'll get cracking!
lol of course it's free. By the way, if you got the answer you were looking for, you can accept the answer :)
Answer by Gizmoi · Sep 02, 2014 at 02:30 PM
Depending on how much music you are thinking of, I'd recommend packing them into the game.
Alternatively you can download music at run-time using Asset Bundles. But this is a Pro Only feature.
You could create these at build-time and upload them to your web server. Then at run-time download or load from cache with WWW.LoadFromCacheOrDownload
Your answer
Follow this Question
Related Questions
How To Call Health Script From Another Script ? 1 Answer
Multiple Cars not working 1 Answer
Downloading file in android background 0 Answers
screenshot 0 Answers
How to know which code depends on System.dll in mono C#? 1 Answer