![](https://technicalgyanguru.com/wp-content/uploads/2024/09/technicalgyanguru.com-29-1.png)
Technical gyan guru offers a few introductory SAPUI5 tutorials. While some writers have attempted to make the concepts more understandable, others have worked to improve them. Some people have provided explanations for some topics that are not accurate to what we would have anticipated. However, we are all learning and contributing in accordance with what we understand. Additionally, they are sharing their knowledge with the greater community because it is their passion. I attempted to get into SAPYard with my first tutorial with the same mentality. I will attempt to cover a few advanced subjects that experienced front-end developers may find useful.
Install node.js first.
Install it by continuing with the installer.
![](https://sapyard.com/wp-content/uploads/2020/02/Node.jsInstall-1.png)
You may verify the correct installation of node.js by running the “npm” command on the command prompt. If everything is installed correctly, you should see a screen similar to the one below.
![](https://sapyard.com/wp-content/uploads/2020/02/npm-command-success.png)
Install Cordova in Step Two.
To set up Cordova run the “npm install -g cordova” command.
![](https://sapyard.com/wp-content/uploads/2020/02/cordova-install-success.png)
Step 3: Install Android Studio
![](https://sapyard.com/wp-content/uploads/2020/02/Android-studio-download-option.png)
Use the Windows search panel to search for environment to find the environment variable.
![](https://sapyard.com/wp-content/uploads/2020/02/Environment-Variable.png)
![](https://sapyard.com/wp-content/uploads/2020/02/Setting-environment-variables.png)
Step 4: Create a folder using Cordova
Execute the following command:
Harmony: cordova Make a package named Text for your application in a subdirectory named Text.
Example: To construct TicTacToe com.demo, use Cordova.Tic Tac Toe
![](https://sapyard.com/wp-content/uploads/2020/02/Cordova-create-command.png)
Add the Android Platform in Step Five.
- It is necessary to run this command inside the project directory.
- To do the same, use the command “cd directory_name.”
- Now carry out the subsequent command:
Android platform with Cordova integration
![](https://sapyard.com/wp-content/uploads/2020/02/cordova-platform-add-command.png)
Step 6a: Adding Third Party Plugin (optional)
If a third-party plugin is being used by your app, you can add it with the command below.
Run the following command:
Add plugin_name for Cordova plugins
Additionally, the Cordova utility provides two javascript files in order to use the plugins:
js Cordova
Cordova_plugins.js
The index.html file must include a reference to these two files.
Step 6b: If you want to, you can include the SAPUI5 Library to your Cordova project.
If you do not want to use the app offline, skip this step.
<script src=“https://sapui5.hana.ondemand.com/resources/sap-ui-core.js” id=“sap-ui-bootstrap”
data-sap-ui-libs=“sap.m” data-sap-ui-theme=“sap_bluecrystal”
data-sap-ui-xx-bindingSyntax=“complex”>
</script>
But if you plan to run your app offline then change the sapui5 library path as shown below.
<script src=“resources/sap-ui-core.js” id=“sap-ui-bootstrap”
data-sap-ui-libs=“sap.m” data-sap-ui-theme=“sap_bluecrystal”
data-sap-ui-xx-bindingSyntax=“complex”>
</script>
![](https://sapyard.com/wp-content/uploads/2020/02/Openui5_download.png)
After extracting the zip file, find the resources folder.Copy and paste the resources folder into the path below.
The directory of your application \www
Step 7: Compiling the.apk file and Adding Files
- Place each and every application file in the “www” subdirectory of your directory.
- Fill Your_application_Directory \platforms\android\assets\www with everything.
- Dear [Your_application_Directory],
Run the following command:
Build with Cordova
Cordova build
![](https://sapyard.com/wp-content/uploads/2020/02/Cordova-Build-command.png)
Many congratulations! It’s official: your very first Android executable (.apk) has been built.
The command prompt will show the path of the.apk file when the build is successful. Locate and open the.apk file.
Your_application_Directory /platforms/android/build/outputs/apk/android-debug.apk is typically where you can find the.apk file.
By default, the file will be called “android-debug.apk.” You have the option to rename it. You can now install the program on your Android device by transferring the.apk file to it via a USB or any other method.
![](https://sapyard.com/wp-content/uploads/2020/02/apk-built-success.png)
Step 8: Using an emulator to run the.apk
Run the following command:
Android emulation with Cordova
By doing this, the command line program will be deployed to the emulator.
As an alternative, you can use the following command to push the software to your Android smartphone from the command line when you connect it directly to your computer:
Cordova sprint
Three actions will be taken by the run command:
- Generate .apk
- Transfer and install it on your phone
- Run the .apk file on the Android device
Customizing your application’s icon (optional)
You can add a custom display image or icon/logo to your application. To do so, adhere to following guidelines.
Save the image you want as “icon.png” and “screen.png” after downloading it.
Open all the folders in your_application_directory/platforms/android/res and replace the existing icon.png and screen.png with your logo or image.
WindowSoftInputMode for Android
By using this mode, you can make sure that the keyboard doesn’t decrease your primary user interface content when an input box appears in your program. In this mode, the soft keyboard is displayed and the program window is scrolled to reveal the selected view.
To carry out:
- Navigate to your_application_directory /platforms/android
- Open “AndroidManifest.xml”
- Replace android:windowSoftInputMode=”adjustResize”
- with android:windowSoftInputMode=”adjustPan”
That should be simple, and just for fun, you might try installing some more third-party Cordova plugins.
I’ll explain how I created a few unique controls for the Super Mario game in SAPUI5 in my upcoming essay, which is still under development. I’m only able to show you one screenshot from that Super Mario game for now. I would like to post a little video that demonstrates how our super Mario jumps, sprints, and moves in different directions by pressing the arrow keys.
![](https://sapyard.com/wp-content/uploads/2020/02/Mario.png)
This is only a teaser for SAPUI5’s power. Please continue to follow me. I have a ton of other worthwhile and fascinating ideas racing through my head. After I get our Super Mario to demonstrate his abilities, I’ll keep sharing the incredible knowledge I’ve gained from SAPUI5.
Since this is my first article, your small encouragement and remarks will help me stay motivated.
Give me feedback.
you may be interested in this blog here
Salesforce Roadmap to Success: Mapping Out Your Training Journey
Empowering Your ABAP ALV with Integrated Data Access (IDA) on HANA:…