Author Topic: [DEV] - Locus API (since Locus 2.7.3)  (Read 17869 times)

Offline Voldik

  • More than Newbie
  • *
  • Posts: 20
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #15 on: February 24, 2014, 18:48:56 »
Another minor problem:
I'm setting fields "dateCreated" and "lastUpdated" in class GeocachingData and no matter what I set, I see actuall date and time when I click on a cache in field "Created:" and no field "Updated:".

I think, that information about update could be important to know how old are data in listing and so on. In my case (importing from Geoget) would by lastUpdated date before dateCreated.

I have taken a look into your sample project, but you don't work with these dates so it doesn't answer my questions.

Thank you.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 9935
  • Thanked: 53 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #16 on: February 25, 2014, 11:15:57 »
so

1) best is to set new cache coordinates to computed and set parameter "computed" to "true"

or you may as I wrote, add new waypoint that starts with 'FI'nal text. When Locus during import find such waypoint, it move cache to waypoint coordinates and also mark cache as computed automatically. So just simply try attach final waypoint to cache and check if Locus works correctly. It should

So parameters ...
simply add new waypoint. Locus test it's code by this function

Code: [Select]
private static boolean isFinalWaypoint(String testText) {
// check text
if (TextUtils.isEmpty(testText)) {
return false;
}

// decide if start as final waypoint
testText = testText.toLowerCase();
return testText.startsWith("fi") || testText.startsWith("fl");
}

or in description is just text "Coordinate Override"

If you want to improve this system, just let me know

ad 2) to add notes to cache or read users notes (there were also logical requests to synchronize users notes edited in Locus, back to GeoGet)

waypoint.gcData.getNotes(), setNotes()

ad 3) about times - I'm now worried, that these times are not used in Locus. Every Waypoint has own field "timeCreated" (it's in GeoData.timeCreated) which is used as main visible time. When you will have some working add-on, let me know, send me it for test and I'll fix this problem, so Locus will correctly display these values
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline petulinka1

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #17 on: February 25, 2014, 20:01:55 »
The problem is, you're testing prefix, but you should test waypoint TYPE! Prefix can be WW, if I chose it... But WP type is the first thing, which decides, what WP is it.
 

Offline Voldik

  • More than Newbie
  • *
  • Posts: 20
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #18 on: February 25, 2014, 21:58:55 »
I have to agree with Petulinka1, only waypoint type is significant and unambiguous. Everything else is quite unpredictable. :-)

To the second point - you are talking about personal note to whole cache, not only waypoint. See attached screenshot (from new addon's version). After the bold text is personal note only for this WP (before the bold text is owner's description). So, I have solved this issue and "no action needed" now. But if you want, you can add field to Locus for clear handling these personal notes. :)

Ad 3: That explain a lot. :-) When I update cache with GC4Locus addon I see "Last update" field (see attachment), so, it is obviously possible to set this value.
I set it in this way:
Code: [Select]
Date date = new Date();
gcData.dateCreated = date.getTime();
gcData.lastUpdated = c.getLong(c.getColumnIndex("dtupdate2"));
Current beta version is downloadable from http://www.voldik.cz/geo/locus/LocusAddonGeoget.apk.
« Last Edit: February 25, 2014, 22:28:17 by Voldik »
 

Offline Raddino

  • More than Newbie
  • *
  • Posts: 11
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #19 on: March 03, 2014, 21:26:19 »
Totally agree with Voldik and Petulinka. It should be recognized by type of WP, not by name or prefix. It will be nice to change it. Thanks

Odesláno z mého Nexus 5 pomocí Tapatalk

 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 9935
  • Thanked: 53 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #20 on: March 04, 2014, 20:53:26 »
fine, so caching waypoints by type is now fixed. Thanks

about times - I see, there are three types of times in GeocachingData
Code: [Select]
/* time of last updated time (long since 1.1.1970 in ms) */
public long lastUpdated;
/* String with date of last exported - groundspeak:exported */
public long dateCreated;
/* String with date of hidden - value from CachePrinter */
public long hidden;

which you wanna see in Locus?

btw. because there will be more to discuss, it should be fine to create a czech topic for this ;)
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Voldik

  • More than Newbie
  • *
  • Posts: 20
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #21 on: March 10, 2014, 22:05:28 »
Is it possible to set elevation to GeocachingData? (I suppose it is not, so: Would it be possible to add this ability to API?) :-)

And once again thank you for previous work.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 9935
  • Thanked: 53 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #22 on: March 13, 2014, 07:57:34 »
hmm I'm thinking about it and see no simple solution.

How you image it, as a function that allows you to get computed altitude based on coordinates or an ability to "fill altitude" automatically to points send to Locus?

Because I would like to create first option more, which gives quite a freedom to you or other developers, on second side, it will be slower because you will have to firstly ask locus for altitudes
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Voldik

  • More than Newbie
  • *
  • Posts: 20
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #23 on: March 13, 2014, 08:29:36 »
No no, I mean just simple method GeocachingData.setElevation(float elevation); In my case (import from Geoget), I already have the elevation computed.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 9935
  • Thanked: 53 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #24 on: March 13, 2014, 08:52:33 »
ah just set elevation to point? Hmm all values realted to location are in waypoint location object

waypoint.getLocation().set ...
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Voldik

  • More than Newbie
  • *
  • Posts: 20
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #25 on: March 13, 2014, 09:31:24 »
Thank you, it's working. :-)
 

Offline Voldik

  • More than Newbie
  • *
  • Posts: 20
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #26 on: March 26, 2014, 13:10:25 »
I've found possible bug. When I use LocusUtils.handleIntentMainFunction(intent, new LocusUtils.OnIntentMainFunction() {...} I'm getting NullPointerException(). I thought it is bug in my application but when I run your sample application I get the same error. StackTrace is here: http://i.imgur.com/SKcqyxO.png

In your MainActivity it is line 230.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 9935
  • Thanked: 53 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #27 on: March 27, 2014, 09:59:46 »
Sorry, I'm unable to find it.

What you do to achieve same problem? What you wrote about should apper when I install Locus API sample and then in Locus > menu > more > tap on MainActivity. But this works fine and Locus API sample appear and display result of this action.
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Voldik

  • More than Newbie
  • *
  • Posts: 20
    • View Profile
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #28 on: March 27, 2014, 10:31:54 »
Yes, it's working (as far I can tell).

The NullPointerException is thrown at line 422 in LocusUtils.java in method public static Location getLocationFromIntent(Intent intent, String intentExtra) {}

I add Sample App to the right panel, then click on it.
I've tried two different devices and also 'niximor' has reported me this bug.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 9935
  • Thanked: 53 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: [DEV] - Locus API (since Locus 2.7.3)
« Reply #29 on: March 27, 2014, 10:36:54 »
Hmm it's weird. I'm unable to simulate it.

If this problem happen to you and you have access to source of Locus API, check please where this error happen (check if you have latest API). Because you wrote line 422, but on this line if function that creates location from Intent, but this line is in try/catch block

Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!