peterkuch / geopaparazzi

Automatically exported from code.google.com/p/geopaparazzi
0 stars 1 forks source link

From latest source (2012-12-17) will not compile due to deprecated API [double used instead of float] #163

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
android update project --target "android-17" --path geopaparazzi.app
android update project --target "android-17" --path geopaparazzilibrary
android update project --target "android-17" --path 
geopaparazzispatialitelibrary
cd geopaparazzi.app
ant release

 override getScaleX() in android.view.View; attempting to use incompatible return type
    [javac] found   : double
    [javac] required: float
    [javac]     public double getScaleX()
override getScaleY() in android.view.View; attempting to use incompatible 
return type

private double scaleX;
private double scaleY;

I changed the XYChartView.java to use float instead of double
public float getScaleX(),getScaleY(),scaleX,scaleY

After installing the created apk, the application fails when started on the 
Tablet.

What version of the product are you using? On what operating system?
android-17, Galaxy-Tablet

The previous version, as downloaded from the Play store ran correctly, but this 
is the first time I have tried to compile it and install.

Original issue reported on code.google.com by mj10...@googlemail.com on 17 Dec 2012 at 3:47

GoogleCodeExporter commented 8 years ago
In the original code 
scaleX,scaleY were being set to 0.0;
scaleX=0.0;
scaleY.0.0;

after changing the functions to float, this would no longer compile.

I had changed this to 
scaleX=0;
scaleY.0;
which compiled correctly.

In the mean time have seen that the following is correct for floats:
scaleX=0.0f;
scaleY.0.0f;

after which the application no longer crashed.

So the question that is open is:
why can the 2 function no loger be declared as double and should the code be 
adapted.

Mark Johnson

Original comment by mj10...@googlemail.com on 18 Dec 2012 at 6:21

GoogleCodeExporter commented 8 years ago
Hi Mark, thanks for the report. I remember seeing that on some computer for a 
moment, but then it disappeared and I thought it was a clean project problem.

I am currently not having that problem, I assume because I am building against 
2.3. Is it possible that the View later exposed getScale* methods as public API?

Since we are inheriting this from the charting library (which I would love to 
change anyways when I have time, since it is not that free as I thought), I 
have no real solution right now. 

Any advice/patch is very welcome.

Original comment by andrea.a...@gmail.com on 18 Dec 2012 at 6:29

GoogleCodeExporter commented 8 years ago
That was indeed easy to fix, since we don't need to use the API. 
Done in master.

Original comment by andrea.a...@gmail.com on 18 Dec 2012 at 1:04