[Android General] KloNom:
Don't forget to take part in our UMi X1 Pro Giveaway! It is opened untill the 15. January 2015. Go here:

http://klonom.com/umi-x1-pro-giveaway/

Still searching for a small gift for your app or technology excited crush/boyfriend/girlfriend or similiar? Then this might be an idea for you: The personal Love Calculator!

The idea for a “personalized Love Calculator” I got from one of these TV commercials for expensive Love Calculator apps. Why not to make an own Love Calc, which basically works exactly as useless as a “normal” Love Calculator :D , but with the small but important “fix” that it returns 100% when two special names are entered. That would be a nice gift idea for your significant other for christmas ;) .

Who directly wants to jump to the files, just scroll to the end of this post. There is a ZIP file containing a ready-to-compile B4A project, made for a 720×1280 resolution.

Since I am not a Java coder, I was not in the mood to set up the SDK, IDE, paths and so on for a one time programming in Java. So I searched for a alternative for creating Android apps with as less setting up work as possible. I found B4A: Basic for Android. This is a development environment in which you can develop native Android apps in a Basic-like language. It also has a graphical GUI editor. One big advantage is is that no setting up of paths etc. is needed, since B4A offers the oppertunity of “Remote Compilation”, where the program is uploaded to a server where it is compiled. So you just need to install the 30 days trial version and you’re good to create an app (the Java JDK only needs to be installed). The only downside of this program is, that for a few seconds after opening the app, a message box is shown that the app was created with the trial version.

So here now a short guide, how to make your own, personalized Love Calculator:

Installation of the software:

1) Download and install the JDK (here)

2) Download and install the Basic 4 Android Trial (here).

3) Get the B4A Bridge App from the Play Store (here). This app is needed to test the compiled APK later.

When the softwares are installed, you can directly begin with the app itself ;).

Adjusting the app:

When you start the IDE from B4A the first time, you land in screen like this:

Via Source->Open Source you can load the project from the Love Calculator (at the end of this post). Then the source code should be loaded.

Now you can insert the “special” names ;) : Just replace the value of the variable name1 and name2. If for example the names Dog and Cat should produce a 100% result, the following lines have to be changed like the following:

‘HIER DIE NAMEN ERSETZEN!!!
name1=”Cat”
name2=”Dog”

Te first line is simply a comment and means “Change the names here!”. This is the only part in the whole code which need to be changed. In the actual program it does not matter, which name is on which position or if written with capitals or not.

I adjusted the GUI to a display resolution of 720×1280. If you need an other resolution, you have to to this in the “Designer”.

Via “New Variant” you can create a new resolution. In the “Abstract Designer” you can scale and adjust the position of the UI elements. I won’t go here too much into details, if you have any questions, just write ;) .

Save the project and choose “Release” from the dropdown list right beside the blue arrow. Then start the B4A Bridge App on your mobile. Click on “Start Bluetooth”. Then go to Tools – B4A Bridge – Connect (Bluetooth) in the IDE. First click Find devices and then your phone. Then you should be connected with your phone. Now you just need to hit the blue arrow and you’re done! The app should be installed several seconds later.

The compiled .apk should be placed in the project folder under /Objects . Surely this App won’t win an innovation or design award, but thanks to the little “Fix”, which gives a specific name combination always 100%, it is a nice little gimmick, especially for christmas time ;) .

The ZIP-file of the project you can find on this site.