Search the whole station

java编程考试代做 COMP S311代写 Java代写 Java考试助攻

COMP S311 Online Exam

Time Allowed: 3 hours

java编程考试代做 Instructions – Answer ALL questions in Part I. [60%] – Answer no more than FOUR (4) questions in Part II. [40%] – The total mark is worth 100

Instructions

– Answer ALL questions in Part I. [60%]

– Answer no more than FOUR (4) questions in Part II. [40%]

– The total mark is worth 100 marks.

– Accept minor syntax errors.

– No need to include import statements.

– No need to handle exception except the questions are on exception or used as part of the program logic.

– All the answers of the required questions, including all the programs, should be completed in the attached document. Answer not recorded in the document will NOT be marked.

– Put your name and student number on the document.

Regulation

– Open book examination rules are applied. You are only allowed to use the Internet to access relevant course material on the OLE and the Android/Java API. You will be disqualified if you access to any shared drives or social networking websites.

– You should answer the questions of the examination with your own words. According to the OUHK regulation, cheating is prohibited, includes but is not limited to “aiding or attempting to aid another candidate, or obtaining or attempting to obtain aid from another candidate”.

– Your submitted answer may be checked for plagiarism by the university system. Zero mark may be given for those who show evidence of plagiarism.

Appendices are attached at the end of the paper, which contains some useful Java and Android APIs.

Part I [60 marks] java编程考试代做

You should attempt ALL questions in this part of the paper. This part carries 60% of the total examination marks.

Question 1 [5 marks]

State whether each of the following statements is true or false:

(a) An exception handler cannot consist of more than one catch block.

(b) UDP programming is more tedious than TCP programming.

(c) Object “request” of type HttpServletRequest should be declared explicitly in a JSP for getting information, such as parameter(s), from client.

(d) Android applications developed for API level 28 can also be executed by Android mobile devices with API level 23.

(e) Toast used in Android application cannot receive any user interaction events.

Question 2 [4 marks]

Complete the following code to obtain all letters (i.e., ‘A’ to ‘Z’) in the words, converted to uppercase, arranged in order, and without duplication.

String[] words = "The Open University of Hong Kong".split(" ");
List<String> result = Stream.of(words)
       .flatMap(w -> Stream.of(w.split("")))___// Add code here___;
System.out.println(result);
       // [E, F, G, H, I, K, N, O, P, R, S, T, U, V, Y]

Question 3 [8 marks]

Complete the following program that counts the total number of words that have more than 8 characters in specified file(s). This total is an estimate of the words that the length is larger than 8.

public class WordCount {
static long wordCount(Path path) {
// Add code here for part (a)
}

static long total = 0;

public static void main(String[] args) {
if (args.length < 2) {
System.out.printf("Usage: java %s numThreads file1 file2 ...\n", WordCount.class.getName());
return;
}

var numThreads = Integer.parseInt(args[0]);
var startTime = System.currentTimeMillis();

// Add code here for part (b)

executor.shutdown();
try {
executor.awaitTermination(300, TimeUnit.SECONDS);
} catch (InterruptedException ex) {
}
var duration = System.currentTimeMillis() - startTime;
System.out.println("Total number of words that have more than 8 characters: " + total);
System.out.println("Execution time: " + duration + " ms");
}
}

(a) In the wordCount method, add code to count and return the number of word that have more than 8 characters in the file of the path parameter.

(b) In the main method, add code to create a thread pool with the specified number of threads, and use it to concurrently find and accumulate the word counts of the files to the total variable.

Question 4 [6 marks] java编程考试代做

(a) Give an API class name, including package, for implementing a UDP client program.

(b) When loading a JDBC driver, saving a copy of the JDBC driver file on the computer is not enough. State one approach to specify the location of the driver file so that it can be found by the Java program.

(c) A JSP has an int variable called count. Write a JSP expression that outputs the count variable.

Question 5 [5 marks]

(a) Consider the enforcement of this security policy file in a program.

grant
{
permission java.io.FilePermission "C:${/}temp${/}*", "read";
};

State whether each of the following operations is permitted.

(i) new File(“C:\\file.txt”).exists()

(ii) new File(“C:\\temp\\file.txt”).exists()

(iii) new File(“C:\\temp\\ “).list()

(iv) new File(“C:\\temp\\file.txt”).list()

(b) Can the message digest alone be used to protect the integrity of messages? Explain your answer in no more than 60 words.

Question 6 [9 marks]

(a) Given the distribution of Android devices in use:

java编程考试代做
java编程考试代做

Which version has the largest share of the distribution? If you wish to target for 85% or more of Android devices, which API level should you use and what is the corresponding distribution?

(b) Describe two advantages of sandbox model of Android in no more than 100 words.

Question 7 [10 marks]

(a) Briefly describe the “onProgressUpdate” method of the “AsyncTask” class used in Android application development. Give one scenario for applying the “onProgressUpdate” method.

(b) In the listing below, the “run()” method of the Runnable class “RunnableTask” is defined to perform selection sort on an array. After the array is sorted, the Button object “button” will be enabled and the contents of sorted array will be posted on TextView object “result”.

public class MainActivity extends Activity {
private Button button;
private TextView result;
private int [] array = {40, 88, 25, 68, 80, 75, 300, 27, 257, 101};

button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

Runnable task = new RunnableTask();
Thread thread = new Thread(task);
thread.start();
}
});

/** Selection sort. */
public int [] selectionSort(int[] array) {
int [] resultArray = new int[array.length];
int n = array.length;

System.arraycopy(array, 0, resultArray, 0, array.length);
int first, temp = 0;
for (int i = n - 1; i > 0; i--) {
first = 0; // Initialize to subscript of first element
for(int j = 1; j <= i; j++) { // Locate largest element
between positions 1 and i.
if( resultArray[j] > resultArray[first] )
first = j;
}
temp = resultArray[ first ]; // Swap largest found with
element in position i.
resultArray[first] = resultArray[i];
resultArray[i] = temp;
}
return resultArray;
}

// Sort an array by using thread
private class RunnableTask implements Runnable {
String resultText = "";
int [] resultArray;

@Override
public void run() {
// Sort the array
resultArray = selectionSort(array);

// Update UI after the array has been sorted
button.setEnabled(true);
for (int i=0; i<resultArray.length-1; i++)
resultText += resultArray[i] + ", ";
resultText += resultArray[resultArray.length-1];
result.setText(resultText);
}
}
}

According to the rule of single thread model, UI component cannot be accessed outside from the UI thread. Modify the above program to solve this problem by using the “post(Runnable)” method of the “Handler” class.

Question 8 [3 marks]

Using an array is more efficient than using the collection classes of ArrayList and Vector in general due to the overhead of element management.

(a) State the optimization technique used when determining which component should be applied.  

(b) Suggest a scenario when ArrayList or Vector can be used instead of an array.

Question 9 [10 marks]

(a) Give an API class name, including package, for each of the three animation types.

(i) Drawable animation

(ii) Property animation

(iii) View animation

(b) In no more than 200 words, describes and illustrates with diagram about what you would see when the Android application program “MainActivity” is started and the View object is clicked.

Listing below depicts the layout resource file “activity_main.xml”

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="@drawable/h" />
</RelativeLayout>

Listing below depicts the animation resource file “animation.xml”

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<alpha
android:fromAlpha="0"
android:toAlpha="1"
android:duration="8000"
android:repeatMode="reverse"
android:repeatCount="1" />

<translate
android:duration="8000"
android:toYDelta="100%"
android:repeatMode="reverse"
android:repeatCount="1" />
</set>

Listing below depicts the activity class “MainActivity.java”

public class MainActivity extends Activity {
ImageView imageView;

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

imageView = (ImageView) findViewById(R.id.imageView);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imageAnimation(imageView);
}
});
}
/** Performs animation on a View object. */
private void imageAnimation(ImageView ImageView) {
Animation animation =
AnimationUtils.loadAnimation(this, R.anim.animation);
imageView.startAnimation(animation);
}
}

Part II [40 marks] java编程考试代做

Answer no more than FOUR (4) questions from this part ofthe paper. Each question is worth 10 marks. This part carries 40% of the total examination marks.

Question 10 [10 marks]

Write a multithreaded Java TCP server to count the total number of integers that are multiple of 10. The communication between the client and server is described as follows.

– The server listens to requests at port 8899.

– When a client request arrives at the port, a new thread is created to serve it.

– Upon connection, the client sends one or more integers (each in a line of string) to the server.

– When an integer is received from the client, the server first adds 1 to a counter value (of type int) corresponding to the total number of received integers.

– Secondly, the server evaluates if the received value is a multiple of 10. If so, it will add 1 to another counter value (of type int) corresponding to the total number of multiple of 10.

– After all the integers have been read from the client, the server first returns the total number of integers received (in a line of string) to the client.

– Then, the total number of multiple of 10 is also sent to the client (in a line of string).

– The client finally disconnects from the server by closing the socket at the client side.

You only need to implement the server, not the client.

[Hint: You can assume that all users behave normally and do not need to handle exceptional cases.]

Question 11 [10 marks]

In this question, you develop a JSP to display the student records of a particular course. The information is stored in a database table, called Study, with three columns.

– A StudentID column, of type CHAR(10), contains the student id.

– A CourseCode column, of type CHAR(10), contains the course code.

– A Grade column, of type CHAR(2), contains the grade.

java编程考试代做
java编程考试代做

A skeleton of the JSP is given below. It contains the database connection information.

Complete the JSP.

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Course Records</title>
  </head>
  <body>

    <%@page import="java.sql.*" %>
    <%
       String driver = "org.apache.derby.jdbc.ClientDriver";
       Class.forName(driver);
       String dbUrl = "jdbc:derby://localhost:1527/COREJAVA;create=true";
       String dbUsername = "cdbuser";
       String dbPassword = "pw";
    %>

    // Add code here

  </body>
</html>

Question 12 [10 marks]

(a) Develop a program that generates a key object of the SecretKeySpec class, which is created from the bytes of the secret key value and the key algorithm name RawBytes.

The MAC key generation program works like this:

> java GenMacKey ASSIGNMENT outputKey

The first input argument to the program, e.g., “ASSIGNMENT”, represents the secrete key value of type String that should be used in the key generation. The generated key, as a SecretKeySpec object, is saved in the outputKey file using the ObjectOutputStream class.

(b) Develop a program to generate MAC that works like this:

> java GenMac HmacSHA256 keyFile inputFile outputFile

The first input argument to the program represents the desired algorithm used. The keyFile file contains a secrete key for initializing the Mac object. The inputFile file contains the input of which the MAC is computed. The MAC value is stored at the outputFile file using the FileOutputStream class.

Question 13 [10 marks] java编程考试代做

In this question, you work on an Android app that converts between units of temperature, between Celsius (°C) and Fahrenheit (°F).

Listing below depicts the layout resource file “activity_main.xml”.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Convert to: " />

<RadioGroup
android:id="@+id/radiogroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">

<RadioButton
android:id="@+id/celsius"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Celsius" />
<RadioButton
android:id="@+id/fahrenheit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fahrenheit" />
</RadioGroup>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Input temperature: " />

<EditText
android:id="@+id/input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Input temperature here" />
</LinearLayout>

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

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Converted temperature: " />

<TextView
android:id="@+id/result"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

</LinearLayout>

(a) Illustrate with diagram about what you would see when the Android application that loads the layout file “activity_main.xml” is started.

(b) Listing below depicts part of the activity class “MainActivity.java”.

public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// Add code here

// Convert to Celsius
public static double convertFahrenheitToCelsius(double fahrenheit) {
return ((fahrenheit - 32) * 5 / 9);
}

// Convert to Fahrenheit
public static double convertCelsiusToFahrenheit(double celsius) {
return ((celsius * 9) / 5) + 32;
}
}

Complete it by doing the following tasks.

(i) Find the views of one radio button, one button, one edit-text and one text-view, and keep them in variables.

(ii) Set up the convertbutton button to perform the temperature conversion: obtain the temperature value in the input field, calculate the result, and display the result in the result field up-to 2 decimal places.

Note:

– The conversion from Celsius to Fahrenheit or from Fahrenheit to Celsius can be determined by evaluating if the celsius radio button is selected with the isChecked method.

– The conversion from Celsius to Fahrenheit and from Fahrenheit to Celsius can be achieved by using the provided static methods convertCelsiusToFahrenheit and convertFahrenheitToCelsius respectively.

– You are not required to handle invalid input, or format the output values.

Question 14 [10 marks] java编程考试代做

The preference framework in Android provides a flexible and convenient mechanism for manipulating shared preferences. The following figure sketches an example screen associated with the game “Puzzle Bobble”.

“Puzzle Bobble” is a classic shooting puzzle arcade game in which the player controls the direction of the bubble shooter and shoot out a bubble in order to make a combination of three or more bubbles of the same color for eliminating them.

Listing below depicts part of the string resource file “string.xml”.


<!-- Game Puzzle Bobble -->
<!-- Key and default value of preference item game mode -->
<string name="bobble_game_mode_key">bobble_game_mode</string>
<string name="bobble_game_mode_default">Practice</string>

<!-- String array format -->
<string-array name="bobble_game_mode">
<item>Practice</item>
<item>Arcade</item>
</string-array>

<!-- Key and default value of preference item show path -->
<string name="show_path_key">show_path</string>
<bool name="show_path_default">true</bool>

Listing below depicts the preference screen layout resource file “game_prefs.xml”.

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory
android:title="Game setting">

<ListPreference
android:key="@string/bobble_game_mode_key"
android:title="Game Mode"
android:summary="Playing mode of the game"
android:entries="@array/bobble_game_mode"
android:entryValues="@array/bobble_game_mode"
android:defaultValue="@string/bobble_game_mode_default" />

<CheckBoxPreference
android:key="@string/show_path_key"
android:title="Display path of shooting"
android:summary="Whether to show the path of the bubble going to be shot"
android:defaultValue="@bool/show_path_default" />
</PreferenceCategory>
</PreferenceScreen>

(a) Illustrates with diagrams about what you would see when the preference screen defined in the layout resource file “game_prefs.xml” is shown. Also sketches with diagram if preference component such as CheckBoxPreference, EditTextPreference, ListPreference, or MultiSelectListPreference is declared and selected.

(b) Write Java code to first obtain a “SharedPreferences” object by using the “getDefaultSharedPreferences” method, then to get the two shared preferences values by using the keys “bobble_game_mode_key” and “show_path_key” respectively.

(c) Providing animation effect, sound effect and background music, or different game modes suggested in part (a) are different ways to arouse player interest. Suggest and describe one game option which can be applied in the “Puzzle Bobble” game for increasing the game playability. Recommend the corresponding preference component employed.

Please check that you have written your student name and student number on the answer book file. Failure to do so will mean that your work cannot be identified.

Please note that some classes, methods, attributes, variables, constants are omitted if they are not relevant.

Appendix A: Selected Java APIs java编程考试代做

java.lang.Math

public static double random()

  – Returns a double value with a positive sign, greater than or equal to 0.0 andless than 1.0. Returned values are chosen pseudorandomly with (approximately) uniform distribution from that range.

java.net.ServerSocket

public ServerSocket(int port) throws IOException

  – Creates a server socket, bound to the specified port.

public Socket accept() throws IOException

  – Listens for a connection to be made to this socket and accepts it.

java.net.Socket

public InputStream getInputStream() throws IOException

  – Returns an input stream for this socket.

public OutputStream getOutputStream() throws IOException

  – Returns an output stream for this socket.

java.security.Signature

public static Signature getInstance(String algorithm) throws NoSuchAlgorithmException

  – Generates a Signature object that implements the specified digest algorithm. If the default provider package provides an implementation of the requested digest algorithm, an instance of Signature containing that implementation is returned. If the algorithm is not available in the default package, other packages are searched.

public final void initSign(PrivateKey privateKey) throws InvalidKeyException

  – Initialize this object for signing. If this method is called again with a differentargument, it negates the effect of this call.

public final void initVerify(PubicKey publicKey) throws InvalidKeyException

  – Initializes this object for verification. If this method is called again with a different argument, it negates the effect of this call.

public final byte[] sign() throws SignatureException

  – Returns the signature bytes of all the data updated. The format of the signature depends on the underlying signature scheme.

public final void update(byte[] data) throws SignatureException

  – Updates the data to be signed or verified, using the specified array of bytes.

public final boolean verify(byte[] signature) throws SignatureException

  – Verifies the passed-in signature.

java.security.MessageDigest java编程考试代做

public static MessageDigest getInstance(String algorithm) throws

NoSuchAlgorithmException

  – Returns a MessageDigest object that implements the specified digest algorithm. public void update(byte[] input, int offset, int len)

  – Updates the digest using the specified array of bytes, starting at the specified offset.

public byte[] digest()

  – Completes the hash computation by performing final operations such as padding. The digest is reset after this call is made.

java.sql.Connection

PreparedStatement prepareStatement(String sql) throws SQLException

  – Creates a PreparedStatement object for sending parameterized SQL statements to the database.

java.sql.PreparedStatement

ResultSet exectueQuery() throws SQLException

  – Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

void setString(int parameterIndex, String x) throws SQLException

  – Sets the designated parameter to the given Java String value. The driver converts this to an SQL VARCHAR or LONGVARCHAR value (depending on the argument’s size relative to the driver’s limits on VARCHAR values) when it sends it to the database.

java.sql.ResultSet

double getDouble(int columnIndex) throws SQLException

  – Retrieves the value of the designated column in the current row of this ResultSet object as a double in the Java programming language.

String getString(int columnIndex) throws SQLException

  – Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.

javax.crypto.Cipher java编程考试代做

public final byte[] doFinal() throws IllegalBlockSizeException, BadPaddingException

  – Finishes a multiple-part encryption or decryption operation, depending on howthis cipher was initialized.

public final byte[] doFinal(byte[] input) throws IllegalBlockSizeException,

BadPaddingException

  – Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized.

public static final Cipher getInstance(String transformation) throws

NoSuchAlgorithmException, NoSuchPaddingException

  – Generates a Cipher object that implements the specified transformation.

public final void init(int opmode, Key key) throws InvalidKeyException

  – The cipher is initialized for one of the following four operations: encryption, decryption, key wrapping or key unwrapping, depending on the value of opmode.

public final byte[] update(byte[] input, int inputOffset, int inputLen) throws

IllegalStateException

  – Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.

javax.crypto.CipherInputStream java编程考试代做

public CipherInputStream(InputStream is, Cipher c)

  – Constructs a CipherInputStream from an InputStream and a Cipher.

public int read() throws IOException

  – Reads the next byte of data from this input stream.

public int read(byte[] b) throws IOException

  – Reads up to b.length bytes of data from this input stream into an array of bytes.

public int read(byte[] b) throws IOException

  – Reads up to b.length bytes of data from this input stream into an array of bytes.

javax.crypto.CipherOutputStream

public CipherOutputStream(OutputStream os, Cipher c)

  – Constructs a CipherOutputStream from an OutputStream and a Cipher.

public void write(byte[] b) throws IOException

  – Writes b.length bytes from the specified byte array to this output stream.

public void write(byte[] b, int off, int len) throws IOException

  – Writes len bytes from the specified byte array starting at offset off to this output stream.

public void write(int b) throws IOException

  – Writes the specified byte to this output stream.

javax.crypto.Mac

public final byte[] doFinal() throws IllegalStateException

  – Processes the given array of bytes and finishes the MAC operation.

public static final Mac getInstance(String algorithm) throws NoSuchAlgorithmException

  – Returns a Mac object that implements the specified MAC algorithm.

public final void update(byte[] input, int offset, int len) throws

IllegalStateException

  – Processes the first len bytes in input, starting at offset inclusive.

Appendix B: JSP APIs

request – JSP implicit object, of class javax.servlet.ServletRequest

public abstract String getParameter(String name)

  – Returns the value of a request parameter as a String, or null if the parameter does not exist.

out – JSP implicit object, of class javax.servlet.jsp.JspWriter

public abstract void print(Object obj) throws IOException

  – Print an object.

public abstract void print(String s) throws IOException

  – Print a string.

Appendix C: Android APIs java编程考试代做

android.app.Activity

public <T extends android.view.View> T findViewById(int id)

  – Finds a view that was identified by the android:id XML attribute that was processedin onCreate.

public void setContentView(int layoutResID)

  – Set the activity content from a layout resource.

android.app.Fragment

public void onCreate(Bundle savedInstanceState)

  – Called to do initial creation of a fragment.

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

  – Called to have the fragment instantiate its user interface view.

android.app.IntentService

public IntentService(String name)

  – Creates an IntentService.

protected void onHandleIntent(Intent intent)

  – This method is invoked on the worker thread with a request to process.

android.content.BroadcastReceiver

public void onReceive(Context context, Intent intent)

  – This method is called when the BroadcastReceiver is receiving an Intent broadcast.

android.content.Context

public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter)

  – Register a BroadcastReceiver to be run in the main activity thread.

public void sendBroadcast(Intent intent)

  – Broadcast the given intent to all interested BroadcastReceivers.

public android.content.ComponentName startService(Intent service)

  – Request that a given application service be started.

public void unregisterReceiver(BroadcastReceiver receiver)

  – Unregister a previously registered BroadcastReceiver.

android.content.Intent java编程考试代做

public Intent(Context packageContext, Class<?> cls)

  – Create an intent for a specific component.

public Intent(String action)

  – Create an intent with a given action.

android.content.IntentFilter

public IntentFilter()

  – New empty IntentFilter.

public IntentFilter(String action)

  – New IntentFilter that matches a single action with no data.

public final void addAction(String action)

  – Add a new Intent action to match against.

android.view.LayoutInflater

public View inflate(int resource, ViewGroup root)

  – Inflate a new view hierarchy from the specified xml resource.

public View inflate(int resource, ViewGroup root, boolean attachToRoot)

  – Inflate a new view hierarchy from the specified xml resource.

android.view.View

public void setOnClickListener(View.OnClickListener l)

  – Register a callback to be invoked when this view is clicked. If this view is not clickable, it becomes clickable.

android.view.widget.TextView

public CharSequence getText()

  – Return the text that TextView is displaying.

public final void setText(CharSequence text)

  – Sets the text to be displayed.

java编程考试代做
java编程考试代做

更多代写:AI/MachineLearning代写  gmat代考被抓  英国Astrophysics代写  心理学论文英文  主题句组织技巧  国外大学论文格式

合作平台:essay代写 论文代写 写手招聘 英国留学生代写

The prev: The next:

Related recommendations

1
您有新消息,点击联系!