Posts

Apache Cordova (PhoneGap) + processing.js

The problem I wanted to be able to create cross-platform mobile applications whilst not having to do it in Javascript.  I've never liked Javascript, I'm not really sure why, maybe I don't fully understand it. The solution I had a brainwave that I could create a functional Java application using Processing (that I have used a lot and, hopefully, will be contributing author to a book on the subject if it ever gets published), port it to processing.js and deploy that as an Apache Cordova ( PhoneGap ) based mobile application.  As a short explanation, Apache Cordova is a cross-platform framework for writing and deploying HTML5 apps to most mobile platforms.  Processing is a graphical Java-based library of which processing.js is the Javascript equivalent.  Using both processing.js and Cordova, I should be able to deploy a java-based application into a cross-platform framework and run it as javascript The code This is the easiest way to do it (there are othe...

PhoneGap + processing.js = big problems

This is less a 'code solution' than it is a code issue, in that I don't know how to fix it and abandoned the solution.  I will likely go back and attempt to resolve at some point, but for now I just want to tell you about what I'd wanted to create, what the issues were and how it caused my PhoneGap app to be labelled as "sucks!!!!" As I previously blogged this solution, I figured I should also share these issues The problem I wanted to be able to create cross-platform mobile applications whilst not having to do it in Javascript.  I've never liked Javascript, I'm not really sure why, maybe I don't fully understand it. The solution I had a brainwave that I could create a functional Java application using   Processing  (that I have used a lot and, hopefully, will be contributing author to a book on the subject if it ever gets published), port it to   processing.js   and deploy that as an Apache Cordova ( PhoneGap ) based mobile ...

The PhoneGap Viewport size is too small on Android?

Image
I spent quite some time today trying to figure out why, when I load an external HTML file into my PhoneGap (Apache Cordova) app, the viewport only filled part of the screen Notice the big space at the bottom and the side border. I couldn't figure it out, so I started searching on Google: Googled solution 1 - Set the viewport meta tag Lots of the solutions I found involved setting the meta tag for the viewport, eg <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0/> However, this seemed to have absolutely no effect whatsoever.  I tried many variations of this Googled solution 2 - Set the page to use all the space Other solutions involved setting CSS so that the page filled the screen, eg html, body {   width: 100%;   height: 100%;   padding: 0;   margin: 0; } This also had absolutely no effect.  I was getting confused by now Googled solution 3 - Set Android propert...

How I brute-forced my own keystore password

How I brute-forced my own keystore password If, like me, you've been in the unfortunate siutation where you have forgotten your own keystore (or certificate key) password then help may be at hand. After some fruitless searching I decide to write my own piece of software to brute force my keystore certificate.  As I am/have been a Java programmer I decided to write it in the language I knew best, and this is how I did it. I have made the  source code  available for anyone who wants it Loading the keystore The Java API already has code for loading a keystore, java.security.KeyStore.  The keystore needs to be placed on the classpath (I just stuck it in the root on my Eclipse project) // Load the keystore in the user's home directory File file = new File(keystoreName); is = new FileInputStream(file); KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType()); keystore.load(is, keystorePassword.toCharArray()); return keystore; The above code sim...

Installing and using mobilize.js to transform a desktop site to a mobile site

Image
Installing and using mobilize.js to transform a desktop site to a mobile site mobilize.js offers a neat and simple method of creating a mobile optimised website with very little change to the main desktop site. With a few lines of javascript and some css you can create a mobile optimised site without having to maintain 2 different sets of content. However the instructions on the official site aren't the best. So with some digging I managed to transform - From this (Firefox on my laptop): To this (Android browser on my Samsung Galaxy Nexus): with no html changes other than adding some <script> tags to the <head> element.  Plus automatic browser detection to display either site depending on the browser used - mobile, or desktop Here are some step-by-step instructions on getting it working. Why would you want to? So going back to the beginning, these were my requirements:  I wanted to create a mobile optimised site but, as I already ...

How to add AdWhirl to an Android app (part 2)

After my earlier post, I found another way of doing this which relies on setting the ad placement in a layout.  This also is pretty easy As I was getting poor results from AdMob I decided to add AddWhirl to my android app so I could use multiple ad providers.  Little did I know that the documentation for AdWhirl was going to be so bad!  A google search didn't help much, just lots of other people wanting to do the same and getting stuck or confused.  The official instructions didn't help much (https://www.adwhirl.com/doc/android/AdWhirlAndroidSDKSetup.html) - as soon as I had started I got a compile error because of something ommitted from the instructions. So I set out to solve the problem on my own. 1. Set your app up on your chosen Ad provider website (or multiple, but for this explanation I'll go with Admob).  You'll need the ID 2. Set your app up on the AdWhirl website.  Add the ad provider (in this case AdMob) and enter the ID.  Switch it ...

How to add AdWhirl to an Android app (with decent instructions!)

As I was getting poor results from AdMob I decided to add AddWhirl to my android app so I could use multiple ad providers.  Little did I know that the documentation for AdWhirl was going to be so bad! A google search didn't help much, just lots of other people wanting to do the same and getting stuck or confused.  The official instructions didn't help much ( https://www.adwhirl.com/doc/android/AdWhirlAndroidSDKSetup.html ) - as soon as I had started I got a compile error because of something ommitted from the instructions. So I set out to solve the problem on my own.  In the end the solution was pretty easy: 1. Set your app up on your chosen Ad provider website (or multiple, but for this explanation I'll go with Admob).  You'll need the ID 2. Set your app up on the AdWhirl website.  Add the ad provider (in this case AdMob) and enter the ID.  Switch it on!  You'll need the AdWhirl ID later, but not the AdMob one as AdWhirl handles that for you ...