Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

ISB37703 Ubiquitous Computing ASSIGNMENT 1 (Individual)

Page |1

Student name : MOHAMAD ADIB BAIHAQI BIN AHAMAD


ID number : 52213219046
Group : L02

1. Use your own words to explain the role of Emulator within the Android environment, then
list two scenarios of when Emulator is not suitable to be used

-Emulator play the important role in android development phase because emulator allow
the developers to try and design the apps based on the imagination. They can use the
emulator to run the project.

- To test the functionality of calls and SMS.

- To test the color and contrast of the screen


(5 marks)
2. Explain five good mobile app properties that could improve user experience with a brief
description of each point.
1. Implement Native Elements into Your Mobile App
The reason why you have to implement native material in your apps is, the user
will know how to use the apps and will give good user experience.

2. Design your apps as simple as can


You don’t know what type of people will use your apps. If they are first time users,
and your apps is really hard to use, it will lead them away from their goal.

3. Get The App Design More Consistent


User will notice that there are using the same apps if the UI design is same and
consistent.

4. Develop a better search functionality into your app's


Users come to your app with the aim of accomplishing their target or locating and
purchasing your goods and/or services. If your app's navigation isn't good
enough, or if helpful links are difficult to locate, users are likely to switch to your
competitor's app.

5. Run the apps and find a way to improve it in all aspect


Remote user testing is the most effective way to do mobile usability. You’ll be
able to get feedback from remote users after they’ve used your products.

(5 Marks)
3. Describe five reasons for the importance of mobile application for businesses?
1. Be visible to customers at all times
Statistics show that the average peoples spend more than two hours a day on his
or her mobile device. So if your business have an apps, for sure it will attract the
users to use it

2. Create a direct marketing channel


You can inform anything and everything that you want about your company in
your apps.

3. Provide value to your customers


Instead of sticking to the old point-collection card, make it possible for your
customers to collect their rewards via your mobile app.

4. Build brand recognition


A mobile app is like a put your brand in shining light. You can do what you want
with it. But what you really want to do is create an app that has features your
customers will love, while at the same time is well branded and beautifully
designed.

5. Stand out from the competition


Small company that have their own apps is unusual thing. So, you can grab this
opportunity to be a step ahead from your competitors.

4.

You were assigned as the developer for XCalc, a new calculator app in the market.
Based on the above image, please complete the following tasks:
(a) Design the screen precisely as requested by the client.
(5 marks)
(b) Write the activation code of the following android application activity in order that
when a user presses the ADD button the sum of the two numbers in (txtnum1,
txtnum2) will appear in (txtviewresult). Also, the activity should accept floating-
point numbers. (Hint: to parse String to Float use “Float.parseFloat”)
(10 marks)

Please include both XML and Java codes in your submission.

END OF QUESTION SHEET


Cooding

Activity.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/an
droid"
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"
tools:context=".MainActivity">

<TextView
android:id="@+id/Number2"
android:layout_width="115dp"
android:layout_height="48dp"
android:text="Number2"

app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.057"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.417" />

<TextView
android:id="@+id/txtview6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:text="ADDITION"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<EditText
android:id="@+id/txtnum1"
android:layout_width="138dp"
android:layout_height="53dp"
android:ems="10"
android:inputType="number"

app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.934"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.286" />

<EditText
android:id="@+id/txtnum2"
android:layout_width="134dp"
android:layout_height="64dp"
android:ems="10"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.938"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.412" />

<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="addNumber"
android:text="ADD"

app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.049"
app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toTopOf="@+id/txtview6"
app:layout_constraintVertical_bias="0.573" />

<TextView
android:id="@+id/Number1"
android:layout_width="113dp"
android:layout_height="43dp"
android:text="Number1"

app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.063"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.296" />

<TextView
android:id="@+id/txtviewresult"
android:layout_width="125dp"
android:layout_height="44dp"

app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.944"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.57" />

<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
tools:layout_editor_absoluteY="78dp" />

</androidx.constraintlayout.widget.ConstraintLayout>
Main Activity. Java
package com.example.calculator;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import org.w3c.dom.Text;

public class MainActivity extends AppCompatActivity {


TextView txtviewresult;
EditText txtnum1,txtnum2;

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

txtviewresult = findViewById(R.id.txtviewresult);
txtnum1 = findViewById(R.id.txtnum1);
txtnum2 = findViewById(R.id.txtnum2);
}
public void addNumber (View v) {
double n1,n2,result;

n1 =
Double.parseDouble(txtnum1.getText().toString());
n2 =
Double.parseDouble(txtnum2.getText().toString());

result = n1 + n2;

txtviewresult.setText(String.valueOf(result));

Output:
SORRY SIR..

Saya tak dapat nak hantar file cooding dekat ecitie..so saya paste dalam ni..Dah zipp pon
tak dapat jugak

You might also like