0% found this document useful (0 votes)
4 views53 pages

MAD Assignment Full Code

The document provides a comprehensive overview of the source code and configuration files for an Android currency converter application. It includes various XML configuration files related to project settings, as well as Java classes for the main activity and instrumented tests. The main functionality allows users to convert amounts between different currencies using a simple user interface.

Uploaded by

sahdevkhatkar12
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)
4 views53 pages

MAD Assignment Full Code

The document provides a comprehensive overview of the source code and configuration files for an Android currency converter application. It includes various XML configuration files related to project settings, as well as Java classes for the main activity and instrumented tests. The main functionality allows users to convert amounts between different currencies using a simple user interface.

Uploaded by

sahdevkhatkar12
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

MAD Assignment - Full Source Code Documentation

Mad-assignment-main

[Link]
Path:
Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="[Link]"
/>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

[Link]
Path:
Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DeviceTable">
<option name="columnSorters">
<list>
<ColumnSorterState>
<option name="column" value="Name" />
<option name="order" value="ASCENDING" />
</ColumnSorterState>
</list>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21"
default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="[Link] />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option
value="[Link]"
/>
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]
nProducer" />
<option
value="[Link]" />
<option
value="[Link]" />
</set>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/app/src/androidTest/java/
com/example/currencyconverter/[Link]
package [Link];

import [Link];

import [Link];
import [Link].AndroidJUnit4;

import [Link];
import [Link];
import static [Link].*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="[Link] documentation</a>
*/
@RunWith([Link])
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext =
[Link]().getTargetContext();
assertEquals("[Link]",
[Link]());
}
}

[Link]
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/main/[Link]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
xmlns:tools="[Link]

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="[Link]" />

<category android:name="[Link]" />


</intent-filter>
</activity>
</application>

</manifest>

[Link]
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/main/java/com/example/
currencyconverter/[Link]
package [Link];

import [Link];
import [Link];
import [Link].*;
import [Link];
import [Link];

import [Link];

public class MainActivity extends AppCompatActivity {

EditText inputAmount;
Spinner fromCurrency, toCurrency;
Button convertBtn;
TextView resultText;

String[] currencies = {"INR", "USD", "EUR", "JPY"};

@Override
protected void onCreate(Bundle savedInstanceState) {

SharedPreferences prefs = getSharedPreferences("settings",


MODE_PRIVATE);
boolean isDark = [Link]("darkMode", false);

if (isDark) {

[Link](AppCompatDelegate.MODE_NIGHT_YES);
} else {

[Link](AppCompatDelegate.MODE_NIGHT_NO);
}

[Link](savedInstanceState);
setContentView([Link].activity_main);

inputAmount = findViewById([Link]);
fromCurrency = findViewById([Link]);
toCurrency = findViewById([Link]);
convertBtn = findViewById([Link]);
resultText = findViewById([Link]);

ArrayAdapter<String> adapter = new ArrayAdapter<>(this,


[Link].simple_spinner_dropdown_item, currencies);

[Link](adapter);
[Link](adapter);

[Link](v -> {
String amountStr = [Link]().toString();
if ([Link]()) {
[Link]("Enter amount");
return;
}

double amount = [Link](amountStr);


String from = [Link]().toString();
String to = [Link]().toString();

double result = convert(from, to, amount);


[Link]("Result: " + result);
});

double convert(String from, String to, double amount) {


HashMap<String, Double> rates = new HashMap<>();

[Link]("INR", 1.0);
[Link]("USD", 0.012);
[Link]("EUR", 0.011);
[Link]("JPY", 1.8);

double inINR = amount / [Link](from);


return inINR * [Link](to);
}
}

ic_launcher_background.xml
Path: Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/drawable/
ic_launcher_background.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="[Link]
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

ic_launcher_foreground.xml
Path: Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/drawable/
ic_launcher_foreground.xml
<vector xmlns:android="[Link]
xmlns:aapt="[Link]
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4
26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-
0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-
0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828
38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428
65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-
2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328
43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-
2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328
64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

activity_main.xml
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/layout/activity_m
[Link]
<LinearLayout xmlns:android="[Link]
android:orientation="vertical"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent">

<EditText
android:id="@+id/inputAmount"
android:hint="Enter amount"
android:inputType="numberDecimal"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<Spinner
android:id="@+id/fromCurrency"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Spinner
android:id="@+id/toCurrency"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<Button
android:id="@+id/convertBtn"
android:text="Convert"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<TextView
android:id="@+id/resultText"
android:text="Result"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

</LinearLayout>

ic_launcher.xml
Path: Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/mipmap-
anydpi-v26/ic_launcher.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="[Link]
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

ic_launcher_round.xml
Path: Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/mipmap-
anydpi-v26/ic_launcher_round.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="[Link]
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

[Link]
Path: Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/values-
night/[Link]
<resources xmlns:tools="[Link]
<!-- Base application theme. -->
<style name="[Link]"
parent="[Link]">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>
</resources>

[Link]
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/values/[Link]
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

[Link]
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/values/[Link]
l
<resources>
<string name="app_name">currency converter</string>
</resources>

[Link]
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/values/[Link]
l
<resources xmlns:tools="[Link]
<!-- Base application theme. -->
<style name="[Link]"
parent="[Link]">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>

<style name="[Link]"
parent="[Link]" />
</resources>

backup_rules.xml
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/xml/backup_rules
.xml
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See [Link]
for details.
Note: This file is ignored for devices older than API 31
See [Link]
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="[Link]"/>
-->
</full-backup-content>

data_extraction_rules.xml
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/main/res/xml/data_extracti
on_rules.xml
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See [Link]
changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>

[Link]
Path:
Mad-assignment-main/Q1_CurrencyConverter/app/src/test/java/com/example/
currencyconverter/[Link]
package [Link];

import [Link];

import static [Link].*;

/**
* Example local unit test, which will execute on the development machine
(host).
*
* @see <a href="[Link] documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="[Link]"
/>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DeviceTable">
<option name="columnSorters">
<list>
<ColumnSorterState>
<option name="column" value="Name" />
<option name="order" value="ASCENDING" />
</ColumnSorterState>
</list>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21"
default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="[Link] />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option
value="[Link]"
/>
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]
nProducer" />
<option
value="[Link]" />
<option
value="[Link]" />
</set>
</option>
</component>
</project>

[Link]
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/androidTest/java/com/example/
mediaplayerapp/[Link]
package [Link];

import [Link];

import [Link];
import [Link].AndroidJUnit4;

import [Link];
import [Link];

import static [Link].*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="[Link] documentation</a>
*/
@RunWith([Link])
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext =
[Link]().getTargetContext();
assertEquals("[Link]", [Link]());
}
}

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/app/src/main/[Link]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
xmlns:tools="[Link]

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="[Link]" />

<category android:name="[Link]" />


</intent-filter>
</activity>
</application>

</manifest>

[Link]
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/main/java/com/example/mediapl
ayerapp/[Link]
package [Link];

import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];

public class MainActivity extends AppCompatActivity {


MediaPlayer mediaPlayer;
VideoView videoView;

Button play, pause, stop, restart;

@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);

play = findViewById([Link]);
pause = findViewById([Link]);
stop = findViewById([Link]);
restart = findViewById([Link]);
videoView = findViewById([Link]);

mediaPlayer = [Link](this, [Link]);

[Link](v -> [Link]());

[Link](v -> {
if ([Link]()) [Link]();
});

[Link](v -> {
if ([Link]()) {
[Link]();
mediaPlayer = [Link](this, [Link]);
}
});

[Link](v -> {
[Link](0);
[Link]();
});

// Video from URL


String videoUrl =
"[Link]
file.mp4";
Uri uri = [Link](videoUrl);
[Link](uri);
[Link]();
}
}

ic_launcher_background.xml
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/drawable/ic_launcher_b
[Link]
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="[Link]
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

ic_launcher_foreground.xml
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/drawable/ic_launcher_fo
[Link]
<vector xmlns:android="[Link]
xmlns:aapt="[Link]
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4
26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-
0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-
0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828
38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428
65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-
2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328
43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-
2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328
64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

activity_main.xml
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/layout/activity_main.xml
<LinearLayout xmlns:android="[Link]
android:orientation="vertical"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent">

<Button android:id="@+id/playAudio" android:text="Play Audio"


android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<Button android:id="@+id/pauseAudio" android:text="Pause"


android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<Button android:id="@+id/stopAudio" android:text="Stop"


android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<Button android:id="@+id/restartAudio" android:text="Restart"


android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<VideoView
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="200dp"/>

</LinearLayout>

ic_launcher.xml
Path: Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/mipmap-anydpi-
v26/ic_launcher.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="[Link]
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

ic_launcher_round.xml
Path: Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/mipmap-anydpi-
v26/ic_launcher_round.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="[Link]
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
[Link]
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/values-night/[Link]
<resources xmlns:tools="[Link]
<!-- Base application theme. -->
<style name="[Link]"
parent="[Link]">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>
</resources>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/values/[Link]
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/values/[Link]
<resources>
<string name="app_name">MediaPlayerApp</string>
</resources>

[Link]
Path: Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/values/[Link]
<resources xmlns:tools="[Link]
<!-- Base application theme. -->
<style name="[Link]"
parent="[Link]">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>

<style name="[Link]" parent="[Link]" />


</resources>

backup_rules.xml
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/xml/backup_rules.xml
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See [Link]
for details.
Note: This file is ignored for devices older than API 31
See [Link]
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="[Link]"/>
-->
</full-backup-content>

data_extraction_rules.xml
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/main/res/xml/data_extraction_rul
[Link]
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See [Link]
changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>

[Link]
Path:
Mad-assignment-main/Q2_MediaPlayer/app/src/test/java/com/example/mediaplay
erapp/[Link]
package [Link];

import [Link];

import static [Link].*;

/**
* Example local unit test, which will execute on the development machine
(host).
*
* @see <a href="[Link] documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

[Link]
Path: Mad-assignment-main/Q3_Sensors/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="[Link]"
/>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q3_Sensors/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

[Link]
Path: Mad-assignment-main/Q3_Sensors/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q3_Sensors/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q3_Sensors/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21"
default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="[Link] />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

[Link]
Path: Mad-assignment-main/Q3_Sensors/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option
value="[Link]"
/>
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]
nProducer" />
<option
value="[Link]" />
<option
value="[Link]" />
</set>
</option>
</component>
</project>
[Link]
Path: Mad-assignment-main/Q3_Sensors/app/src/androidTest/java/com/example/
sensorapp/[Link]
package [Link];

import [Link];

import [Link];
import [Link].AndroidJUnit4;

import [Link];
import [Link];

import static [Link].*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="[Link] documentation</a>
*/
@RunWith([Link])
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext =
[Link]().getTargetContext();
assertEquals("[Link]", [Link]());
}
}

[Link]
Path: Mad-assignment-main/Q3_Sensors/app/src/main/[Link]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
xmlns:tools="[Link]

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="[Link]" />
<category android:name="[Link]" />
</intent-filter>
</activity>
</application>

</manifest>

[Link]
Path:
Mad-assignment-main/Q3_Sensors/app/src/main/java/com/example/sensorapp/
[Link]
package [Link];

import [Link];
import [Link].*;
import [Link];
import [Link];
import [Link];

import [Link];

public class MainActivity extends AppCompatActivity implements


SensorEventListener {

SensorManager sensorManager;
Sensor accelerometer, light, proximity;

TextView accelText, lightText, proximityText;


ProgressBar accelBar;

@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);

accelText = findViewById([Link]);
lightText = findViewById([Link]);
proximityText = findViewById([Link]);
accelBar = findViewById([Link]);

sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);

accelerometer =
[Link](Sensor.TYPE_ACCELEROMETER);
light = [Link](Sensor.TYPE_LIGHT);
proximity = [Link](Sensor.TYPE_PROXIMITY);
}

@Override
protected void onResume() {
[Link]();
[Link](this, accelerometer,
SensorManager.SENSOR_DELAY_UI);
[Link](this, light,
SensorManager.SENSOR_DELAY_UI);
[Link](this, proximity,
SensorManager.SENSOR_DELAY_UI);
}

@Override
protected void onPause() {
[Link]();
[Link](this);
}

@Override
public void onSensorChanged(SensorEvent event) {

if ([Link]() == Sensor.TYPE_ACCELEROMETER) {

float x = [Link][0];
float y = [Link][1];
float z = [Link][2];

float movement = [Link](x) + [Link](y) + [Link](z);

[Link]("Movement: " + movement);

[Link]((int) movement);

// Color effect based on movement


if (movement > 15) {
[Link]([Link]);
} else {
[Link]([Link]);
}
}

if ([Link]() == Sensor.TYPE_LIGHT) {

float lightValue = [Link][0];


[Link]("Light: " + lightValue);

// Background color changes with light


int brightness = (int) [Link](lightValue, 255);
getWindow().getDecorView().setBackgroundColor(
[Link](brightness, brightness, brightness)
);
}

if ([Link]() == Sensor.TYPE_PROXIMITY) {

float prox = [Link][0];

if (prox < 5) {
[Link]("Near");
[Link]([Link]);
} else {
[Link]("Far");
[Link]([Link]);
}
}
}

@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {}
}

ic_launcher_background.xml
Path:
Mad-assignment-main/Q3_Sensors/app/src/main/res/drawable/ic_launcher_backgr
[Link]
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="[Link]
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

ic_launcher_foreground.xml
Path:
Mad-assignment-main/Q3_Sensors/app/src/main/res/drawable/ic_launcher_foregr
[Link]
<vector xmlns:android="[Link]
xmlns:aapt="[Link]
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4
26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-
0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-
0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828
38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428
65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-
2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328
43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-
2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328
64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

activity_main.xml
Path:
Mad-assignment-main/Q3_Sensors/app/src/main/res/layout/activity_main.xml
<LinearLayout xmlns:android="[Link]
android:orientation="vertical"
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<TextView
android:id="@+id/title"
android:text="Sensor Dashboard"
android:textSize="24sp"
android:textStyle="bold"
android:layout_marginBottom="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView
android:id="@+id/accelText"
android:text="Movement: 0"
android:textSize="18sp"
android:layout_marginBottom="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<ProgressBar
android:id="@+id/accelBar"
style="?android:attr/progressBarStyleHorizontal"
android:max="20"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<TextView
android:id="@+id/lightText"
android:text="Light: 0"
android:textSize="18sp"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<TextView
android:id="@+id/proximityText"
android:text="Proximity: Far"
android:textSize="18sp"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</LinearLayout>

ic_launcher.xml
Path: Mad-assignment-main/Q3_Sensors/app/src/main/res/mipmap-anydpi-v26/
ic_launcher.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="[Link]
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

ic_launcher_round.xml
Path: Mad-assignment-main/Q3_Sensors/app/src/main/res/mipmap-anydpi-v26/
ic_launcher_round.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="[Link]
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

[Link]
Path:
Mad-assignment-main/Q3_Sensors/app/src/main/res/values-night/[Link]
<resources xmlns:tools="[Link]
<!-- Base application theme. -->
<style name="[Link]"
parent="[Link]">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>
</resources>

[Link]
Path: Mad-assignment-main/Q3_Sensors/app/src/main/res/values/[Link]
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

[Link]
Path: Mad-assignment-main/Q3_Sensors/app/src/main/res/values/[Link]
<resources>
<string name="app_name">SensorApp</string>
</resources>

[Link]
Path: Mad-assignment-main/Q3_Sensors/app/src/main/res/values/[Link]
<resources xmlns:tools="[Link]
<!-- Base application theme. -->
<style name="[Link]"
parent="[Link]">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>

<style name="[Link]" parent="[Link]" />


</resources>

backup_rules.xml
Path: Mad-assignment-main/Q3_Sensors/app/src/main/res/xml/backup_rules.xml
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See [Link]
for details.
Note: This file is ignored for devices older than API 31
See [Link]
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="[Link]"/>
-->
</full-backup-content>

data_extraction_rules.xml
Path:
Mad-assignment-main/Q3_Sensors/app/src/main/res/xml/data_extraction_rules.xm
l
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See [Link]
changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>

[Link]
Path:
Mad-assignment-main/Q3_Sensors/app/src/test/java/com/example/sensorapp/
[Link]
package [Link];

import [Link];

import static [Link].*;

/**
* Example local unit test, which will execute on the development machine
(host).
*
* @see <a href="[Link] documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

[Link]
Path: Mad-assignment-main/Q4_Gallery/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="[Link]"
/>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q4_Gallery/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

[Link]
Path: Mad-assignment-main/Q4_Gallery/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q4_Gallery/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q4_Gallery/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q4_Gallery/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21"
default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="[Link] />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

[Link]
Path: Mad-assignment-main/Q4_Gallery/.idea/[Link]
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option
value="[Link]"
/>
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]" />
<option
value="[Link]
nProducer" />
<option
value="[Link]" />
<option
value="[Link]" />
</set>
</option>
</component>
</project>

[Link]
Path: Mad-assignment-main/Q4_Gallery/app/src/androidTest/java/com/example/
cameragalleryapp/[Link]
package [Link];

import [Link];

import [Link];
import [Link].AndroidJUnit4;

import [Link];
import [Link];

import static [Link].*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="[Link] documentation</a>
*/
@RunWith([Link])
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext =
[Link]().getTargetContext();
assertEquals("[Link]",
[Link]());
}
}

[Link]
Path: Mad-assignment-main/Q4_Gallery/app/src/main/[Link]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
xmlns:tools="[Link]

<uses-feature
android:name="[Link]"
android:required="false" />
<uses-permission android:name="[Link]"/>
<uses-permission android:name="[Link].READ_MEDIA_IMAGES"/>
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="[Link]" />
<category android:name="[Link]" />
</intent-filter>
</activity>
</application>

</manifest>

[Link]
Path:
Mad-assignment-main/Q4_Gallery/app/src/main/java/com/example/cameragallery
app/[Link]
package [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];

public class ImageAdapter extends BaseAdapter {

Context context;
ArrayList<Bitmap> images;

public ImageAdapter(Context context, ArrayList<Bitmap> images) {


[Link] = context;
[Link] = images;
}

@Override
public int getCount() {
return [Link]();
}

@Override
public Object getItem(int i) {
return [Link](i);
}

@Override
public long getItemId(int i) {
return i;
}

@Override
public View getView(int i, View view, ViewGroup parent) {

ImageView imageView = new ImageView(context);


[Link]([Link](i));
[Link]([Link].CENTER_CROP);
[Link](new [Link](300, 300));

return imageView;
}
}

[Link]
Path:
Mad-assignment-main/Q4_Gallery/app/src/main/java/com/example/cameragallery
app/[Link]
package [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;

import [Link];
import [Link];

import [Link];

public class MainActivity extends AppCompatActivity {

static final int REQUEST_IMAGE = 1;


static final int CAMERA_PERMISSION_CODE = 100;

Button captureBtn;
GridView gridView;

ArrayList<Bitmap> imageList = new ArrayList<>();


ImageAdapter adapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);

// Permission check
if ([Link].SDK_INT >= Build.VERSION_CODES.M) {
if (checkSelfPermission([Link])
!= PackageManager.PERMISSION_GRANTED) {

requestPermissions(
new String[]{[Link]},
CAMERA_PERMISSION_CODE
);
}
}

captureBtn = findViewById([Link]);
gridView = findViewById([Link]);

adapter = new ImageAdapter(this, imageList);


[Link](adapter);

[Link](v -> {
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, REQUEST_IMAGE);
});

[Link]((parent, view, position, id) -> {

Bitmap selectedImage = [Link](position);

[Link] builder = new [Link](this);


ImageView imageView = new ImageView(this);
[Link](selectedImage);

[Link](imageView);

[Link]("Delete", (dialog, which) -> {


[Link](position);
[Link]();
[Link](this, "Image Deleted",
Toast.LENGTH_SHORT).show();
});

[Link]("Close", null);

[Link]();
});
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent
data) {
[Link](requestCode, resultCode, data);

if (requestCode == REQUEST_IMAGE && resultCode == RESULT_OK) {


if (data != null && [Link]() != null) {
Bitmap photo = (Bitmap) [Link]().get("data");
[Link](photo);
[Link]();
}
}
}

// Optional: handle permission result


@Override
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults) {
[Link](requestCode, permissions,
grantResults);

if (requestCode == CAMERA_PERMISSION_CODE) {
if ([Link] > 0 &&
grantResults[0] == PackageManager.PERMISSION_GRANTED) {

[Link](this, "Camera Permission Granted",


Toast.LENGTH_SHORT).show();

} else {
[Link](this, "Camera Permission Denied",
Toast.LENGTH_SHORT).show();
}
}
}
}

ic_launcher_background.xml
Path:
Mad-assignment-main/Q4_Gallery/app/src/main/res/drawable/ic_launcher_backgr
[Link]
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="[Link]
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

ic_launcher_foreground.xml
Path:
Mad-assignment-main/Q4_Gallery/app/src/main/res/drawable/ic_launcher_foregro
[Link]
<vector xmlns:android="[Link]
xmlns:aapt="[Link]
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4
26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-
0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-
0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828
38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428
65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-
2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328
43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-
2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328
64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

activity_main.xml
Path:
Mad-assignment-main/Q4_Gallery/app/src/main/res/layout/activity_main.xml
<LinearLayout xmlns:android="[Link]
android:orientation="vertical"
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent">

<Button
android:id="@+id/captureBtn"
android:text="Capture Image"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<GridView
android:id="@+id/gridView"
android:numColumns="3"
android:verticalSpacing="5dp"
android:horizontalSpacing="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</LinearLayout>

ic_launcher.xml
Path: Mad-assignment-main/Q4_Gallery/app/src/main/res/mipmap-anydpi-v26/
ic_launcher.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="[Link]
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

ic_launcher_round.xml
Path: Mad-assignment-main/Q4_Gallery/app/src/main/res/mipmap-anydpi-v26/
ic_launcher_round.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="[Link]
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

[Link]
Path:
Mad-assignment-main/Q4_Gallery/app/src/main/res/values-night/[Link]
<resources xmlns:tools="[Link]
<!-- Base application theme. -->
<style name="[Link]"
parent="[Link]">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>
</resources>

[Link]
Path: Mad-assignment-main/Q4_Gallery/app/src/main/res/values/[Link]
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

[Link]
Path: Mad-assignment-main/Q4_Gallery/app/src/main/res/values/[Link]
<resources>
<string name="app_name">CameraGalleryApp</string>
</resources>

[Link]
Path: Mad-assignment-main/Q4_Gallery/app/src/main/res/values/[Link]
<resources xmlns:tools="[Link]
<!-- Base application theme. -->
<style name="[Link]"
parent="[Link]">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>

<style name="[Link]" parent="[Link]" />


</resources>

backup_rules.xml
Path: Mad-assignment-main/Q4_Gallery/app/src/main/res/xml/backup_rules.xml
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See [Link]
for details.
Note: This file is ignored for devices older than API 31
See [Link]
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="[Link]"/>
-->
</full-backup-content>

data_extraction_rules.xml
Path:
Mad-assignment-main/Q4_Gallery/app/src/main/res/xml/data_extraction_rules.xml
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See [Link]
changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
[Link]
Path:
Mad-assignment-main/Q4_Gallery/app/src/test/java/com/example/cameragallerya
pp/[Link]
package [Link];

import [Link];

import static [Link].*;

/**
* Example local unit test, which will execute on the development machine
(host).
*
* @see <a href="[Link] documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

You might also like