Newbie Question

edited June 2014 in General Discussion
Good morning,

I'm a little new here and building my first app. So far, I've replaced my dashboard with the "custom page" activity, and from here, if I understand correctly, I'd like to use custom JavaScript to handle background music playing. (i.e. when the app loads, I want music to begin playing automatically)

I have the necessary JavaScript written, but I'd like to know how I upload an audio resource into the app, and once uploaded, what the relative path to the resource is. I believe I can upload the resource under an audio player activity, but my intention is to not use any "extra" apps. Therefore, I'd like to upload the audio resource independent of any activity.

Is this possible? Is there a way to upload a resource to be referenced via JavaScript / HTML? If not, is there a way to automatically play background music when an app loads? I believe I could also reference the audio resource on an external site via JavaScript, but I'd prefer to bundle the resource with the app.

Any help is absolutely welcomed! Also, I'm extremely excited to start this project; even if I fail horribly, I expect this will be enjoyable. :-)



  • Hmm, a little bit of helpfile searching and it looks like the HTML Archive Activity might be what I'm looking for.

    Hey! The help pages are fantastic. Never mind this. For anyone who stumbled across this and is wondering how to do this...

    You can turn your Dashboard off (your Dashboard is your initial landing page when a device opens your app) and use your lowest ranking activity as your new landing page. You can create an "HTML Archive Activity" as the lowest ranked, and upload a zipped file containing an appropriate directory structure and source code (html, resources, and javascript) with the initial page named "index.html".

    And voila. You have (in essence) a custom scripted local webpage which can access any and all resources you upload with it.

    ... Now I've yet to test this, but this is what I assume from the given documents. :-)
  • As a quick side note, after trying dozens of "fixes", I'm still not able to get audio to play in the background (either by user interaction or automatically) when using the HTML Archive Activity. I haven't given up yet but it's a tad discouraging.
  • So the best I've found and where I'm leaving this (yes, I'm talking to myself), is hosting the mp4 (coverted from mp3) on a web-host and using a video element to reference it. None of the autoplay features I can find will work so it does require interaction from the user (and as far as I can tell, also requires that the controls are visible).

    If anyone figures anything more out beyond this, definitely let me know! :-)
  • Audio doesn't play thru webview on android. I heard things will get fixed once chrome is fully implemented. Yeah I wish I had audio to make my games more fun.
  • Thanks for the response pixelpower. I wanted to say I really appreciated all of the posts and work you've done on the forum. I have a pretty solid technology background but had never approached apps before. After working through a few tutorials online (via Eclipse and the ADT bundle), I decided to try something a little less indepth. After I stumbled onto Andromo, I was hesitant to jump right in but a lot of the forum posts, and even your "It's literally just this easy" posts really helped give me some confidence.

    Keep it up! And thank you.
  • Glad I could help I look forward to seeing what you make. If you want to host your app online so that its does have sound , this is the best free host

    Play the game ( it doesnt have sound) and sign up. Now upload your game with sound and play it on your android and boom!! Sound!! But your app will require an internet connection to play.
Sign In or Register to comment.