Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 

The most awaited feature BTP Mobile Authentication with SAP Build Apps. In this blog let’s create Build Apps project which does authentication and fetches data from BTP.

Prerequisites:

First, make sure to subscribe to SAP Build Apps.

Project Creation:

From the Build lobby, create a new project by clicking “Create” button, selecting “Build an Application”, followed by “SAP Build Apps” and “Web & Mobile Application”. Provide a Project Name and click on “Create”.

ProjectCreation.pngBTP Authentication:

Please select the “Auth” tab

BTPAuthentication.png

Select “ENABLE AUTHENTICATION” and select “SAP BTP Authentication” and Click “OK”.

This will add SAP BTP Authentication as shown below and this will also add an additional page to our application to handle authentication.

Data Integration:

To test BTP authentication we will add data from BTP Destinations.

Navigate to “Data” tab, From the “No Systems integrated”, select “ADD INTEGRATION” button. From SAP Systems, Click on “BTP DESTINATIONS”. In the list select “Northwind” destination and we can browse the details. Please select “Products” entity.

To use our destination in the application, select “INSTALL INTEGRATION” and click on “ENABLE DATA ENTITY” button and Click on “SAVE”.

DataIntegration1.pngDataIntegration2.png

Build Application Creation:

In the Home Page, drag and drop a button. From “PROPERTIES” label it as “Products”.

ProductButton.png

 

 

 

 

 

 

Click on the “Home page” to add another page to view Product details.

NewPageProductspng.png

Let’s add a basic list item, for that click on “MARKETPLACE” and select from “Lists”-> “Basic list” and “INSTALL”. Click “SAVE”.

BasicList.png

Click on “Configure” and Select “Products” data entity. Drag source data fields to the component fields to the right. Click on “SAVE AND EXIT”.

ConfigureProductFields.png

Go to “Home page” and select “Products” button and add logic for “Navigation”. Drag and drop “Open Page” to the logic panel. Click on “Open page” and configure the page to be opened as “Products.

ProductsPageNavigation.png

Click on “Launch” tab and preview the application flow. We have successfully created application to view backend data. Now let’s setup build service.

Build Service:

Click on “Launch” tab and Select “Open build service” from “Build your app”.

Let Configure BTP Authentication for Android Mobile device.

BuildService.png

Android Build Settings

Add Keystore details and click next and leave the default values for “Bundle Settings”, “Image Assets” and “Permissions”.

Keystore.pngBundleSettings.png

ImageAssets.png

Permissions.png

To Configure “Mobile Services” , Click on “Enable SAP Mobile Services”.

From drop down fill in the values with the ones from BTP Cockpit Subaccount – API Endpoint, Org Name, and Name of one of the spaces.

After choosing an API Endpoint, make sure to Click on Login button and after successful login, select organization and Space from dropdown and click “SAVE”.

BuildSettings.png

SuccessfulBTPAuth.png

Now let’s do a Android Build.. Click on the “Buiild” button, once the build is succesful we will able to install and run the .apk on Android device

AndroidBuildButtonEnabled.png

On Android Device

Yay, the app is ready, we have successfully made an Android build and below is the BTP Authentication flow on the device.

AndroidDevice.png