2016-08-01 3 views
1

저는 Android (넥서스 시뮬레이터)가있는 IOIO 보드를 사용하고 있으며 기본 ioio 연결을 사용하고 있습니다. 2 개의 아날로그 핀을 샘플링 할 수 있습니다.안드로이드, 그래프를 추가하려고합니다.

다음 단계는 결과를 그래프로 표시하는 것입니다. 는 종속에서 activity_main에서

LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[] { 
    new DataPoint(0,3), new DataPoint(1,3), new DataPoint(2,6) 
}); 

내가 (주석) 한에서 onCreate 나는 MainActivity에서

compile 'com.jjoe64:graphview:4.1.0' 

있어 루퍼에서

graph1 = (GraphView) findViewById(R.id.graph1); 

나는 (또한 주석)했다. xml 내가 가진 (주석 처리 된)

<com.jjoe64.graphview.GraphView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/graph1" 
    android:layout_below="@+id/output1" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true"/> --> 
내가 그것을 실행하면

나는 메시지 하드웨어 가속을 사용할 수 있어야 얻을 수 있지만, 나는 모든 것이 기본적으로 주석 처리되어 있기 때문에, 프로그램이 여전히 기본 모드에서 실행

<application 
android:allowBackup="true" 
android:icon="@mipmap/ic_launcher" 
android:label="@string/app_name" 
android:supportsRtl="true" 
android:hardwareAccelerated="true" 
android:theme="@style/AppTheme"> 

main.AndroidManifest.xml

에 있습니다. activity_main.xml에서 주석을 제거하면 프로그램이 충돌합니다. 하드웨어 가속이 실제로 켜져 있지 않거나 그 밖의 무엇이 잘못되었을 수 있기 때문에 그럴 지 모르겠습니다. 모든 의견을 크게 기뻐할 것입니다.

답변

0

힌트를 듣지 못했지만 이미 컴파일 된 그래프 뷰 응용 프로그램을 사용해 보았습니다. 마침내 나는 일하는 것을 가지고있었습니다.

나는 그것이 아마도 의존성에 뭔가있을 수 있다고 추측했다. 내 프로그램이 '4.1.0 : graphview com.jjoe64'종속성은

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile files('libs/GraphView-4.0.1.jar') 
// compile 'com.jjoe64:graphview:4.1.0' 
} 

내가 컴파일을 추가합니다. 라인의 주석 처리를 제거하고 바로 위의 라인을 주석 처리함으로써 동일한 하드웨어 가속으로 실패한 프로그램이 사용되어야합니다.

위와 같이 주석을 다시 변경하고 Clean을 수행하고 다시 시도했는지 확인하십시오. 나는 다시 온라인에 있었다. 이것이 왜 이렇게 달라져야 할 지 모르겠다. 그러나 잠시 동안 나는 내 프로젝트를 계속하는 법을 알고있다.

관련 문제