getGL in LatinKeyboardView returns null

by rajath » Thu, 08 Apr 2010 06:25:54 GMT


Sponsored Links
 Hi all,
I'm a beginner in android programming. In the SoftKeyboard example, I
over-rode the LatinKeyboardView::onDraw() function, and tried to get
the GL object from canvas. But it returns null. Does someone know why
this is so?

My intention is to draw on the keyboard using opengl calls.

Thanks,
Rajath

--



Other Threads

1. How to implement a JUnit to test StatusBar and notification?

Hi, everyone,
I want to implement a test case that I can drop down status bar and
check which notifications it shows.
Can I do this by JUnit? Because StatusBarService is not a activity,
I don't know how can I focus statusbar and how can I get what
notifications there are?
I checked default android source codes, it has statusbar test in the
framework but it doesn't use JUnit to test.
Is this because JUnit can't test service?

Please help me. Thanks for your help.

Allen

-- 

2. Problem with OnClick Interfering with OnTouch

ok so i have an app where the list i have is actually just a
relativelayout instead of a listview so i can do more cool effects
with it using touch events, so i have the layout move based on the
ontouch method and the children have onclicklisteners, well now
whenever i press down on a child and start to drag (in an effort to
move the view) it wont and i assume because the onclick captures all
movement from when the finger first hits the child whereas if i press
off a child (like bare layout) and drag the view moves, so is there a
way to avoid having the onclicklistener steal the ontouch event but
still function? the only way i can think is to manually write my own
code to detect what would be considered a press in the ontouch method
but i feel like that will be too strenuous
heres my ontouch method

  @Override
    public boolean onTouchEvent(MotionEvent ev) {
        final int action = ev.getAction();
        switch (action) {
        case MotionEvent.ACTION_DOWN: {
            final float x = ev.getX();
            final float y = ev.getY();

            // Remember where we started
            mLastTouchX = x;
            mLastTouchY = y;
            break;
        }

        case MotionEvent.ACTION_MOVE: {
            final float x = ev.getX();
            final float y = ev.getY();

            // Calculate the distance moved
            final float dx = x - mLastTouchX;
            final float dy = y - mLastTouchY;

            // Move the object
            mPosX += dx;
            mPosY += dy;

            //move layout
            layoutparams = new LayoutParams(Fill, Wrap);
            layoutparams.setMargins(Scale(70), Scale((int) mPosY), 0,
0);
            CurrentLayout.setLayoutParams(layoutparams);
 
CurrentSubLayout.setLayoutParams(layoutparams);

            // Remember this touch position for the next move event
            mLastTouchX = x;
            mLastTouchY = y;

            break;
        }

        case MotionEvent.ACTION_UP: {

                 final float x = ev.getX();
             final float y = ev.getY();

             // Calculate the distance moved
             final float dx = x - mLastTouchX;
             final float dy = y - mLastTouchY;

             // Move the object
             mPosX += dx;
             mPosY += dy;

             //move layout
             layoutparams = new LayoutParams(Fill, Wrap);
             layoutparams.setMargins(Scale(70), Scale((int) mPosY), 0,
0);
             CurrentLayout.setLayoutParams(layoutparams);
 
CurrentSubLayout.setLayoutParams(layoutparams);

                if (CurrentLayout.getTop() + CurrentLayout.getHeight() <
HomeLayout.getHeight() - Scale(100))
                {
                        if ((HomeLayout.getHeight() - Scale(100)) -
CurrentLayout.getHeight() <= 0)
                        {
                        Animation snap = new TranslateAnimation(0,0, (int) 
(mPosY -
((HomeLayout.getHeight() - Scale(100)) - CurrentLayout.getHeight())),
0);
                        snap.setDuration(300);
                        CurrentLayout.startAnimation(snap);
                        CurrentSubLayout.startAnimation(snap);
                layoutparams = new LayoutParams(Fill, Wrap);
                layoutparams.setMargins(Scale(70),
(HomeLayout.getHeight() - Scale(100)) - CurrentLayout.getHeight(),
0,0);
                CurrentLayout.setLayoutParams(layoutparams);
                CurrentSubLayout.setLayoutParams(layoutparams);
                mPosX = 0;
                mPosY = (HomeLayout.getHeight() - Scale(100)) -
CurrentLayout.getHeight();
                        }
                        else if ((HomeLayout.getHeight() - Scale(100)) -
CurrentLayout.getHeight() > 0)
                        {
                                Animation snap = new
TranslateAnimation(0,0,CurrentLayout.getTop(),0);
                        snap.setDuration(300);
                        CurrentLayout.startAnimation(snap);
                        CurrentSubLayout.startAnimation(snap);
                    layoutparams = new LayoutParams(Fill, Wrap);
                    layoutparams.setMargins(Scale(70), 0, 0, 0);
                    CurrentLayout.setLayoutParams(layoutparams);
                    CurrentSubLayout.setLayoutParams(layoutparams);
                    mPosX = 0;
                    mPosY = 0;
                        }
               // Toast.makeText(this, "boom",
Toast.LENGTH_SHORT).show();
                }
                else if (CurrentLayout.getTop()  > 0)
                {
                        Animation snap = new
TranslateAnimation(0,0,CurrentLayout.getTop(),0);
                        snap.setDuration(300);
                        CurrentLayout.startAnimation(snap);
                        CurrentSubLayout.startAnimation(snap);
                layoutparams = new LayoutParams(Fill, Wrap);
                layoutparams.setMargins(Scale(70), 0, 0, 0);
                CurrentLayout.setLayoutParams(layoutparams);
                CurrentSubLayout.setLayoutParams(layoutparams);
                mPosX = 0;
                mPosY = 0;
               // Toast.makeText(this, "boom",
Toast.LENGTH_SHORT).show();
                }


            break;
        }

        }

        return true;
    }

-- 

3. Neither Map Activity noe Google Maps showing the maps

4. Publishing app . what should be done

5. Signed app.how to get LVL in source

6. reduce system image size

7. New Android Market client - which phones?