Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6900395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:32:27+00:00 2026-05-27T07:32:27+00:00

I am a newbie for android development and I came from WP7 world, so

  • 0

I am a newbie for android development and I came from WP7 world, so I found many familiar tools missing. One of my favorite is http://www.jeff.wilcox.name/2011/10/metrogridhelper/ which is really helpful for me to find out what’s wrong with UI layout or alignment during debugging. So I am wondering if there is an alternative in android world or can anyone please give me some hints on how to implement similar things in android.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:32:28+00:00Added an answer on May 27, 2026 at 7:32 am

    Ok, so we figured it out.
    USAGE:

    if(Debug.isDebuggerConnected())
            grid = new Grid(this);
    

    The source code is as follows

    import android.content.Context;
    import android.graphics.Canvas;
    import android.graphics.Color;
    import android.graphics.Paint;
    import android.graphics.PixelFormat;
    import android.graphics.Rect;
    import android.util.AttributeSet;
    import android.view.Display;
    import android.view.View;
    import android.view.WindowManager;
    import android.view.WindowManager.LayoutParams;
    
    public class Grid {
        private WindowManager mWindowManager;
        private GeoView geoView = null;
    
        AttributeSet attr = null;
    
        public Grid(Context context) {
            geoView = new GeoView(context, attr);
            // context.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            // WindowManager.LayoutParams.FLAG_FULLSCREEN);
            mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
            WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT,
                    WindowManager.LayoutParams.TYPE_APPLICATION,
                    WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                            | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                    PixelFormat.TRANSLUCENT);
            // | WindowManager.LayoutParams.FLAG_FULLSCREEN
    
            mWindowManager.addView(geoView, lp);
    
        }
    
        protected void finalize() {
            mWindowManager.removeView(geoView);
        }
    
        public class GeoView extends View implements Runnable {
            private Paint mPaint = null;
            private int rectWidth = 25;
            private int rectHeight = 25;
            private int rectSpace = 12;
            private int space = 12;
            private WindowManager mWindowManager;
            private int screenWidth = 0;
            private int screenHeight = 0;
            private int columnLoopCount = 0;
            private int rowLoopCount = 0;
    
            public GeoView(Context context, AttributeSet attr) {
                super(context, attr);
                mWindowManager = (WindowManager) context.getSystemService("window");
                Display disp = mWindowManager.getDefaultDisplay();
                screenWidth = disp.getWidth();
                screenHeight = disp.getHeight();
                // Log.d(TAG, "screen width="+disp.getWidth());
                // Log.d(TAG, "screen height="+disp.getHeight());
                columnLoopCount = (screenWidth - space) / (rectWidth + rectSpace);
                rowLoopCount = (screenHeight - space) / (rectHeight + rectSpace);
                columnLoopCount++;
                rowLoopCount++;
    
                mPaint = new Paint();
    
                new Thread(this).start();
            }
    
            @Override
            protected void onDraw(Canvas canvas) {
                super.onDraw(canvas);
    
                mPaint.setAntiAlias(true);
    
    
                // mPaint.setStyle(Paint.Style.FILL);
                mPaint.setStyle(Paint.Style.STROKE);
    
                for (int i = 0; i < rowLoopCount; i++) {
                    for (int j = 0; j < columnLoopCount; j++) {
                        int newX = j * (rectWidth + rectSpace);
                        int newY = i * (rectWidth + rectSpace);
    
    
                        Rect rect1 = new Rect();
    
                        rect1.left = space + newX;
                        rect1.top = space + newY;
                        rect1.right = space + rectWidth + newX;
                        rect1.bottom = space + rectHeight + newY;
                        // Log.d(TAG,
                        // "i="+i+",j="+j+",lfet="+rect1.left+" top="+rect1.top+" bottom"+rect1.bottom+" right="+rect1.right);
                        mPaint.setColor(Color.DKGRAY);
    
                        canvas.drawRect(rect1, mPaint);
    
                    }
                }
            }
    
            @Override
            public void run() {
                while (!Thread.currentThread().isInterrupted()) {
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException e) {
                        Thread.currentThread().interrupt();
                    }
    
                    postInvalidate();
                }
            }
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi am newbie to android development. I had created one application where i need
I'm a newbie to the Android development world but have some experience with embedded
Extreme Android developer newbie here...well, new to Android development, not development in general. I
Everyone, I am a newbie to android development. Now I have a question that
I am a newbie to android app development. I want to customize my android
I am a newbie to Android and the Eclipse development environment and would like
As a newbie to Android development, I'm trying to do the basics and build
I am a newbie to android development, and would like to know if it
I am newbie to android game development. I've been trying an example of game
I am a newbie in Android app development, I tried to create a nested

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.