Blog

Issues upgrading a Cordova android project

I recently had to update a cordova project, that hadn’t been touched for a while. The iOS port updated fine, however I had a number of difficulties updating the android project.

This included a number of issues:

  • Unable to build project through bash
  • Unable to build project in Android Studio
  • Links, images to external sources no longer working
  • An image being chopped weirdly on older android devices

Upgrade Cordova

I had previously imported the project into Android Studio and had managed to build and export an APK file fine. This time however on returning, I was unable to do so. After reading about a new Cordova release that resolved the building process on android, I decided to just upgrade Cordova (5.0) and the project.

Building the project

I then selected ‘Import Project’ and selected the Cordova android folder. After it successfully imported, I tried to build the project, however received another error.

It was regarding an issue for languages. I added the following within “android {}” in “/platforms/android/build.gradle”.

lintOptions { abortOnError false
}

This seemed to resolve the build error and I could now build and run the app on an android device.

Whitelist Content

Unfortunately whilst the project did successfully build, data linked with external sources (images and data from the app’s API) were no longer being shown. This was due to a stricter security model and requires you to specifically whitelist content that is allowed.


I put this into the root config.xml file and performed the build again and content from the API started to appear (please put exact website locations where possible). To allow emails and phone numbers to work I needed to add the following to the config.xml file too.


This resolved the content loading issues I had.

Resolving chopped images

I use a carousel on a particular page and for some reason on older android devices only, only half the image was showing. It would briefly show the full image and then chop it in half.

I added the following to the image’s parent container (li) and the slider (ul) to be certain.

-webkit-backface-visibility: hidden;

This seemed to resolve the issue.

Finally

Everything seemed fine after this. It was annoying at the time, since what I assumed would take under an hour to do eventually took a lot longer. The following resources helped:

  • http://stackoverflow.com/questions/30345879/error-when-running-cordova-build-release-android
  • https://quickleft.com/blog/4-steps-to-minimizing-rendering-issues-in-cordova-applications/
  • https://cordova.apache.org/docs/en/4.0.0/guide_appdev_whitelist_index.md.html

Responsive Grid Generator: Gridpak and LESS

I’ve been using a variety of responsive grid frameworks to help me speed up front-end development; whilst these allowed me to develop easily for multiple devices, they did not offer extreme flexibility in column width, padding or gutter sizes. They usually just offered predetermined column percentage widths, generated by the framework’s default layout width. Enter Gridpak.

Continue Reading →

Wordpress Shortcode Handlers (YouTube Plugin)

Whilst there are many YouTube Wordpress plugins available, when I needed a YouTube plugin on another site I needed to add extra code surrounding the standard embedding iframe code, in order to have the YouTube video resize with the browser. I didn’t know how to do shortcodes at the time, so when I learnt how to use it, I thought this guide may be handy to a few people.

Continue Reading →

Googly Eyed Splitters

In the final months of my work placement at We Are Colin (last August), I began to work on Googly Eyed Splitters. Throughout the duration I was there I built a level editor and integrated Farseer Physics into the game and built a few levels. The new We Are Colin team continued to work on the game and the final outcome can be seen in the following video.

Try it out on the Xbox Live Indies Channel on Xbox 360. You can also try it out on your PC by downloading the trial here: http://www.wearecolin.co.uk/.

Snapshot

I developed Snapshot for a module at University but have done some more work on it. Heres a video showcasing Snapshot’s features:

Continue Reading →

Legend of Phoenix

University has officially nearly finished (minus an exam). For one of my modules in the last semester I used Gamebryo to create an adventure game (which imitates Legend of Zelda: Ocarina of Time).

In this project we had to collect various middleware and slam them into our game. The outcome of my game can be seen in the following video.

Continue Reading →

The City has Roads

The city has made some progression. I spent far too much time trying to create some building textures, but didn’t really create any decent textures so I have decided to leave the buildings how they are for now. The city now has a road and a gradient skybox. The floor texture is just generated using the 2D array that contains the world data.

I have read a lot on different implementations on city generation from using grid plans, l-systems to voronoi diagrams. The task at the moment is to try and improve the current version as much as possible and then document the effect those improvements have had in optimisation or realism.