0% found this document useful (0 votes)
77 views19 pages

Annexes

This document contains code for an Android application that allows controlling a Bluetooth device. It includes code for the main activity, a Bluetooth information activity, and a controller activity. The main activity contains buttons to launch the Bluetooth and quit activities. The Bluetooth activity contains code to discover, pair with, and display paired Bluetooth devices. The controller activity connects to a selected device and contains buttons to send movement commands via Bluetooth.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views19 pages

Annexes

This document contains code for an Android application that allows controlling a Bluetooth device. It includes code for the main activity, a Bluetooth information activity, and a controller activity. The main activity contains buttons to launch the Bluetooth and quit activities. The Bluetooth activity contains code to discover, pair with, and display paired Bluetooth devices. The controller activity connects to a selected device and contains buttons to send movement commands via Bluetooth.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Rapport de stage de perfectionnement ISET Nabeul

Activité principale(main) java :


package com.example.neilbryanlagrimas.remote_control;

import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

Button bluetooth,quit;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

bluetooth = findViewById(R.id.bluetooth);
quit = findViewById(R.id.quit);

bluetooth.setOnClickListener(this);
quit.setOnClickListener(this);

@Override
public void onClick(View v) {
if(v == bluetooth){
startActivity(new Intent(this,Bluetooth_info.class));

}
else if(v == quit){
finish();
System.exit(0);
}}
}

Ben Ahmed Skander A1


Rapport de stage de perfectionnement ISET Nabeul

Activité bluetooth java :

package com.example.neilbryanlagrimas.remote_control;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.Set;
import java.util.UUID;

public class Bluetooth_info extends AppCompatActivity implements View.OnClickListener


{
private static final int REQUEST_ENABLE_BT = 0;
private static final int REQUEST_DISCOVER_BT = 1;

Button onBtn,offBtn,discoverBtn, pairedBtn;


TextView status;
ListView bluelist;

BluetoothAdapter bluetoothAdapter;
private Set<BluetoothDevice> pairedDevices;
public static String EXTRA_ADDRESS = "device_address";

protected void onCreate(Bundle savedInstanceState) {


super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bluetooth_info);

status = findViewById(R.id.status);
bluelist = findViewById(R.id.bluelist);

onBtn = findViewById(R.id.onBtn);
offBtn = findViewById(R.id.offBtn);

Ben Ahmed Skander A2


Rapport de stage de perfectionnement ISET Nabeul

discoverBtn = findViewById(R.id.discover);
pairedBtn = findViewById(R.id.paired);

status.setText("");

// Bluetooth Adapter & Bluetooth available


bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

if (bluetoothAdapter == null) {
Toast.makeText(this, "Bluetooth is not available",
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Bluetooth is available", Toast.LENGTH_SHORT).show();
}

// Bluetooth Status (On/Off)

if (bluetoothAdapter.isEnabled()) {
status.setText("Bluetooth is On");
} else {
status.setText("Bluetooth is Off");
}

onBtn.setOnClickListener(this);
offBtn.setOnClickListener(this);
discoverBtn.setOnClickListener(this);
pairedBtn.setOnClickListener(this);
}

private void pairedDevicesList()


{
pairedDevices = bluetoothAdapter.getBondedDevices();
ArrayList list = new ArrayList();

if (pairedDevices.size()>0)
{
for(BluetoothDevice bt : pairedDevices)
{
list.add(bt.getName() + "\n" + bt.getAddress()); //Get the device's name and the
address
}
}
else
{
Toast.makeText(getApplicationContext(), "No Paired Bluetooth Devices Found.",
Toast.LENGTH_LONG).show();
}

final ArrayAdapter adapter = new


Ben Ahmed Skander A3
Rapport de stage de perfectionnement ISET Nabeul

ArrayAdapter(this,android.R.layout.simple_list_item_1, list);
bluelist.setAdapter(adapter);
bluelist.setOnItemClickListener(myListClickListener); //Method called when the device
from the list is clicked

private AdapterView.OnItemClickListener myListClickListener = new


AdapterView.OnItemClickListener()
{
public void onItemClick (AdapterView<?> av, View v, int arg2, long arg3)
{
// Get the device MAC address, the last 17 chars in the View
Showdialog();
String info = ((TextView) v).getText().toString();
String address = info.substring(info.length() - 17);

// Make an intent to start next activity.


Intent i = new Intent(Bluetooth_info.this, Controller.class);
//Change the activity.
i.putExtra(EXTRA_ADDRESS, address); //this will be received at ledControl (class)
Activity
startActivity(i);
finish();
}
};

public void Showdialog(){


AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Pairing Device");
builder.setCancelable(false);
builder.setMessage("Connecting Bluetooth......");
builder.create().show();
}

@Override
public void onClick(View v) {
// On Bluetooth
if (v == onBtn) {
if (!bluetoothAdapter.isEnabled()) {
Toast.makeText(this, "Turning on Bluetooth....",
Toast.LENGTH_SHORT).show();
Intent enableBtIntent = new
Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
status.setText("Bluetooth is On");

Ben Ahmed Skander A4


Rapport de stage de perfectionnement ISET Nabeul

} else {
Toast.makeText(this, "Bluetooth is already on",
Toast.LENGTH_SHORT).show();
}

if (v == offBtn) {
if (bluetoothAdapter.isEnabled()) {
bluetoothAdapter.disable();
status.setText("Bluetooth is Off");

} else {
Toast.makeText(this, "Bluetooth is already off",
Toast.LENGTH_SHORT).show();
}

// Paired Bluetooth
else if (v == pairedBtn) {

pairedDevicesList();
bluelist.setBackgroundColor(Color.parseColor("#4BC2BF"));
// if (bluetoothAdapter.isEnabled()) {
// pairedlist.setText("Paired Devices\n\n");
// Set<BluetoothDevice> devices = bluetoothAdapter.getBondedDevices();
// for (BluetoothDevice device : devices) {
// pairedlist.append("\nDevice :" + device.getName() + "," + device.getAddress()
+ "," +device + "\n\n");
// }
// } else {
// pairedlist.setText("Turn on bluetooth to get paired devices");
// }
}
// Discover Bluetooth
else if (v == discoverBtn) {
if (!bluetoothAdapter.isDiscovering()) {
Toast.makeText(this, "Bluetooth discovery....",
Toast.LENGTH_SHORT).show();
Intent enableBtIntent = new
Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
startActivityForResult(enableBtIntent, REQUEST_DISCOVER_BT);

}
else{
Toast.makeText(this, "Already Discovered....", Toast.LENGTH_SHORT).show();

}
Ben Ahmed Skander A5
Rapport de stage de perfectionnement ISET Nabeul

}
}
}
activité de controle java :

package com.example.neilbryanlagrimas.remote_control;

import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.Intent;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

import java.io.IOException;
import java.util.UUID;

public class Controller extends AppCompatActivity {

ImageView imageView;

private ProgressDialog progress;


String address = null;
Button up, down, up_left, up_right, down_left, down_right, brake, led;
BluetoothAdapter myBluetooth = null;
BluetoothSocket btSocket = null;
static final UUID myUUID = UUID.fromString("00001101-0000-1000-8000-
00805F9B34FB");

@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_controller);

Intent newint = getIntent();


address = newint.getStringExtra(Bluetooth_info.EXTRA_ADDRESS); //receive the
address of the bluetooth device
imageView = findViewById(R.id.controller);

Ben Ahmed Skander A6


Rapport de stage de perfectionnement ISET Nabeul

up = findViewById(R.id.up);
down = findViewById(R.id.down);

up_left = findViewById(R.id.up_left);
up_right = findViewById(R.id.up_right);
down_left = findViewById(R.id.bot_left);
down_right = findViewById(R.id.bot_right);

brake = findViewById(R.id.brake);

up.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// PRESSED
up();
return true;
case MotionEvent.ACTION_UP:
// RELEASED
brakes();
return true; // if you want to handle the touch event
}
return false;
}
});

down.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// PRESSED
down();
return true;
case MotionEvent.ACTION_UP:
// RELEASED
brakes();
return true; // if you want to handle the touch event
}
return false;
}
});

up_left.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
Ben Ahmed Skander A7
Rapport de stage de perfectionnement ISET Nabeul

// PRESSED
up_left();
return true;
case MotionEvent.ACTION_UP:
// RELEASED
brakes();
return true; // if you want to handle the touch event
}
return false;
}
});

up_right.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// PRESSED
up_right();
return true;
case MotionEvent.ACTION_UP:
// RELEASED
brakes();
return true; // if you want to handle the touch event
}
return false;
}
});

down_left.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// PRESSED
down_left();
return true;
case MotionEvent.ACTION_UP:
// RELEASED
brakes();
return true; // if you want to handle the touch event
}
return false;
}
});

down_right.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Ben Ahmed Skander A8
Rapport de stage de perfectionnement ISET Nabeul

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// PRESSED
down_right();
return true;
case MotionEvent.ACTION_UP:
// RELEASED
brakes();
return true; // if you want to handle the touch event
}
return false;
}
});

brake.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// PRESSED
brakes();
return true;
case MotionEvent.ACTION_UP:
// RELEASED
brakes();
return true; // if you want to handle the touch event
}
return false;
}
});

// down.setOnClickListener(this);
//
// up_left.setOnClickListener(this);
// up_right.setOnClickListener(this);
// down_left.setOnClickListener(this);
// down_right.setOnClickListener(this);
//
// brake.setOnClickListener(this);

connection();
}

private void up() {


if (btSocket != null) {
try {
btSocket.getOutputStream().write('f');
} catch (IOException e) {
Ben Ahmed Skander A9
Rapport de stage de perfectionnement ISET Nabeul

Toast.makeText(this, "Error cant sent data", Toast.LENGTH_SHORT).show();


}
}
}

private void down() {


if (btSocket != null) {
try {
btSocket.getOutputStream().write('b');
} catch (IOException e) {
Toast.makeText(this, "Error cant sent data", Toast.LENGTH_SHORT).show();
}
}
}

private void up_left() {


if (btSocket != null) {
try {
btSocket.getOutputStream().write('l');
} catch (IOException e) {
Toast.makeText(this, "Error cant sent data", Toast.LENGTH_SHORT).show();
}
}
}

private void up_right() {


if (btSocket != null) {
try {
btSocket.getOutputStream().write('r');
} catch (IOException e) {
Toast.makeText(this, "Error cant sent data", Toast.LENGTH_SHORT).show();
}
}
}

private void down_left() {


if (btSocket != null) {
try {
btSocket.getOutputStream().write('l');
} catch (IOException e) {
Toast.makeText(this, "Error cant sent data", Toast.LENGTH_SHORT).show();
}
}
}

private void down_right() {


if (btSocket != null) {
try {
btSocket.getOutputStream().write('r');
Ben Ahmed Skander A10
Rapport de stage de perfectionnement ISET Nabeul

} catch (IOException e) {
Toast.makeText(this, "Error cant sent data", Toast.LENGTH_SHORT).show();
}
}
}

private void brakes() {


if (btSocket != null) {
try {
btSocket.getOutputStream().write('s');
} catch (IOException e) {
Toast.makeText(this, "Error cant sent data", Toast.LENGTH_SHORT).show();
}
}
}

private void connection() {


try {
if (btSocket == null) {
myBluetooth = BluetoothAdapter.getDefaultAdapter();//get the mobile bluetooth
device
BluetoothDevice dispositivo = myBluetooth.getRemoteDevice(address);//connects
to the device's address and checks if it's available
btSocket =
dispositivo.createInsecureRfcommSocketToServiceRecord(myUUID);//create a RFCOMM
(SPP) connection
BluetoothAdapter.getDefaultAdapter().cancelDiscovery();
btSocket.connect();//start connection

Toast.makeText(this, "Success", Toast.LENGTH_SHORT).show();


} else {
Toast.makeText(this, "Error btsocket failed", Toast.LENGTH_SHORT).show();
}
} catch (IOException e) {
Toast.makeText(this, "Error not connected", Toast.LENGTH_SHORT).show();
}
}
}

Ben Ahmed Skander A11


Rapport de stage de perfectionnement ISET Nabeul

Code XML De l’activité Bluetooth :


<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#212121"
tools:context="com.example.neilbryanlagrimas.remote_control.Bluetooth_info">

<Button
android:id="@+id/onBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:background="@color/colorPrimary"
android:minWidth="200dp"
android:text="Turn On"
android:textAlignment="center"
android:textColor="@android:color/background_light"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/status" />

<Button
android:id="@+id/offBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:background="@color/colorPrimary"
android:backgroundTint="@color/colorPrimary"
android:minWidth="200dp"
android:text="Turn Off"
android:textColor="@android:color/background_light"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/onBtn" />

Ben Ahmed Skander A12


Rapport de stage de perfectionnement ISET Nabeul

<Button
android:id="@+id/discover"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:background="@color/colorPrimary"
android:backgroundTint="@color/colorPrimary"
android:minWidth="200dp"
android:text="Discoverabled"
android:textColor="@android:color/background_light"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/offBtn" />

<Button
android:id="@+id/paired"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:background="@color/colorPrimary"
android:backgroundTint="@color/colorPrimary"
android:minWidth="200dp"
android:text="Get Paired Devices"
android:textColor="@android:color/background_light"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/discover" />

<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:text="T"
android:textAlignment="center"
android:textColor="@android:color/background_light"
android:textSize="30sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Ben Ahmed Skander A13
Rapport de stage de perfectionnement ISET Nabeul

<ListView
android:id="@+id/bluelist"
android:layout_width="368dp"
android:layout_height="265dp"
android:layout_marginBottom="32dp"
android:layout_marginEnd="32dp"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.523"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/paired"
app:layout_constraintVertical_bias="0.0" />

</android.support.constraint.ConstraintLayout>

Ben Ahmed Skander A14


Rapport de stage de perfectionnement ISET Nabeul

Code XML de l’activité principale :


<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#212121"
tools:context="com.example.neilbryanlagrimas.remote_control.MainActivity">

<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="8dp"
android:text="Android Controller"
android:textAlignment="center"
android:textColor="#FF5722"
android:textSize="30sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />

<Button
android:id="@+id/bluetooth"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="32dp"
android:background="@color/colorPrimary"
android:backgroundTint="@color/colorPrimary"
android:maxWidth="500dp"
android:text="BLUETOOTH CONNECTION"
android:textColor="@android:color/background_light"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />

Ben Ahmed Skander A15


Rapport de stage de perfectionnement ISET Nabeul

<Button
android:id="@+id/quit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="28dp"
android:layout_marginEnd="32dp"
android:background="#F44336"
android:text="QUIT"
android:textAlignment="center"
android:textColor="@android:color/background_light"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bluetooth" />

<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:text="PLEASE CONNECT"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="#FFEB3B"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />

<ImageView
android:id="@+id/imageView"
android:layout_width="194dp"
android:layout_height="179dp"
android:layout_marginStart="32dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/car" />

</android.support.constraint.ConstraintLayout>

Ben Ahmed Skander A16


Rapport de stage de perfectionnement ISET Nabeul

Code XML de l’activité de controle :


<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#212121"
tools:context="com.example.neilbryanlagrimas.remote_control.Controller">

<Button
android:id="@+id/up"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="60dp"
android:background="@drawable/up"
android:minWidth="100dp"
app:layout_constraintEnd_toEndOf="@+id/controller"
app:layout_constraintHorizontal_bias="0.515"
app:layout_constraintStart_toStartOf="@+id/controller"
app:layout_constraintTop_toBottomOf="@+id/controller" />

<Button
android:id="@+id/down"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/down"
android:minWidth="100dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/brake"
app:layout_constraintStart_toStartOf="@+id/brake"
app:layout_constraintTop_toBottomOf="@+id/brake"
app:layout_constraintVertical_bias="0.009" />

<Button
android:id="@+id/bot_left"
android:layout_width="65dp"
android:layout_height="62dp"
android:layout_marginBottom="64dp"
android:layout_marginEnd="24dp"

Ben Ahmed Skander A17


Rapport de stage de perfectionnement ISET Nabeul

android:background="@drawable/down_left"
android:minWidth="100dp"
android:textAlignment="center"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/down"
app:layout_constraintEnd_toStartOf="@+id/down" />

<Button
android:id="@+id/up_left"
android:layout_width="62dp"
android:layout_height="65dp"
android:layout_marginEnd="24dp"
android:layout_marginTop="60dp"
android:background="@drawable/up_left"
android:minWidth="100dp"
app:layout_constraintEnd_toStartOf="@+id/up"
app:layout_constraintTop_toTopOf="@+id/up" />

<Button
android:id="@+id/bot_right"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginBottom="60dp"
android:layout_marginStart="24dp"
android:background="@drawable/down_right"
android:minWidth="100dp"
app:layout_constraintBottom_toBottomOf="@+id/down"
app:layout_constraintStart_toEndOf="@+id/down" />

<Button
android:id="@+id/up_right"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginStart="24dp"
android:layout_marginTop="60dp"
android:background="@drawable/up_right"
android:minWidth="100dp"
app:layout_constraintStart_toEndOf="@+id/up"
app:layout_constraintTop_toTopOf="@+id/up" />

<Button
android:id="@+id/brake"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:background="@drawable/brake"
app:layout_constraintEnd_toEndOf="@+id/up"
app:layout_constraintHorizontal_bias="1.0"
Ben Ahmed Skander A18
Rapport de stage de perfectionnement ISET Nabeul

app:layout_constraintStart_toStartOf="@+id/up"
app:layout_constraintTop_toBottomOf="@+id/up" />

<ImageView
android:id="@+id/controller"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/car" />

</android.support.constraint.ConstraintLayout>

Ben Ahmed Skander A19

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy