GOAL: Add a background to the Android application and Change Screen Orientation to Landscape + upgrade the Android application to do following:
- Automatically connect to Bluetooth when application is opened.
- Check if Bluetooth is ON, request user to Turn Bluetooth ON if Bluetooth is OFF
- Allow User to Pair to the Bluetooth.
- Click on Upload Now as show on the screenshot and load the background image.
- Click Choose File from open window and browse to the file location.
- Select the image file.
- Click Open
- Click OK
This will display the Image file in the Media Section.
Select Screen1 by clicking on it on the component Section. Change the Screen properties:
- BackgroundColor = None
- BackgroundImage = Select the image from the dropdown list.
- Click OK
The Image will appear on the screen as background Image.
Step 2: Upgrade Bluetooth Paring and Automatic Connection.
Add four invisiable components and change the properties as below.
1. TinyDB (Basic -> TinyDB)
- Rename = db_MACAddress
- Rename = Notifer
- Rename ActivityStarter 1 = as_TurnONBT
- Rename ActivityStarter 2 = as_PairDevice
- Action = android.bluetooth.adapter.action.REQUEST_ENABLE
- Action = android.intent.action.MAIN
- ActivityClass = com.android.settings.Settings$BluetoothSettingsActivity
- ActivityPackage = com.android.settings
- Rename = btnBluetoothPair
- BackgroundColor = Yellow
- Shape = Rounded
- Text = Pair Bluetooth
- Width = 305 pixels
- Height = 45 pixels
- First update the List BeforePicking Block to also check if the bluietooth is On and paired. Insert a IF Else block to check if the Bluetooth is ON and Paired. If Not then call the. Bluetooth setting screen and display message to Turn ON bluetooth.
- Second block code on AfterPicking. This saves the bluetooth MAC address to use connecting on when the application is turn on next time.














