tanya gmap

by er1ck » Wed, 21 Apr 2010 00:16:16 GMT


Sponsored Links
 mau tnya supaya gmap bisa view north up gmana ya? spy bs mirip spt ipun 3GS
gitu, secara spica kan ada compasnya, thx

-- 
"



tanya gmap

by Adityo Firmansyah » Wed, 21 Apr 2010 10:38:42 GMT


 bukannya maps ver. 4 sudah ada directionnya ya?
mapsnya pak erick sudah ver. 4 kan?

-adit-




-- 
"


Sponsored Links


Other Threads

1. OutofMemory exception when dealing with large Bitmaps

I wrote a sample application which rotates and scales a bitmap on
clicking a key. When the bitmap is large (1280x1024) I quickly run
into an OutOfMemory exception at CreateBitmap and I need to Force
Close the application. No issues with smaller bitmaps.

I have already tried using bitmap.recycle and setting the bitmap to
null, but the memory does not get freed up. I have seen multiple posts
with similar issues, but could not find one that solves my issue. Do I
need to force the GC at some point? Here is the code I am using:

public class TransformAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout linLayout = new LinearLayout(this);

        mBitmapOrg = BitmapFactory.decodeResource(getResources(),
               R.drawable.sample);

        mScaleWidth = 0.1f;
        mScaleHeight = 0.1f;
        mRotateAngle = 0;

        mImageView = new ImageView(this);

        TransformThePicture();

        // center the Image
        mImageView.setScaleType(ScaleType.CENTER);

        // add ImageView to the Layout
        linLayout.addView(mImageView,
          new LinearLayout.LayoutParams(
                      LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT
                )
        );

        // set LinearLayout as ContentView
        setContentView(linLayout);

    }

    private void TransformThePicture()
    {
        Matrix matrix = new Matrix();
        matrix.postScale(mScaleWidth, mScaleHeight);
        matrix.postRotate(mRotateAngle);

        int width = mBitmapOrg.getWidth();
        int height = mBitmapOrg.getHeight();

        mResizedBitmap = Bitmap.createBitmap(mBitmapOrg, 0, 0,
                width, height, matrix, true);

        mImageView.setImageBitmap(mResizedBitmap);
        mImageView.invalidate();

    }

    public boolean onKeyDown(int keyCode, KeyEvent event) {
           if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {

                  mScaleWidth += 0.08;
                  mScaleHeight += 0.05;
                  mRotateAngle += 5;

                  if (mScaleWidth >= 1.0f) mScaleWidth = 0.1f;
                  if (mScaleHeight >= 1.0f) mScaleHeight = 0.1f;
                  if (mRotateAngle >= 90) mRotateAngle = 0;

              mResizedBitmap.recycle();
              TransformThePicture();

              return (true);
              }

           return super.onKeyDown(keyCode, event);
        }

    private Bitmap mBitmapOrg;
    private float mScaleWidth;
    private float mScaleHeight;
    private int mRotateAngle;
    private ImageView mImageView;
    private Bitmap mResizedBitmap;
}

--~--~---------~--~----~------------~-------~--~----~

2. Buffering Background Image - Graphics Advice Sought

I am unsure of the jargon so please bear with me, I am seeking advice
on the best way to go about drawing the graphics for an app I am
developing.

Imagine you are creating a game of checkers, where you can drag/drop
one piece at a time to a blank space on the board.   When the piece is
being moved, it seems to me that you should not need to redraw all of
the pieces that are not being moved.

Using the LunarLander example, is there a way to store the background
image and only draw the piece being moved over it?  I have been trying
to figure out a way to capture the canvas as an bitmap that is
occasionally refreshed.  Is there a way to do this?


--~--~---------~--~----~------------~-------~--~----~

3. Question about one application requiring another application or service

4. rating bar padding problem

5. How to update Android Dev 1

6. R not re-generating in Eclipse after rename of the package

7. help with contacts