One more thing…

No, not the New New New ipad or something like this, but just another app on Android’s Play Store. It is called “Minimal Bowling Score” and I wrote it to keep some stats for a new hobby. And although it has only a few features ( a lot more will come, I guess) I decided to release it early. So if you like to have a closer look and maybe be take an inspiring part in the future developmentĀ  : Here it is …

And I wonder…

Hi everybody, and great thanks to everybody leaving comments and ratings on my apps on Google Play. Every opinion is appreciated, may it be positive or negative. Nevertheless, some comments make me wonder – just like today: Someone rated Tempolimit Speed HUD with three stars. And be assured – even if I love receiving five-star ratings, three is just ok. But I would like to know: If you judge the app to be somewhat mediocre, why is your only comment added to the rating the one word ” Good.” ?

Android Basics: Using TouchDelegates

Roman Nurik came up mentioning TouchDelegates in this post on Google Plus. Since he left open how TouchDelegates are used in detail and someone asked me – here is a very simple example. It should be rather self-explaining, if not, feel free to ask… If you like you can download the complete Eclipse project here

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package net.thomasmanthey.touchdelegateexample;

import android.app.Activity;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.TouchDelegate;
import android.view.View;
import android.widget.Toast;

/**
 * This class demonstrates how to use a TouchDelegate to
 * expand the touchable ClickArea of a View within its parent View.
 * The example is quite simple, a Button sits centered in a Fullscreen Linear Layout
 * and gets some extra space to receive TouchEvents
 *
 * All code is licensed under Creative Commons License CC BY 3.0.
 *
 * @author Thomas Manthey
 *
 */

public class TouchDelegateExampleActivity extends Activity {
   
    //The View that delegates its touch events to the delegate
    View parent;
   
    //The Delegate that responds to touch events
    View delegateButton;
   
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        //Get references to the View in the layout
        parent = (View) findViewById(R.id.parent);
        delegateButton = (View) findViewById(R.id.cmdClickMe);
       
         //The TouchDelegate has to be set after everything has been calculated and drawn
        parent.post(getTouchDelegateAction(parent, delegateButton, 50,50,50,50));
    }
   
    /**
     * Adds a touchable padding around a View by constructing a TouchDelegate
     * and adding it to parent View.
     * @param parent The "outer" parent View
     * @param delegate The delegate that handles the TouchEvents
     * @param topPadding Additional touch area in pixels above View
     * @param bootomPadding Additional touch area in pixels below View
     * @param topPadding Additional touch area in pixels left to View
     * @param topPadding Additional touch area in pixels right to View
     * @return A runnable that you can post as action to a Views event queue
     */

    private static Runnable getTouchDelegateAction(final View parent, final View delegate, final int topPadding, final int bottomPadding, final int leftPadding, final int rightPadding) {
        return new Runnable() {
            @Override
            public void run() {
               
                //Construct a new Rectangle and let the Delegate set its values
                Rect touchRect = new Rect();
                delegate.getHitRect(touchRect);
               
                //Modify the dimensions of the Rectangle
                //Padding values below zero are replaced by zeros
                touchRect.top-=Math.max(0, topPadding);
                touchRect.bottom+=Math.max(0, bottomPadding);
                touchRect.left-=Math.max(0, leftPadding);
                touchRect.right+=Math.max(0, rightPadding);
               
                //Now we are going to construct the TouchDelegate
                TouchDelegate touchDelegate = new TouchDelegate(touchRect, delegate);
               
                //And set it on the parent
                parent.setTouchDelegate(touchDelegate);
               
            }
        };
    }
   
    /**
     * Just to show that we hit the target.
     * @param target
     */

    public void cmdClickMe_OnClick(View target) {
        Toast.makeText(this, "You clicked me. Go and save the cheerleader or do something more sensible.",Toast.LENGTH_SHORT).show();
    }
}

Work in progress…

Today I started working on Tempolimit GPS Speed HUD version 6. This will be a complete rewrite which will lead to a software being able to run in the background, to include information from external speed databases and a lot more. Stay tuned – and if you would like to be a beta tester, just comment on this post and I will get back to you…

Read it loud! Premium Version 1.1 available

I just released Version 1.1 of Read it loud! Premium, my SMS reading app available on Android Market. You can now use profile managers like Llama and others that are able to communicate with other apps via Android intent system to activate and deactivate it automatically.

How to? Just configure your profile manager to send the intent

de.exesmobile.messagereaderpremium.ACTIVATE

to activate it. Or send

de.exesmobile.messagereaderpremium.DEACTIVATE

to – well I think you can guess ;-)

Thanks to Joe Kurut who sent me an email with the idea for that feature!

Finally…

Well – how big the part that software development plays in my live may be, there is something more. No, not my wife (whose part is actually a tiny fraction bigger) – I am talking about music. I play the base guitar in a band called “Sky Pilot” and we have now released our first EP called “Live from Livingroom”. It is available on iTunes, so if you like, take a listen

Tempolimit 5.9 available

A few minutes ago I released Tempolimit Speed HUD Version 5.9. New features are long requested optimizations for the apps HUD mode like a full screen view of the driven speed (YES, without the speed sign and the title bar) and a high contrast mode.

Wonder if we will hit 50.000 downloads solely on Android Market by the end of the year (right now it is roughly 39.000 and counting). If you already use the app, just update, if you don’t and want to give it a try:

https://market.android.com/details?id=net.thomasmanthey.speedwarner

Let me know what features you would like for future releases…