All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
business
implementing programming languages
Questions and Answers of
Implementing Programming Languages
=+What is Android?
=+➤ Android versions and its feature set
=+➤ The Android architecture
=+➤ The various Android devices on the market
=+➤ The Android Market application store
=+➤ How to obtain the tools and SDK for developing Android applications
=+➤ How to develop your first Android application
=+1. What is an AVD?
=+2. Why was Jelly Bean selected for you by default in the Targeted Android Devices dialog?
=+3. What does SDK stand for?
=+4. What tool is used to download new Android SDKs?
=+➤ How to move around in the Integrated Development Environment(IDE)
=+➤ How to use code completion to make writing applications easier
=+➤ How to use breakpoints to debug your applications
=+1. When you are creating a new Android project, for what is the Company Domain field used?
=+2. For what is the Add an Activity to Mobile screen used?
=+3. What is Android Code Completion?
=+4. What is a breakpoint?
=+1. Using Eclipse, create a new Android project and name it PassingData.
=+2. Add the bolded statements in the following code to the activity_main.xml file. Be sure to change all instances of "com.jfdimarzio" to whatever package name your project is using.
=+3. Add a new XML file to the res/layout folder and name it activity_second.xml. Populate it as follows:
=+
=+4. Add a new Class file to the package and name it SecondActivity. Populate the SecondActivity.java file as follows:package com.jfdimarzio.passingdata;import android.app.Activity;import
=+ @Override public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_second);//---get the data passed in using
=+ public void onClick(View view) {//---use an Intent object to return data---Intent i = new Intent();//---use the putExtra() method to return some// value---i.putExtra("age3", 45);//---use the
=+5. Add the bolded statements from the following code to the AndroidManifest.xml file:
=+6. Add the bolded statements from the following code to the MainActivity.java file:package com.jfdimarzio.passingdata;import android.content.Intent;import android.Activity;import
=+ public void onClick(View view) {Intent i = new Intent("com.jfdimarzio.passingdata.SecondActivity");//---use putExtra() to add new name/value pairs---i.putExtra("str1", "This is a
=+public void onActivityResult(int requestCode, int resultCode, Intent data)//---check if the request code is 1---if (requestCode == 1) {//---if the result is OK---if (resultCode == RESULT_OK)
=+7. Press Shift+F9 to debug the application on the Android emulator. Click the button on each activity and observe the values displayed.How It Works
=+While this application is not visually exciting, it does illustrate some important ways to pass data between activities.First, you can use the putExtra() method of an Intent object to add a
=+The preceding statements add two name/value pairs to the Intent object: one of type string and one of type integer.Besides using the putExtra() method, you can also create a Bundle object and then
=+To obtain the data sent using the Intent object, you first obtain the Intent object using the getIntent() method. Then, call its getStringExtra() method to get the string value set using the
=+In this case, you have to call the appropriate method to extract the name/value pair based on the type of data set. For the integer value, use the getIntExtra() method (the second argument is the
=+To get the individual name/value pairs, use the appropriate method. For the string value, use the getString() method://---get the data using the getString()---Toast.makeText(this,
=+Another way to pass data to an activity is to use the setData() method (as used in the previous section), like this://---use the setData() method to return some
=+Usually, you use the setData() method to set the data on which an Intent object is going to operate, such as passing a URL to an Intent object so that it can invoke a web browser to view a web
=+1. Using Android Studio, create a new Android project and name it Fragments.
=+2. In the res/layout folder, add a new layout resource file and name it fragment1.xml. Populate it with the following code. Be sure to change all instances of "com.jfdimarzio" to whatever package
=+3. Also in the res/layout folder, add another new layout resource file and name it fragment2.xml.Populate it as follows:
=+4. In activity_main.xml, add the bolded lines in the following code:
=+5. Under the /fragments package name, add two Java class files and name them Fragment1.java and Fragment2.java.
=+6. Add the following code to Fragment1.java:package com.jfdimarzio.fragments;import android.app.Fragment;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import
=+7. Add the following code to Fragment2.java:package com.jfdimarzio.fragments;import android.app.Fragment;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import
=+8. Press Shift+F9 to debug the application on the Android emulator. Figure 3-16 shows the two fragments contained within the activity.
=+1. To create an activity, you create a Java class that extends what base class?
=+2. What attribute of the Application element is used to specify the theme?
=+3. What method do you override when displaying a dialog?
=+4. What is used to navigate between activities?
=+5. What method should you use if you plan on receiving information back from an activity?
=+➤ How ViewGroups and Layouts can be used to lay out your views and organize your application screen
=+➤ How to adapt and manage changes in screen orientation
=+➤ How to create the UI programmatically
=+➤ How to listen for UI notifications
=+1. Create a new layout resource file named linearlayouts_example.xml. By default, this new file will be created with a LinearLayout (Vertical).
=+2. Place three stacked TextViews in a single column within the LinearLayout.
=+3. Place a LinearLayout (Horizontal) under the third TextView.
=+4. Place three buttons in a row within the LinearLayout (Horizontal).
=+1. What is the difference between the dp unit and the px unit? Which one should you use to specify the dimension of a view?
=+2. Why is the AbsoluteLayout not recommended for use?
=+3. What is the difference between the onPause()method and the onSaveInstanceState()method?
=+4. Name the three methods you can override to save an activity’s state. In what instances should you use the various methods?
=+5. How do you add action items to the Action Bar?
=+➤ How to use the basic views in Android to design your user interface
=+➤ How to use the picker views to display lists of items
=+➤ How to use the list views to display lists of items
=+➤ How to use specialized fragments
=+1. How do you programmatically determine whether a RadioButton is checked?
=+2. How do you access the string resource stored in the strings.xml file?
=+3. Write the code snippet to obtain the current date.
=+4. Name the three specialized fragments you can use in your Android application and describe their uses.
=+➤ How to use the ImageSwitcher, GridView, and ImageView views to display images
=+➤ How to display options menus and context menus
=+➤ How to display web content using the WebView view
=+1. What is the purpose of the ImageSwitcher?
=+2. Name the two methods you need to override when implementing an options menu in your activity.
=+3. Name the two methods you need to override when implementing a context menu in your activity?
=+➤ How to save simple data using the SharedPreferences object
=+➤ How to enable users to modify preferences using a PreferenceActivity class
=+➤ How to write and read files in internal and external storage
=+➤ How to create and use a SQLite database
=+➤ What content providers are
=+➤ How to use a content provider in Android
=+➤ How to create and use your own content provider
=+1. How do you display the preferences of your application using an activity?
=+2. Name the method that enables you to obtain the external storage path for an Android device.
=+3. What method is called when a database needs to be upgraded?
=+➤ How to send SMS messages programmatically from within your application
=+➤ How to send SMS messages using the built-in Messaging application
=+➤ How to receive incoming SMS messages
=+➤ How to send email messages from your application
=+1. Write the query to retrieve all contacts from the Contacts application that contain the word “jack.”
=+2. Name the methods that you need to override in your own implementation of a content provider.
=+3. How do you register a content provider in your AndroidManifest.xml file?
=+1. Name the two ways in which you can send SMS messages in your Android application.
=+2. Name the permissions you need to declare in your AndroidManifest.xml file for sending and receiving SMS messages.
=+3. How do you notify an activity from a BroadcastReceiver?
=+➤ How to connect to the web using HTTP
=+➤ How to consume XML web services
=+➤ How to consume JSON web services
Showing 1 - 100
of 447
1
2
3
4
5