Plotting on android. New app, ShowPlot Get achartengine –

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 6 Overview Programming Tutorial 3: Sending/Receiving SMS Messages.
Advertisements

Android Application Development Tutorial. Topics Lecture 4 Overview Overview of Sensors Programming Tutorial 1: Tracking location with GPS and Google.
Graphing With Excel.
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Android basics. About Android Linux based operating system Open source Designed for handheld devices Developed by Android Inc. Google (2005) Open Handset.
WiFi in Android.
Cosc 5/4730 Android: “Dynamic” data.. Saving Dynamic data. While there are a lot of ways to save data – Via the filesystem, database, etc. You can also.
Graphics with Canvas, SurfaceView, and multitouch processing (panning and multitouch zoom) GraphicsWithCanvas_2012.pptx.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Video upload and streaming
How To Make Graphs in Microsoft Excel Outline Making Bar Graphs Making Scatter Plots – 1 series Making Scatter Plots – Multiple Series.
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Android development the first app. Andoid vs iOS which is better? Short answer: neither Proponents on both sides For an iOS side, see this article on.
Graphing in Excel Dr. Denise Harlem January 29, 2015.
Dojox charting Karthick S. Dojo Charting Presenting statistical data in a readable, eye-catching manner is important, but it can also be difficult. The.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Concurrency in Android with.
Android Tutorial Team 3 Jerry Yu Mayank Mandava Mu Du Will Wangles.
Chapter 3 Vector Class. Agenda Design and Implementation of Vector class – add, get, set remove, copy, equals, ensureCapacity Hangman using Vector class.
1 Mobile Computing Monetizing An App Copyright 2014 by Janson Industries.
Blio App Tutorial for Android. eBooks Axis 360/Blio.
Android Programming-Activity Lecture 4. Activity Inside java folder Public class MainActivity extends ActionBarActivity(Ctrl + Click will give you the.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Introduction to Processing CS 4390/5390 Fall 2014 Shirley Moore, Instructor September 3,
Tracking Tasks and Processes. GET_TASK Make a new app, WatchProcesses – Add permission GET_TASK This permission allows the app to collect lots of information.
Tutorial 1 Running JADE Under Eclipse Dr. Fuhua Lin School of Computing and Information Systems Athabasca University, Alberta, Canada Oct. 27, 2009.
Android Hello World 1. Click on Start and type eclipse into the textbox 2.
Cosc 4730 Android Fragments. Fragments You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own.
Installing Repast in the Eclipse IDE Charlie Gieseler 6/28/04.
Announcements Homework #2 will be posted after class due Thursday Feb 7, 1:30pm you may work with one other person No office hours tonight (sorry!) I will.
Android Boot Camp Demo Application – Part 1. Development Environment Set Up Download and install Java Development Kit (JDK) Download and unzip Android.
Android Using Menus Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
New Activity On Button Click via Intent. App->res->Layout->Blank Activity A new xml file is created and a new class is added to java folder. In manifest.xml.
Copyright 2007, Information Builders. Slide 1 Flex your Dashboard Muscle with WebFOCUS Flex Enable John Gogoly Senior Systems Engineer June, 2008.
EXCEL GRAPHING *Basic Graphing Steps* by A.B. -NNHS.
Aquarium Lab Series Developed by Alyce BradyAlyce Brady of Kalamazoo CollegeKalamazoo College.
1 Java and AWT CPS 470 Spring 1998 Laura Campbell.
Basic 2D Graphics in Android. Android Graphics Programming There are many ways to do graphics programming in Android – 2D vs. 3D – static vs. dynamic.
Get Microsoft Mouse Mischief
Get Microsoft Mouse Mischief
Graphing With Excel.
CLOUD
Introduction to android
Contacts: Intro to game programming in Java (with almost-drawingpanel)
Graphing.
GUI Programming Fundamentals
Chemistry Monday, 9/21.
Android Studio, Android System Basics and Git
2D Graphics: Part 2.
Simulation plugins: EPP
Eclipse Navigation & Usage.
Supplemental slides for CSE 327 Prof. Jeff Heflin
Using Excel to Graph Data
Chapter 15: In App Advertising
CIS 470 Mobile App Development
Setting up Eclipse Locally
null, true, and false are also reserved.
Graphics with Canvas.
Fractions 1/2 1/8 1/3 6/8 3/4.

Java External Libraries & Case Study
Here are four triangles. What do all of these triangles have in common
Shapes.
Recap Week 2 and 3.
Using Excel to Graph Data
numbers letters colors shapes animals 1pt 1 pt 1 pt 1pt 1 pt 2 pt 2 pt
HIMS 650 Homework set 5 Putting it all together
Working with Libraries
Shapes.
Activities, Fragments, and Intents
Presentation transcript:

Plotting on android

New app, ShowPlot Get achartengine – – Get jar Add aChartEngine.jar – Right-click on src, – select build path, – select “configure build path” – In libraries tab, select add external jar, browse for jar that you downloaded – In order and export tab, select jar Layout – add linear layout – In xml, make added linear layout to be –

A plot has two parts – Data – Renderer – We make functions to define each part Data – public XYMultipleSeriesDataset getMyData() { – XYMultipleSeriesDataset myData = new XYMultipleSeriesDataset(); – XYSeries dataSeries = new XYSeries("data"); – dataSeries.add(0,2); – dataSeries.add(1,1); – dataSeries.add(2,4); – dataSeries.add(3,3); – dataSeries.add(4,2); – dataSeries.add(5,6); – myData.addSeries(dataSeries); – return myData; – }

renderer public XYMultipleSeriesRenderer getMyRenderer() { XYSeriesRenderer r = new XYSeriesRenderer(); r.setColor(Color.BLUE); r.setLineWidth(10); r.setPointStyle(PointStyle.SQUARE); // CIRCLE, DIAMOND, POINT, TRIANGLE, X r.setFillPoints(true); // not for point or x // don't know how to set point size or point color r.setFillBelowLine(true); r.setFillBelowLineColor(Color.WHITE); XYMultipleSeriesRenderer myRenderer = new XYMultipleSeriesRenderer(); myRenderer.addSeriesRenderer(r); return myRenderer; }

Make plot Add member variable – private GraphicalView mChartView; In onCreate, add – if (mChartView == null) { LinearLayout layout = (LinearLayout) findViewById(R.id.chart); mChartView = ChartFactory.getLineChartView(this, getMyData(),getMyRenderer()); layout.addView(mChartView); – } else { – mChartView.repaint(); // use this whenever data has changed and you want to redraw } Make onResume – protected void onResume() { super.onResume(); if (mChartView != null) { – mChartView.repaint(); } – } run

Make another set of data Add to getMyData, just before return – XYSeries dataSeries2 = new XYSeries("data"); – dataSeries2.add(0,1); – dataSeries2.add(1,1); – dataSeries2.add(2,2); – dataSeries2.add(3,1); – dataSeries2.add(4,2); – dataSeries2.add(5,4); – myData.addSeries(dataSeries2);

More renderer Must have same number of renderer entries as data sets In getMyRenderer, just before return, add – XYSeriesRenderer r2 = new XYSeriesRenderer(); – r2.setColor(Color.RED); – r2.setLineWidth(10); – r2.setPointStyle(PointStyle.DIAMOND); – r2.setFillPoints(true); – r2.setFillBelowLine(false); – myRenderer.addSeriesRenderer(r2); run

Other plot types Replace – mChartView = ChartFactory.getLineChartView(this, getMyData(),getMyRenderer()); With – mChartView = ChartFactory.getBarChartView(this, getMyData(),getMyRenderer(), BarChart.Type.DEFAULT); Or with, – mChartView = ChartFactory.getBarChartView(this, getMyData(),getMyRenderer(), BarChart.Type.STACKED); Or with – mChartView = ChartFactory.getScatterChartView(this, getMyData(),getMyRenderer());

Time series The x-axis should be time public XYMultipleSeriesDataset getMyTimeSeriesData() { – XYMultipleSeriesDataset myData = new XYMultipleSeriesDataset(); – TimeSeries dataSeries = new TimeSeries("data"); – dataSeries.add(new GregorianCalendar(2011, 5, 9, 18, 15, 1).getTimeInMillis(),0); – dataSeries.add(new GregorianCalendar(2011, 5, 9, 18, 15, 5).getTimeInMillis(),2); – dataSeries.add(new GregorianCalendar(2011, 5, 9, 18, 15, 15).getTimeInMillis(),1); – dataSeries.add(new GregorianCalendar(2011, 5, 9, 18, 15, 25).getTimeInMillis(),3); – dataSeries.add(new GregorianCalendar(2011, 5, 9, 18, 15, 35).getTimeInMillis(),1); – dataSeries.add(new GregorianCalendar(2011, 5, 9, 18, 15, 55).getTimeInMillis(),2); – myData.addSeries(dataSeries); – return myData; } !Change getMyRenderer to only make a single renderer entry! In onCreate, put – mChartView = ChartFactory.getTimeChartView(this, getMyTimeSeriesData(),getMyRenderer(), null); Run, note x-axis is in time

bubble public XYMultipleSeriesDataset getMyData3() { – XYMultipleSeriesDataset myData = new XYMultipleSeriesDataset(); – XYValueSeries dataSeries = new XYValueSeries("data"); – dataSeries.add(0,0,1); – dataSeries.add(1,2,2); – dataSeries.add(2,1,3); – dataSeries.add(3,3,2); – dataSeries.add(4,1,1); – dataSeries.add(5,2,0); – myData.addSeries(dataSeries); – return myData; } In onCreate, – mChartView = ChartFactory.getBubbleChartView(this, getMyData3(),getMyRenderer());