0

I have recently been upgrading an old android project, which was using nutiteq sdk. I begun migrating the classes and functions to the much more recent carto sdk.

While doing so, I have faced a few conflicts or incompatibilities. But something so simple as a style builder won't resolve for some reason.

I have converted the original style building code to this:

LineStyleBuilder lsb = new LineStyleBuilder();
lsb.setColor(bcolor);
lsb.setWidth(0.02f);
LineStyle lineStyle=lsb.buildStyle();

Android Studio says it cannot resolve setColor and setWidth.

I have imported the correct classes etc, but I get that issue anyway.

Does anyone out there know of what may be going on?

current sdk

old sdk

JaakL
  • 4,107
  • 5
  • 24
  • 37
Grant Davis
  • 1
  • 1
  • 2
  • Hello out there, it turns out the placement of the code was the key. As I am rather new to android development, I wasn't not aware crucial the placement of code could be, its certainly not something that you have to worry about for iOS. Long story short the code above was placed in the class definition, not the constructor. I have now moved the code to there, and it resolves now! – Grant Davis Oct 07 '19 at 05:49

1 Answers1

0

That should certainly work. The official github sample project (CartoDB/mobile-android-samples) contains basically the same code and works as expected (OverlaysActivity.java).

MarkT
  • 301
  • 2
  • 2
  • Indeed those samples work fine! It seems to resolve in some files, but not every file in the project, very weird! – Grant Davis Oct 07 '19 at 05:44