0

I'd like to make an action (increment a counter) when a player touch the ad of the adwhirl banner. I've seen that the AdWhirl class have a method that is called every touch:

//We intercept clicks to provide raw metrics
    public boolean onInterceptTouchEvent(MotionEvent event) {  
            switch(event.getAction()) {
            //Sending on an ACTION_DOWN isn't 100% correct... user could have touched down and dragged out. Unlikely though.
            case MotionEvent.ACTION_DOWN:
                    Log.d(AdWhirlUtil.ADWHIRL, "Intercepted ACTION_DOWN event");
                    countClickThreaded();

                    if(activeRation.type == 9) {
                            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(custom.link));
                            this.context.startActivity(intent);
                    }
                    break;
            }

            // Return false so subViews can process event normally.
            return false;
    }

Well, how can I use it? Should I implement a listener? Or maybe a class that implements the AdWhirlInterface like this one? Handle AdWhirl onFailure

I really don't know how to move :(

Community
  • 1
  • 1
Zappescu
  • 1,429
  • 2
  • 12
  • 25
  • can't you use this method? Add your code to the method they are already using? – lostInTransit May 05 '11 at 18:49
  • I don't want to change the AdWhirl method in his class because when it'll be an update of the AdWhirl jar, I should remember to make the change again. Well, it seems not really "clean" to me. – Zappescu May 05 '11 at 19:28

1 Answers1

-1

Check out the adWhirlClickMetric method of the library and see when it is called. It is called whenever a user touches an ad banner (in the iOS version of the SDK at least) and would be perfect for what you want to do.

Stunner
  • 12,025
  • 12
  • 86
  • 145