MonoTouch core graphics ... vs Android canvas - android

I am trying create a "real-time" plot using MonoTouch graphics i.e. the app calls a web service to get data and then plots it on a chart based on time and y-values. I can get the frame and axes of the chart working but I can't figure out how to update the chart with new data points - without redrawing the entire chart from scratch. The data simply needs to be drawn on top of the underlying chart frame - like drawing on a 'canvas'.
I have created this type of chart on Android using the canvas and it's quite simple to do. But there does not appear to be anything like a canvas on iOS.
Any suggestions about the approach I should use with MonoTouch to create this type of chart?
Thanks
Mike

use core graphics with monotouch.
http://developer.apple.com/library/ios/#DOCUMENTATION/CoreGraphics/Reference/CoreGraphics_Framework/_index.html

Related

does libGDX box2dDebugRenderer renders ray?

I am using libGDX for hobby Game Development,I am using two stages one is for graphics and one is for box2d world with debugDraw, every box2d fixtures debugDraw well with their graphics but I cant debugDraw a raycast!, how can I easily achieve that?
THANK YOU.
DebugDraw does not render RayCasts as they are not an object in the box2d world. It is more like a query and does not persist.
But you could use your starting vector and the the point of the RayCastCallback that is going stop the raycast to draw a line via DebugRenderer.line(a, b). Of course, if you want this line to show up more than one frame you have to store your vectors somewhere.

How to create area graph in android

Hi i wanted to create area graph chart and pie chart in android without using any 3rd party library, from the scratch, can you please give me some reference how to draw it from the scratch?
see method descriptions in this class for drawing and filling primitives (rectabgles, polylines, arcs, etc) https://developer.android.com/reference/android/graphics/Canvas.html

Drawing a graph on android

I want to draw a graph on my android app. I did some reading and found out that using a canvas I can draw anything I want on the android app.
I am looking for a canvas which runs with a predefined time (say 10 seconds) as X-axis and draw the waveform which defines the Y-axis. I would want to get values out the graph drawn too.
Any library that I can employ? Is using a canvas the only option or do I have other options?
I don't think you need a library for this. Your requirement seems simple and could be accomplished by writing a custom view. You can utilize the onDraw(canvas) to draw the graph. You can use a Handler to post the x/y coordinate (run it every 10 seconds), or by any other means. A custom view is an excellent option to keep things modularized and you could get the graph at any time via getDrawingCache().

Android 2D game engine with canvas capability

Im looking for Android 2D framework which allows me to create canvas layer on which I can draw simple shapes like rect, oval atc (raster graphics). The canvas have to PERSIST everything I draw on it.
I found many engines (libgdx, andengine ...) but if they have capability to draw shapes, its only for one screen update. Reason becouse I dont store drawn shapes to some kind of List is becouse in app, the drawing occurs every screen update so I just want to modify canvas and dont remember anything.
Thanks for every answer.
As far as I know, android doesn't support something like that. Android uses double-buffering which means 2 alternatives "screens" that alternate each other so if you draw on one the next would be on random state.
There are tricks you can use to achieve what you want like draw both screens and then stop drawing, but android doesn't support such behavior because when you get hold of a canvas it's not certain that it returned exactly as what you did last frame, it doesn't specify what could cause an error, but if you ask me it could be anything that pops up on screen.
You don't really need an engine to do that, you can use a SurfaceView and draw on it (it supports shapes like the ones you want)

Android View options - draw to a canvas directly or use views

I'm converting a project that I wrote in AIR a long time ago to native Android. In AIR, positioning views was fairly easy in x,y coordinate systems. With native Android though, I am trying to approach this in a correct way, but I'm unsure how to approach.
My view will consist of two circles in the background, with small objects within those circles that can roll around. There will be another view drawn on top of the circles to make it seem like there is glass over the circle, entrapping the small objects. The small objects are bound to the background circles.
I guess what I'm really asking is canvas drawing the best approach here, or is a view-based layout workable as well?
It sounds like your best option would be to use a SurfaceView. This is basically a hardware accelerated canvas. On of the benefits is that you can overlay standard widgets over top of it if you need to so you can mix and match custom and standard components. Here is a link to a website that walks you through getting a SurfaceView up and running

Categories

Resources