Loading problem on Android
Elliot

I have encountered this problem that is driving me crazy.

 
My game works fine on PC, and used to work on my Android 4.0 phone too. This was the other day. Today, when I try to open it on my phone, it simply won't load. Blank screen, no error message (no error message that I can see, anyway).
 
The funny thing is, it works in Chrome for Android, and Firefox for Android, it's just the default browser that is doing this.
 
I know it's a bit of a vague description, but do you have any ideas why this might be happening? Out of memory perhaps? I think compared to the other day (when it was working) I must be using a bit more memory, as I've added more content.
All 13 Comments
Gio

9 times out of 10, this is a problem with loading audio files.

 
If one of the things you've added recently is audio, then it's likely that the loading isn't working. Sadly, the state of html5 audio is terrible at the moment (not just in WADE, it's a general problem with html5). Lots of problems on many devices.
 
However, as described in one of the tutorials on our site, there are workarounds. For exampe, "preload" your audio files rather than "loading" them, then use wade.playAudioIfAvailable(). So browsers that have trouble loading audio (such as the stock Android browser on 4.0), won't get stuck there waiting for your audio files to load (which will never happen).

This sucks, I know. However, one of the main things we'll do for 0.9, is a completely rewritten audio system. While this can't fix all the problems of html5 audio, it will certainly help on the browsers that support the webAudio API, making problems like this one go away (hopefully).
Elliot

Brilliant! I did what you said and it's working now! Except that there is no audio in the default Android browser, but audio is still working in the other browsers.

 
Thanks :D
deptraidatai

Hi Gio,

I got an error when try to build to Android, it just said that error without any comment to guide me how to fix the error, please help me :(

Thank you

Gio

Hi

I think it was a memory problem with our build server (the size of your app was pushing it just above the limit). I have just restarted the server, after realising that it had been running for over a year since the last reboot! 

This has freed up some memory - would you like to try again?

 

deptraidatai

Thank you for your response, but the error still happens.

Gio

I had a closer look, and cannot find anything wrong in the logs for the building process. It must be something to do with the metadata, could you please let me know the "Package Name" that you are using when building your game for Android?

 

deptraidatai

Hi Gio, the newest package i just tried is "com.clockworkchilli.Finding-Dory-Spot-6-Differences2" please help me to check it. Thanks so much

Gio

Hi

I think that you are not allowed to use dashes in your Android Package name.

Also, while it would not generate an error, I would avoid com.clockworkchilli and use your own website address, or company name, or developer name. So try something like:

com.deptraidatai.dory

and it should work.

I think that in the next version of WADE we should add some code that validates the package name client-side when you start an Android build.

deptraidatai

Thank you so much Gio, it worked.

deptraidatai

Hi Gio, I have another question that how can I get keystore for the game?

deptraidatai

and could you please help me on how to add google adsense code into games made by Wade?

foxcode

Okay, possibly long post.

Regarding adsense, I'm fairly sure google does not allow you to use it for ads on apps or html5 games.

"The use of AdSense for mobile in a mobile application is a violation of AdSense policies" source - https://support.google.com/adsense/answer/68724?hl=en-GB

I think they have another ad service called admob which you might want to check out. I've also heard people say good things about https://www.leadbolt.com/. I've not used either personally but would be interested to know how you get on.

 

Generating a key store took me a while to figure out. You might be able to download the android development studio and sign it with that, however I had great difficulty trying to import a wade app into it. It may be more mature now but I have an alternate solution.

After lots of searching I came across the app zipsigner https://play.google.com/store/apps/details?id=kellinwood.zipsigner2&hl=en_GB

I don't recall the exact process but it was along the lines of

  • Copy your unsigned apk generated by wade on to your device that has zipsigner installed
  • In zipsigner, find the keys menu and create a new key, do not forget any of the information you enter here
  • Select your key from the list of signing options, and set your source as the android apk, then run the app

 

I myself am still looking for a better solution to this but so far have not found one. Let us know how it goes

deptraidatai

Thank you foxcode so much about the great guide above, I'll try it and let you know the result soon.

Post a reply
Add Attachment
Submit Reply
Login to Reply