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

  • SEARCH
  • Home
  • 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 8067023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:09:45+00:00 2026-06-05T12:09:45+00:00

I am new to android and I need to know how to make a

  • 0

I am new to android and I need to know how to make a graph or chart (eg. line chart) move i.e, from right to left.

Basically I am going to draw the graph in accordance with the RAM Memory Usage of the phone. I need to draw a graph similarly present in Task Manager of Windows.

Please help on this.

  • 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-06-05T12:09:46+00:00Added an answer on June 5, 2026 at 12:09 pm

    It’s My Sample Code.

    I did not test yet.

    But I think This code works fine.

    public class DrawGraph extends Activity{
        /**
         * Variable Array for GraphView
         * verlabel : Background Height Values
         * horlabel : Background Width Values
         * values : Max Values of Foreground Active Graph
         */
        private float[] values = new float[60];
        private String[] verlabels = new String[] { "600","500","400","300","200","100","80","60","40","20","0", };
        private String[] horlabels = new String[] { "0","10", "20", "30", "40", "50", "60"};
        private GraphView graphView;
        private LinearLayout graph;
        private boolean runnable = false;
    
        @Override
        public void onCreate(Bundle savedInstanceState){
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            graph = (LinearLayout)findViewById(R.id.graph);
            graphView = new GraphView(DrawGraph.this, values, "TEST GRAPH", horlabels, verlabels, GraphView.LINE);
            graph.addView(graphView);
            runnable = true;
            startDraw.start();
        }
    
        @Override
        public void onDestroy(){
            super.onDestroy();
            runnable = false;
        }
    
        public void setGraph(int data){
            for(int i=0; i<values.length-1; i++){
                values[i] = values[i+1];
            }
    
            values[values.length-1] = (float)data;
            graph.removeView(graphView);
            graph.addView(graphView);
        }        
    
        public Handler handler = new Handler(){
            @Override
            public void handleMessage(android.os.Message msg){
                switch(msg.what){
    
                case 0x01:
                   int testValue = (int)(Math.random() * 600)+1;
                   setGraph(testValue);
                   break;
                }
            }
        }
    
        public Thread startDraw = new Thread(){
            @Override
            public void run(){
                while(runnable){
                    handler.sendEmptyMessage(0x01);
                    try{
                        Thread.sleep(1000);
                    } catch (Exception e){
                         e.printstacktrace();
                    }
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to android and I'm need a little help understanding how to move
So I want to make a new music player for Android, it's going to
I am new to Android i need to implement buttons having the size of
Hello i am new in android and i really need help with something. I
My android app project need to add a new function of saving the click
I am new android app developer i want make app for tablets and phone
I start developing a new Android application from scratch these days. The company I
Possible Duplicate: Android - get path of resource I need to know the string
I know that android will pick the resources from the corresponding folders in the
I'm new to android programming (writing my first app now) and I need some

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.