0

I'm having problems getting started with Androidplot. I'm basically new to both Java and Android app development, so bear with me if this is a dumb question.

At this point, I'm just trying to have a plot shown on the layout, but when I add an Androidplot element, my app crashes.

This is my xml for the particular layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".PlotActivity" >

<com.androidplot.xy.XYPlot
android:id="@+id/XYPlot"
    android:layout_width="100px"
    android:layout_height="100px"
    androidPlot.title="Data"
    androidPlot.domainLabel="Domain"
    androidPlot.rangeLabel="Range"
/>
</LinearLayout>

If I take out the androidplot element, the app switches to this layout successfully, but when I add the element, it crashes. The associated activity only switches the layout to this one and contains nothing else.

public class PlotActivity extends Activity {
protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.plot_layout);
}

Any ideas of what the problem might be?

Thanks in advance!

Andrew Seaman
  • 290
  • 3
  • 8
  • Look at the log for the crash report. Learn how to read a stack trace... If you need help with this you need to post the log report. – Ifor Apr 05 '14 at 16:05

1 Answers1

0

As the previous commenter mentioned, the crash report is key to figuring out these kinds of issues. If you can provide a stack trace of the crash then I can give you a more specific solution.

In the mean time, you can check to make sure that you've added the correct jar to the /libs dir of your project (the core library one). Depending on your IDE, you may also need to add the jar to your classpath.

Nick
  • 8,181
  • 4
  • 38
  • 63