动态图形渲染,Android的 [英] Dynamic graph rendering in Android

查看:164
本文介绍了动态图形渲染,Android的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要借助Android中的曲线图不断地从服务器获取数据。根据一个数据项的图形需要显示各种颜色。该图应该保持从右向左移动像心电图曲线图。它像连续移动图形。

I need to draw a graph in Android which continuously gets data from the server. Based on one data item the graph needs to be displayed in various colors. The graph should keep moving from right to left like a ECG graph. Its something like continuous moving graph.

我能否达到这个采用Android 2D图形库?我需要使用补间动画?我必须用内插器也?

Will I be able to achieve this using Android 2D graphics library? Do I need to use tween animation? Do I have to use interpolators also?

推荐答案

这听起来像一个两部分的问题。

This sounds like a two part problem.

第1部分是搞清楚如何从服务器获取原始数据。不知道什么样的服务器,这是的,没有太多可说的。如果服务器不存在,并根据频率和数据大小发送,你可能看来自Android客户端发出HTTP请求和检索XML或JSON格式的数据。

Part 1 is figuring out how to get the raw data from the server. Without knowing what sort of server this is, there isnt much to say. If the server does not yet exist, and depending on the frequency and size of the data being sent, you might look at making http requests from the Android client and retrieving either XML or JSON formatted data.

第2部分是创建和更新在Android的图形组件(S)。是的,你可以做到这一点从使用Android 2D图形库划伤,但为什么另起炉灶?看看 AndroidPlot - 的http:// androidplot。 COM 。 AndroidPlot所以只要你有你的客户端code到位支持动态数据源,您可以轻松地勾了长达一个AndroidPlot产生积小部件,每一个从服务器接收更新时间重绘。

Part 2 is creating and updating the graphical component(s) on the Android. Yes you could do this from scratch using the Android 2D graphics library, but why reinvent the wheel? Take a look at AndroidPlot - http://androidplot.com. AndroidPlot supports dynamic datasources so as soon as you've got your client code in place, you can easily hook that up to an AndroidPlot generated plot widget and redraw it every time you receive an update from the server.

这篇关于动态图形渲染,Android的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆