I am trying to access a jar file "stock-chart.jar" using B4A with JavaObject
The example for this can be found here
http://stockchartview.org/wiki/android/getting-started/
I've solved most of the problem faced and left this one which i can't find any example to rely on to use in JavaObject
The java code i am having problem with is this
The closest solution i could think of is to use the CreateEvent
It can compile without any errors. The question now is i am not sure how do i define this "StockPointAdapter"
From the java code it looks like a class as there are multiple functions under it.
Therefore calling it as StockPointAdapter_Event might not be appropriate.
Maybe i should be using StockPointAdapter_getPointCount and StockPointAdapter_getPointAt ?
or do i create a class module for it?
The error log in B4A 5.5 indicate that i have a NullPointerException
can any kind soul please point me in the correct direction? thanks.
The example for this can be found here
http://stockchartview.org/wiki/android/getting-started/
I've solved most of the problem faced and left this one which i can't find any example to rely on to use in JavaObject
The java code i am having problem with is this
B4X:
price.setPointAdapter(new IPointAdapter()
{
private final StockPoint fPoint = new StockPoint();
@Override
public int getPointCount()
{
return points.length;
}
@Override
public AbstractPoint getPointAt(int i)
{
Point p = points[i];
fPoint.setValues(p.o, p.h, p.l, p.c);
return fPoint;
}
});
The closest solution i could think of is to use the CreateEvent
B4X:
Dim StockPriceSeries As JavaObject
StockChartView.InitializeNewInstance("org.stockchart.StockChartView", Array(GetContext))
PriceArea = StockChartView.RunMethodJO("addArea", Null)
StockPriceSeries = StockChartView.RunMethodJO("addSeries", Array(PriceArea))
StockPriceSeries.RunMethod("setPointAdapter" , Array(StockChartView.CreateEvent("org.stockchart.series.Series.IPointAdapter", "StockPointAdapter", Null)))
From the java code it looks like a class as there are multiple functions under it.
Therefore calling it as StockPointAdapter_Event might not be appropriate.
Maybe i should be using StockPointAdapter_getPointCount and StockPointAdapter_getPointAt ?
or do i create a class module for it?
The error log in B4A 5.5 indicate that i have a NullPointerException
B4X:
java.lang.NullPointerException: Expected to unbox a 'int' primitive type but was returned null
at $Proxy0.getPointCount(Unknown Source)
at org.stockchart.series.Series.getPointCount(Series.java:405)
at org.stockchart.series.Series.hasPoints(Series.java:282)
at org.stockchart.StockChartView.calcAutoValues(StockChartView.java:1167)
can any kind soul please point me in the correct direction? thanks.