FATOS Map Developers (Powered by NostraMap)
Developer SiteConsole
  • FATOS Developer Introduction
  • FATOS API
    • Map
      • Map control
        • Building
        • Bounds
        • Center
        • Heading
        • Flyto
        • Tilt
        • Zoom
        • Marker
          • Instance Members
        • Polyline
        • Polygon
        • Circle
        • On/Off
        • Once
        • Language
        • Theme
        • Cluster
          • Instance Members
      • Button control
      • Utilities
        • Rectangle
        • Distance
        • Area
    • Search
      • POI
      • Address
      • Geocoding
        • Forward
        • Reverse
      • Geofencing
    • Routing
      • Route
      • Route for truck
    • Advanced
      • Logistics
  • FATOS SDK
    • Authentication
    • Platform
      • Android
        • Start
        • Component
      • iOS
        • Start
        • Component
      • React Native
        • Start
        • Component
  • Release note
    • FATOS Map API
    • API Server
    • RP Server
  • Get your API Key
  • Troubleshooting
    • FAQ
Powered by GitBook
On this page
  • Development Environment
  • To link AAR file
  • Permissions
  • To add API key

Was this helpful?

  1. FATOS SDK
  2. Platform
  3. Android

Start

How to install FatosSDK for Android development

PreviousAndroidNextComponent

Last updated 4 years ago

Was this helpful?

In this section, a guide to set up development environment for FATOS SDK for Android will be introduced. The functions of the SDK are largely composed of map, search, and route planning related operations. The map function can control the map layers, settings, and operation. To use "FATOS SDK for Android", you must request an SDK key and then apply that key to the source. If you want an SDK key, please go to and request an SDK key after sign up.

Please let us know if you have any technical problems using our SDK Contact :

Development Environment

Clone or download FATOS SDK for Android from

FATOS SDK for Android is deployed as a form of AAR (Android Archive Package). Therefore, it must be linked within your project.

Make sure to check the compatibility

FATOS SDK for Android supports Android 5.0 or above (API Level 20 or above)

To link AAR file

modify app/build.gradle like as follow:

repositories {
    flatDir {
        dirs 'libs'
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation(name:'fire_sdk_vX.X.X', ext:'aar')

....

Permissions

To use FATOS SDK for Android, you must set 3 permission settings

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        int permissionResultWRITE_EXTERNAL_STORAGE = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
        int permissionResultACCESS_FINE_LOCATION = checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION);
        int permissionResultACCESS_READ_PHONE= checkSelfPermission(Manifest.permission.READ_PHONE_STATE);

        if (permissionResultWRITE_EXTERNAL_STORAGE == PackageManager.PERMISSION_DENIED
                || permissionResultACCESS_FINE_LOCATION == PackageManager.PERMISSION_DENIED
                || permissionResultACCESS_READ_PHONE == PackageManager.PERMISSION_DENIED) {
            requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.READ_PHONE_STATE}, 1000);
        }
        else {
            m_Handler.postDelayed(startMainActivity, 10);
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
    }
    else {
        m_Handler.postDelayed(startMainActivity, 10);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}

For a flexible navigation feature to be used in your project, your "Application class" and "MainActivity" must be inherited from "ANaviApplication class" and "FMBaseActivity class" respectively.

@Override
public class TNaviApplication extends ANaviApplication {
    private Context m_Context;
    @Override
    public void onCreate() {
    ...
    }
}


public class TNaviMainActivity extends FMBaseActivity {
...
}

FATOS SDK for Android requires that Navi Engine initialize. We strongly recommend you do so at onCreate() of MainActivity that extends FMBaseActivity.

public class TNaviMainActivity extends FMBaseActivity {
    private void InitProcess() throws IOException {
        m_Context = this;
        m_gApp = (ANaviApplication) m_Context.getApplicationContext();
        m_route = m_gApp.getRouteApiInstance();
        FMInterface.CreateInstance(m_Context);
        m_FMInterface = FMInterface.GetInstance();
        m_iEngineInit = initFatosNaviEngine();

        if(m_iEngineInit != 1)
        {
            Intent intent = new Intent();
            intent.setAction(TNaviActionCode.READY_MAIN_MAP); // Action name
            sendBroadcast(intent);
            return;
        }
    }
}

To add API key

You must set your API key through FMInterface.initKey() function at onCreate() method in your Application class.

public class TNaviApplication extends ANaviApplication {
    private Context m_Context;

    @Override
    public void onCreate() {
        m_Context = this;
        FMInterface.initKey(m_Context, "FATOS SDK API key");
        super.onCreate();
        ...
        ...

If you haven't got an API key, please visit:

Get your API Key
https://nostramap-console.fatos.biz/
sales@fatoscorp.com
https://github.com/devfatoscorp/fatos-android-sdk
Make sure to clone or download from the Clone menu