Jump to content

From 0$ to 100$/day from games documented journey update - setting things up.


scheffgames
 Share

Recommended Posts

Full Article

excerpt

"

I was right to be afraid of porting my html5 games to android. It’s a bloody nightmare folks. I may exaggerate a bit – maybe just a bad dream.

I don’t know about you but I’m a lazy developer. Meaning I just want things to work how out of the box with minimal overhead. I also suffer from the impostor syndrome – specially when it comes to web development, adding plugins to existing packages and configuring stuff. Mainly it scares me because I have 2 options when I encounter something new:

1)Follow tutorials and use Google

2)Spend large amounts of time to learn all the ins and outs of a certain technology. 

Since I may not like learning that tech in depth or simply I don’t have the time I usually go with no. 1 – Google it. It helps if that tech it’s well documented and it works decently.

Alright, let’s start sharing some tech stuff.

So what do I do if I want to port my html5 game to Android? A quick google shows me some options: IntelXdk, Cocoon.js, Cordova, PhoneGap, Ejecta, Crosswalk, etc.

IntelXDK sounds good – so I install it. The interface it’s pretty straight forward but you don’t have an option of simply choosing your project file and have it converted to an APK. Nope. You first have to create a project (blank html5 or cordova) – intel will create a directory structure with some files and folder and most importantly a www folder. Then you open that www folder in explorer, delete existing files and paste your html5 files (index.html + assets) – at least that’s my dumb way of doing it, maybe there are smarter workflows. Like I said, lazy. Next I go to Simulate tab – click play – sure enough my app it’s emulated and it’s displayed correctly. Now I go to the Build tab, select android as my only build option and click on Build Package. After a while I’m prompted to save a .zip file somewhere on my folder. I dully comply. I eagerly open the .zip file hoping for my juicy apk but instead all I have it’s some files and folders. WTF? Thankfully there’s lots of helpful aiding links in IntelXDK – so I follow them and I find out that I have to either use Cordova CLI or PhoneGap to make an APK. CLI sounds awfully complicated so I go to the PhoneGap website, make an account, upload my .zip file, download an .APK (finally) and install it. It works – somewhat. It’s all out of alignment and there’s a status bar sticking out and it’s in the wrong orientation. Damn. More work. Sigh! Now I’m starting to get a feeling it’s going to take a while.

"

Full Article

 

 

Link to comment
Share on other sites

  • 3 weeks later...

Holy sheet. It was like my experience... I was creating a game and decided to stop, just to see if it's so easy to push it into real working .apk thing and play it on mobile like real application! Yay!

A while of reading through the internet - Cocoon is giving performance, great thing "canvas+" and it's great and it's easy!!!11

Who doesn't like performance and "easy". Looking at the docs... there is almost nothing there? What the ****, do you just need to upload your files and press one button? That's all? Not possible. I've tried doing it with their Cocoon Developer App for Android, the package was 200mb large, but let's give it a try.

The app gave me uncompressing error - I've created a topic on their forums https://forums.cocoon.io/t/cocoon-developer-app-uncompressing-error/5765 but no one answered. Not great start.

Oh maybe this app is broken, let's compile it in normal way. But it seems I was trying to install .apk without -debug affix and my phone said "Installation not done"... Yesterday I've downloaded Unity one more time, I said yeah let's **** it it will be easier on Unity. However as a front-end developer I am really in love with JS and after spending a couple of hours with Unity I've felt JavaScript is calling me, and Unity is boring. So I said - hey, I am not giving up! Will try with Cordova itself.

Couple of hours, installing requirements finally my first test app. Let's run that awesome "cordova build android" - DONE. But what now? I cannot see .apk. Looking at /platform/android and wondering where the heck is my .apk or if it's even there. Instead of searching the directory I've asked google first for some reason. And there it was - /platform/android/build/apk - Sent it to my mobile phone, installed. And that little moment - it works. Feels great.

Now reading this I've used -debug.apk from Cocoon (normal compilation) and guess what - Cocoon logo shows and then the black screen.

Will probably give Cocoon another try because it seems great, however not sure why it's not working. For now I'll go with Cordova and see how it goes.

EDIT: You probably need to use PHASER.CANVAS not AUTO or WEBGL with Cocoon's Canvas+ (obviously). At least that was the issue in my case, yey!

Yeah I know no one cares, but this article was so true that I had to share with you, good to know you're not alone with those kind of problems. I guess sometimes it also lies on the documentation side, while it's not good enough or clear enough.

Best regards.

Link to comment
Share on other sites

  • 4 weeks later...

I will soon finish my app and try to build an apk. Wish me luck. JSGods help me.

I also looked into Progressive Web Apps. Users can just install your webpage on the phone. But you need to set up some things, service workers, manifest and some stuff.

Link to comment
Share on other sites

I've just released my Phaser game on Android last week. I used Cordova and Crosswalk. I initially added Crosswalk then removed it because it didn't seem to make any difference and added considerably to the file size, but after I used Rich's multi-texture guide the performance was much better. The biggest problem is how long it takes audio files to decode, I've had to solve this by design - using intro animations as delays and not launching until essential audio is ready.

Creating the apk itself wasn't too difficult after everything was set up, what took most of the time was trying to integrate IAP and Admob plugins. I spent weeks struggling with the IAP in particular before just switching to a different plugin with better documentation (I'm using this one but I've only had test purchases so far).

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...