Developer

Creating a New Project

Create an Android project in Android Studio.

Prerequisites

Install Android Studio. See https://developer.android.com/tools/studio/index.htmlInformation published on non-SAP site

Context

Use the build.gradle file to add SAP Mobile Platform SDK OData library resources to your Android project and set other application properties.

Procedure

  1. Start a new Android Studio Project.
  2. Copy all JAR and AAR files from the C:\SAP\MobileSDK3\NativeSDK\MAFReuse\Android\libraries and C:\SAP\MobileSDK3\NativeSDK\ODataFramework\Android\libraries directories to your <project-folder>/app/libs folder.
  3. Open your app module build.gradle file

  4. Copy these lines into your gradle file:
    repositories{
        flatDir{
            dirs 'libs'
        }
    }
    
  5. Verify (or add) this line into the dependencies section of the build.gradle file:
    compile fileTree(include: ['*.jar'], dir: 'libs')
    After this line within the dependencies section, insert the following lines for each of the AAR files you copied into the libs folder:
    compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar')
    For example:
    compile(name:' mafcalendar-1.210.0', ext:'aar')
    and so on. Insert a line for each AAR file.
  6. Click Sync Now to sync your project.

    Your newly referenced AAR libs also should appear among the external libraries:

  7. Start developing your mobile app.