Skip to Content

Try Out SAP Cloud Platform SDK for Android Wizard

test
0 %
Try Out SAP Cloud Platform SDK for Android Wizard
Details
// Explore More Tutorials

Try Out SAP Cloud Platform SDK for Android Wizard

Use the wizard to create a mobile app and app configuration that makes use of features of the SAP Cloud Platform Mobile Services.

You will learn

  • How to create an Android app using the Android Studio integrated SAP Wizard
  • How to create a Google Firebase project, enable Cloud Messaging and download a google-services.json file from Google Firebase console to enable push messaging
  • The type of screens generated by the wizard

Before you start, make sure you have:


Step 1: Create and run the project

Open Android Studio.

Android Studio

Choose Start a new SAP Cloud Platform Android project.

New project

The wizard can save the server connection details for multiple servers. Fill in the required fields as shown below.

Ensure you have completed the prerequisites for this tutorial before continuing to guarantee that you have an account.

Field Value
Account Name SAP Cloud Platform Mobile Services Trial
Admin API URL See below for how to get this URL
Admin UI URL See below for how to get this URL
Username Username for your trial account user
Password Password for your trial account user
Save Account Information Check the first time the account info so it does not have to be re-entered on subsequent runs of the wizard

Go to the SAP Cloud Platform Mobile Services website and under Important Links, both URLs will be present

Admin API and UI URLServer connection

Click Next on the Server Connection tab.

On the Cloud Configuration tab select Create and provide the required information.

Field Value
Application Name Wiz App
Application ID com.sap.wizapp
Authentication Type Basic
Create tab information

Click Next to configure the OData Services.

OData services blank

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. Since you are creating a new application, add com.sap.edm.sampleservice.v2.

OData services add service

Click Next to continue to the Project Configuration.

OData services done

On the Project Configuration tab provide the following configuration data:

Field Value
Project Name Wiz App
Project Namespace com.sap.wizapp
Use Discovery Service for Application bootstrapping uncheck
Generate Master-Detail Application check
Enable Logging check
Enable Upload check
Enable Push optional

If you would like to add push notification support to your application, proceed to the next section. Otherwise, click Finish and skip the next section, which describes how to acquire a google-services.json file needed for push messaging..

Project configuration
What is the name of the wizard used to create the project?
×
Step 2: Enable push notifications (optional)

Check the Enable Push checkbox to enable push notification support in the app. You will notice that an error message has appeared explaining that you need to specify a google-services.json file. We will obtain this file from the Cloud Messaging feature in Google Firebase.

Push Notifications enabled

Open the Firebase console and click on Add project.

Add project in Firebase

Access Project Settings for the newly created project.

Project settings

Add Firebase to your app.

Add Firebase to your Android app

The Android package name must match the Project Namespace used when creating the app in Android Studio. In our example, the Android package name is com.sap.wizapp.

Register App

Download the google-services.json file.

Download google-services.json file

Now browse for the google-services.json file in the wizard. This will enable the app to work with Google Firebase notifications.

Add google-services.json file to wizard

The push configuration on the server will be added in the tutorial Send notifications to your application.

Click Finish.

What file is required from Google Firebase to enable the project to receive push messages?
×
Step 3: Explore the app

Wait for the build to finish.

Project created

Click the Run toolbar icon.

Run the project

Choose the emulator to run the app on.

For more information on creating Virtual Devices that run in the Android Emulator, see here.

Deployment target

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

Welcome screen

Sign in with the your credentials.

Authentication screen

The entered credentials, are securely stored by the app, and do not need to be re-entered the next time the app is opened.

The passcode (or fingerprint if enabled) screen provides an additional layer of security for your app. The passcode policy can be modified in the Mobile Service Cockpit under Client Policies feature.

Passcode screen

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

Entities screen

Tap on Products to reach the below list screen.

Products screen

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

Category detail

Further information on the generate application can be found at Running the Wizard and the WizardAppReadme.md file located in the generated app.

Congratulations! You have created your first Android app using the SAP Cloud Platform SDK for Android!

What features does the generated app contain?
×

Next Steps

Back to top