IGISApplication

public interface IGISApplication

Interface that all applications using the library should implements. It used in content provider. If your application will not implement this interface - the synchronization vector layers with server will not work. If you plan to fix maplib or maplibui libraries, you nee to clone the sources such way:

  • clone maplib and/or maplibui as submodules
git submodule add https://github.com/nextgis/android_maplib.git maplib
git submodule add https://github.com/nextgis/android_maplibui.git maplibui

Modify settings.gradle:

from: include ':app'
to: include ':app', ':maplib', ':maplibui'

Also add https://jitpack.io/ to build.gradle file:

allprojects {
  repositories {
    jcenter()
    maven { url "https://jitpack.io" }
  }
}
dependencies {
  compile 'com.github.User:Repo:Tag'
}

Note: Expected that project was created via Android studio new project wizard.

Author:Dmitry Baryshnikov

Methods

addAccount

boolean addAccount(String name, String url, String login, String password, String token)

Add account to android account storage

Параметры:
  • name – Account name (must be uniq)
  • url – NextGIS Web Server URL
  • login – User login
  • password – User password
  • token – A token returned from NextGIS Web Server (may be empty string)
Результат:

true on success or false

getAccount

Account getAccount(String accountName)
Параметры:
  • accountName – Account name
Результат:

Account by its name

getAccountLogin

String getAccountLogin(Account account)
Параметры:
  • account – Account object
Результат:

Account login

getAccountPassword

String getAccountPassword(Account account)
Параметры:
  • account – Account object
Результат:

Account password

getAccountUrl

String getAccountUrl(Account account)
Параметры:
  • account – Account object
Результат:

Account URL

getAccountUserData

String getAccountUserData(Account account, String key)

Return some account data

Параметры:
  • account – account object
  • key – key to return
Результат:

value in user key - value map

getAccountsType

String getAccountsType()

Get accounts authenticator type

getAuthority

String getAuthority()
Результат:A authority for sync purposes or empty string if not sync anything

getGpsEventSource

GpsEventSource getGpsEventSource()
Результат:A GpsEventSource or null if not needed or created in application

getLayerFactory

LayerFactory getLayerFactory()

Get LayerFactory

getMap

MapBase getMap()
Результат:A MapBase or any inherited classes or null if not created in application

removeAccount

AccountManagerFuture<Boolean> removeAccount(Account account)

Remove an account

Параметры:
  • account – Account to remove
Результат:

An @see AccountManagerFuture which resolves to a Boolean, true if the account has been successfully removed

sendEvent

void sendEvent(String category, String action, String label)

Send target event to analytics

sendScreen

void sendScreen(String name)

Send screen hit to analytics

setPassword

void setPassword(String name, String value)

Change password for account

Параметры:
  • name – Account name (the account must be exist)
  • value – New password

setUserData

void setUserData(String name, String key, String value)

Update account information

Параметры:
  • name – Account name (the account must be exist)
  • key – The account key to change (i.e. URL)
  • value – The new value for key

showSettings

void showSettings(String setting)

Show settings Activity or nothing