Easy Movie Texture For Android Version: 2.18

Whoever uses the Easy Movie Texture For Android (Video Texture) version 2.18 and also uses split apks (obbs) in unity might run into problems with the streaming asset sub-folders. It’s a great plugin to handle rendered textures on mobile devices.

However the plugin fails to create sub-directories while copying videos out of the obbs into their respective sub-folders. Which can fixed by adding

in the MediaPlayerCtrl.CopyStreamingAssetVideoAndLoad.

So it looks like this:

Also in order to have a e.g. complete callback, simply add a

in the same class and call them at the respective m_CurrentState checks:

I’ve already e-mailed the fix to Lee JaeYun and it will be fixed in a later version presumably, until then use the fix and enjoy.

Sincere thoughts

It’s one of those yawning evenings, when the head starts to force its way back, questioning previous life decisions. Wondering about ‘what if’s. “I’ll be following you still, oh my dear head”, whispered the heart, “even though we both know certain events had other opportunities, too”.

Full of blind self-confidence the head keeps throwing well thought through words, sentences and phrases towards its fellow warm friend below. Trying to convince the heart that every decision made by the head, turned out as it should have been. With a mere look, full of genuine warmth and truth, the words turned into meaningless and empty letters so the head started to see what the heart seemed to be worried about.

With opened mind: ‘There must be another way!’ the head thought…

Android Re-Signing Apks

In case you want to re-sign your apk with a different keystore one day you might be delighted to hear that there is a convenient shell script for this already.

It basically removes the java manifest meta file, then runs zip align and the apk signing tool of the android sdk. It naturally requires the apk, the keystore with its alias and password.

Here is the script:

In order to run it, add execution permission in the terminal:

Then simply run the script by adding the parameters.

Have fun.

iOS vs Android in Numbers Q2 2014

I often get caught up in discussions about iOS and Android. And what platform one should target as a developer. So let’s compare some numbers, shall we?

Android owns 84.7% of the global smartphone market share where iOS is at 11.7% according to International Data Corporation.

This was also nicely put by the article Android iOS Development Monetization Marketing: “The facts are pretty staggering. While all of us iOS app marketers have our heads buried in the latest App Store algorithm changes and churn and burn models, the rest of the world was buying Android phones.”

Also according to netmarketshare.com stating in the article Android overtakes iOS in usage stats for the first time ever: “The latest data from Net Applications show that smartphones and tablets powered by Android were used more than iPhones, iPads, and iPod touches powered by iOS this July. While iOS usage dipped from 45.61% in June to 44.19%, Android’s increased from 43.75% to 44.62%.”

Therefore one might conclude that a global market share difference of 73% and more app usage will equal more money on Android. However it’s a bit more complicated than that as this article claims: “Real differentiators between iOS and Android are their users”.

Where iOS not only dominates in the US and Europe but

the user spending power is quite different as well. Interestingly Business Insider stated this on on multiple occasions here, here and here.

Also the fragmentation of android devices is just ridiculous and the iOS adoption rate is by far superior.

So what does it all mean?

At the end Google Play downloads exceeded iOS App Store downloads by around 60 percent this quarter, while the iOS App Store earned about 80 percent more revenue according to App Annie Intelligence estimates. More can be read here.

As always – it depends as stated in the article Android Monetization Myths: “Actually, numbers imply that Android apps can be just as profitable when monetization is done properly and with respect to specific rules that guide customers’ behaviour on the platform. For example, direct sales and in-app purchases are clearly Apple territory at this time, but Android offers much more in terms of potential for ad-driven revenue. […] Don’t get discouraged by the urban legends about Android monetization and get reliable data before you start planning how to make money on your app.”

It’s healthy to test for yourself here are some lessons from Chris Pruett’s GDC Talk 2013 (Robot Invader) – Fact and Fiction: Lessons from Wind-up Knight and Rise of the Blobs

What do you think? Please leave comments below.

Android How to programmatically close an app by pressing back button properly.

Everyone who uses apps knows that they are sometimes rather tough to exit. It’s not always because developers don’t care too much about it. Sometimes the api is tricky. If you want the user to exit your application by pressing the back button you need to override the onKeyDown method in your activity. The default implementation would be moveTaskToBack(true), which basically pauses your app and sends it to the background, right? Wrong! Because it only pauses the ui-thread.

Which means any other asynchronous task running keeps running. It wastes resources, leading to a worse user experience and and eventually to uninstalls. Why? Because it’s a unexpected behaviour. I mean don’t get me wrong, it’s perfectly fine if the app goes to the background because the user is getting interrupted by other apps. However if he wants to exit, he should have a possibility to do so. But what then?

Calling finish() often doesn’t do the trick. In that case you can use killProcess with the app process id.

Done. Just make sure that you have finished all your business before actually killing your app like saving preferences, etc. It will immediatelly close the app.

See also activitys-threads-memory-leaks

How To Get Android OpenGL 1.0 and 2.0 Information and Constrains – Revisited

Some time ago I’ve made a short post (here) about the basics of how to get opengl infos on an android device. For an app I’m currently working on it was required to get all interesting information once more in my android device information application. The basic idea is to add a respective opengl 1.1 or opengl 2.0 and possibly even opengl 3.0+ context to the active view, load all information in the onSurfaceCreate method of the renderer and remove the view afterwards again.

You’d use it appropriatelly like that in your activity:

Here is what I came up with:

Enjoy. (:

Soundlooper

Soooo Albért and Marco were visiting me the past week. They needed a couch to crash in Berlin to watch the football world championship. Congrats to Germany by the way for winning the champion ship! Anyways, Marco works as a DJ and he was playing around with his laptop to generate some random sounds. That got me inspired to create a little app over night. It basically loops through a matrix of matrices of tones and plays them that’s why the name Soundlooper. Pure creativity I know, right? xD


Continuous Integration with Maven and Travis for Android

In order to run your android unit tests automatically on external virtual server after each git commit you need a continuous integration system. There are a couple of good services e.g. jenkins and travis out there. But how do you use them? Here is one way for travis. You can start off by forking android-maven-example and adapt it to your own project. Maven’s package manager ability let’s you download and install all dependency packages. In example you also have several maven goals pre-defined. Most important ones are install – installing to a device or emulator, package – creating a jar of your libs and clean.

Now the automated tests are setup and you only need to make an account on https://travis-ci.org/ and turn on all the repositories which you want to let test.

The android maven example travis file is a bit outdated however. Android has been added as a first class citizen. So your travis.yml file could look like this:

To run the maven tests locally you can also create an emulator and run the maven goal. Note: On MAC you can also install travis-build to simply run everything by using travis run.

Create the emulator named test with e.g. API 10 and armeabi cpu.

Start the emulator. Note: No window required for first tests, if you want to tests the ui you might want to remove the -no-window parameter.

Run the test goal. Note: -e -X for showing errors and warnings in the console.

See also Travis CI for iOS.

Unity: Change Build Settings like splash screen, app icon programmatically / dynamically.

For a project at work I needed a way to swap the splash screen, app icon and package name in order to build 8 different themed apps. So here is a way to do it. This script creates a menu entry where you can simply select the specific build and change almost every build setting. Feel free to add any missing qualifier. (UnityEditor.PlayerSettings)

Unity: Start Coroutines on main thread or anything else for that matter

In case you do some asynchronious stuff like updating a game object after a network response in unity, you might come to a point where you want to do something you which can only be done within the unity main thread. So here is a little trick which let’s a certain method be called on the next opportunity of the game loop.

1) Create a gameobject in your scene and add a this script

2) Add your coroutine action into the queue whenever you want to call it like this:

Of course you can add any action to the main queue at any point and whereever you want. Enjoy (: