6.3.1.2.2. 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

6.3.1.2.2.1. Methods

6.3.1.2.2.1.1. addAccount

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

Add account to android account storage

Parameters:
  • 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)
Returns:

true on success or false

6.3.1.2.2.1.2. getAccount

Account getAccount(String accountName)
Parameters:
  • accountName – Account name
Returns:

Account by its name

6.3.1.2.2.1.3. getAccountLogin

String getAccountLogin(Account account)
Parameters:
  • account – Account object
Returns:

Account login

6.3.1.2.2.1.4. getAccountPassword

String getAccountPassword(Account account)
Parameters:
  • account – Account object
Returns:

Account password

6.3.1.2.2.1.5. getAccountUrl

String getAccountUrl(Account account)
Parameters:
  • account – Account object
Returns:

Account URL

6.3.1.2.2.1.6. getAccountUserData

String getAccountUserData(Account account, String key)

Return some account data

Parameters:
  • account – account object
  • key – key to return
Returns:

value in user key - value map

6.3.1.2.2.1.7. getAccountsType

String getAccountsType()

Get accounts authenticator type

6.3.1.2.2.1.8. getAuthority

String getAuthority()
Returns:A authority for sync purposes or empty string if not sync anything

6.3.1.2.2.1.9. getGpsEventSource

GpsEventSource getGpsEventSource()
Returns:A GpsEventSource or null if not needed or created in application

6.3.1.2.2.1.10. getLayerFactory

LayerFactory getLayerFactory()

Get LayerFactory

6.3.1.2.2.1.11. getMap

MapBase getMap()
Returns:A MapBase or any inherited classes or null if not created in application

6.3.1.2.2.1.12. removeAccount

AccountManagerFuture<Boolean> removeAccount(Account account)

Remove an account

Parameters:
  • account – Account to remove
Returns:

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

6.3.1.2.2.1.13. sendEvent

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

Send target event to analytics

6.3.1.2.2.1.14. sendScreen

void sendScreen(String name)

Send screen hit to analytics

6.3.1.2.2.1.15. setPassword

void setPassword(String name, String value)

Change password for account

Parameters:
  • name – Account name (the account must be exist)
  • value – New password

6.3.1.2.2.1.16. setUserData

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

Update account information

Parameters:
  • name – Account name (the account must be exist)
  • key – The account key to change (i.e. URL)
  • value – The new value for key

6.3.1.2.2.1.17. showSettings

void showSettings(String setting)

Show settings Activity or nothing