Hi I'm trying to develop a Field Test Application and i've to retrieve information like signal strength of neighboring cells.
So my question is:
How can I display a graph with the different neighboring cells on X-axis and the signal strength on Y-axis in real time? An example here.
I've already got 5 or 6 neighboring cells and for each one his signal strength.
iWifi is your ultimate network diagnostic tool, you can quickly test your internet speed, detect networked devices and view all kinds of network information, and there is also an analysis tool to visualize the nearby Wi-Fi signal.
Rather drawning the graph your self manually using Canvas, You can use Chart Engine Libraries available and that will be much easier to do also.
Like AchartEngine,ChartDroid,aFreeChart,MPAndroidChart
For 3D Chart Charts4J
How can I display a graph with the different neighboring cells on X-axis and the signal strength on Y-axis in real time?
I have used aChart Engine for the same in one of my application. There is a complete API demo available with the library so it will be pretty easy to understand how to use that.
I don't know which type of graph you want to develop because there are different types at your link. But I've developed a real time line graph in android. I'm using canvas for drawing lines.
public class GraphView extends View
{
...
private final Rect rect = new Rect();
private final Paint linePaint = new Paint();
private final Paint backgroundPaint = new Paint();
private float[] points;
public GraphView(final Context context, final AttributeSet aSet)
{
super(context, aSet);
}
@Override
protected void onDraw(final Canvas canvas)
{
if (points == null)
{
return;
}
canvas.drawLines(points, linePaint);
rect.set((int) (xIndex * xScale), 0, (int) (xIndex * xScale + 5), getHeight());
canvas.drawRect(rect, backgroundPaint);
}
...
}
You can easily position/size your rect according to your needs. I didn't wrote the calculations of xIndex and xScale. The points array is the one which your values will be written.
But beware, in android lines are drawn with pairs, there is no 'point' structure as I know.
I mean [1, 0.25, 2, 0.45] draws a line between x1= 1, y1=0.25 and x2=2, y2= 0.45
Also you can trigger draw by postInvalidate()
postInvalidate() onDraw (Canvas canvas)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With