2014-04-24 4 views

답변

0

시간 작업의 거기에서 android.text.format.Time http://developer.android.com/reference/android/text/format/Time.html

이것은 공식 샘플 코드를 참조하십시오 : 이제

Time time = new Time(); 
time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am 
time.normalize(false);  // this sets isDst = 1 
time.monthDay += 1;  // changes the date to Nov 5, 2007, 12am 
millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm 
millis = time.toMillis(true); // millis is Nov 5, 2007, 12am 

을 더 준비 클래스가없는 그래프를 보여주는를 들어, 그래서 View 클래스의 Draw() 기능을 재정 의하여 스스로를 그릴 것, 또는 예를 들어,이 작업을 수행하는 라이브러리를 검색 : http://android-graphview.org/

0

AChartEngine을 사용하는 경우 새 값을 시리즈에 추가하고 mChartView.repaint()으로 전화하면 차트에 새 업데이트가 새로 고침됩니다. 에서 onCreate에서

0

(...) : 다음

GraphView graphView = new LineGraphView(this, "Amplitude"); 
graphView.setScrollable(true); 
graphView.setViewPort(0, 30); // the x range you want to show without scrolling 
GraphViewSeries graphSeries = new GraphViewSeries(new GraphViewDataInterface[0]); 
graphView.addSeries(graphSeries); 
setContentView(graphView); 
//or add your graphView to the Activity's view as appropriate 

, 당신은 새 값을 얻을로 :

graphSeries.appendData(new GraphView.GraphViewData(xValue, yValue), true, 300); 
//where 300 is the maximum number of values to keep 

새로운 값이 오른쪽에 올 것이다, 그리고 GraphView가 자동으로 스크롤됩니다 차트에 가장 최근 데이터를 표시합니다.

관련 문제