If there is an existing project at C:\AndroidStudioProjects\WizApp, delete it.

If there is an emulator running and an app on it named Wiz App, delete it (Long press, App info, UNINSTALL).

On this machine, the SAP Cloud Platform SDK for Android has been installed and configured to make use of an instance of a SAP Cloud Platform Mobile Services trial account with an application configuration that has push notifications enabled.

All set, let’s begin!

Step 2: Create and run the project

Open Android Studio.

Choose Start a new SAP Cloud Platform Android project.

The wizard can save the server connection details for multiple servers. A preconfigured account has been provided.

The SAP Cloud Platform Mobile Services provides a sample backend destination named com.sap.edm.sampleservice.v2 that is being used here to provide data for the application. It contains product categories, product, supplier, customer and sales order data.

Click Next.

On the Project Configuration tab:

Set the Project Name to Wiz App.

Set Project Namespace to com.sap.wizapp.

Set Project Location to C:\AndroidStudioProjects\WizApp.

Check the Enable Push checkbox to enable push notification support in the app.

For JSON File Location, browse to C:\AndroidStudioProjects\ and select the google-services.json, which will enable the app to work with Google Firebase notifications.

Click Finish.

After clicking Finish, a project is created.

Click the Run toolbar icon.

Choose the emulator to run the app on.

Step 3: Explore the app

The welcome screen is shown the first time the app is run.

Sign in with the following credentials:

User Name: p2000464045

Password: SCP!2pwd

The credentials are used to authenticate against the SAP Cloud Platform Identity Service, are securely stored by the app, and do not need to be re-entered. Take note of the time that the authentication occurred. This will be helpful to know to identify the correct registration in the Send a notification step.

The passcode (or fingerprint if enabled) screen provides an additional layer of security for your app.

The first screen of the app shows the different entities that are in the sample OData service.

Click on ProductCategories to reach the below list screen.

Click on a list item to show an editable detail screen.

Step 4: Examine the customer's screen

Return to the entity list screen (first screen of the app) by pressing the back button twice.

Click the Customers entity.

Notice that it displays the city rather than the customer name and address. This is because the app was generated from the OData service metadata, which does not indicate which of the many fields from the customer entity to display.

Each customer is displayed in an Object Cell, which is one of the Fiori UI for Android controls.

As seen above, an Object Cell can display more than one field. In the next section, the app will be modified to make use of the image, the labels (headline, sub-headline), and the attributes (status) fields. A separator decoration will be added between rows, and the customers will be shown in alphabetical order.

Notice that two of the classes, CustomersUIConnector and Drawable cannot be resolved and are shown in red.Select each class and press Alt+Enter to make use of Android Studio quick fix to add the missing imports.

Notice that two of the classes, LinearLayoutManager and DividerItemDecoration cannot be resolved. Select each class and press Alt+Enter to make use of Android Studio quick fix to add the missing imports.

On the emulator, open another app, such as Chrome, which will cause the Wiz App to no longer be the foreground app.

Send another notification.

Notice that since the app is in the background or not running, a notification is placed in the notification drawer.

Clicking on the notification will bring the app to the foreground or open the app. Custom logic could be added to the app to decide on the action to take, such as displaying the new Office Furniture category.

Step 12: Bonus

Congratulations! You have now completed the SAP Cloud Platform SDK for Android tutorial.

Send one more notification with a short description of an app you might consider making with the SDK and show it to an SAP staff member for some cool swag.