This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| manual:advanced:locus_api:information_about_locus [2015/05/21 15:24] – created mstupka | manual:advanced:locus_api:information_about_locus [2026/11/27 10:35] (current) – removed mstupka | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Information about Locus ====== | ||
| - | Most important for every extension - //is Locus installed?// | ||
| - | |||
| - | __Starting point for similar questions are two classes__ | ||
| - | |||
| - | * [[https:// | ||
| - | * [[https:// | ||
| - | |||
| - | ===== Basic tasks ===== | ||
| - | |||
| - | ==== Is Locus installed ==== | ||
| - | |||
| - | Get list of available versions on your device | ||
| - | <code java> | ||
| - | LocusUtils.getAvailableVersions(Context ctx); | ||
| - | </ | ||
| - | |||
| - | and check if result contains any // | ||
| - | |||
| - | Or if you don't care about // | ||
| - | |||
| - | <code java> | ||
| - | LocusUtils.isLocusAvailable(Context ctx); | ||
| - | </ | ||
| - | |||
| - | and check only // | ||
| - | |||
| - | ==== Is Locus running ==== | ||
| - | |||
| - | If you know // | ||
| - | |||
| - | <code java> | ||
| - | LocusInfo locusInfo = ActionTools.getLocusInfo(ctx, | ||
| - | if (locusInfo == null) { | ||
| - | // problem with receiving information about Locus | ||
| - | return false; | ||
| - | } else { | ||
| - | return locusInfo.isRunning(); | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | ===== Advanced parameters ===== | ||
| - | |||
| - | ==== Where is Locus root directory ==== | ||
| - | |||
| - | - obtain // | ||
| - | - get absolute root path by // | ||
| - | |||
| - | ==== Which units has user set in Locus ==== | ||
| - | |||
| - | This method is very useful, for making units in your own app same as units in Locus. Advantage is that user do not have to set units on two different places. | ||
| - | |||
| - | - obtain // | ||
| - | - get various units parameters by // | ||
| - | |||
| - | <wrap tip>// | ||