studyjams-No. 03 Lesson _ Happy Birthday app+ Coffee Quiz

Source: Internet
Author: User

1. Start making my first Android APP

1.1 Opening Androidstudio

1.2 New Project

1.2.1 Fill in the relevant information of the project

1.2.1.1 fill in the project name
1.2.1.2 fill in the company domain name/personal domain name
1.2.1.3 fill in the app package name (by default automatically generated by domain name: +app name/project name. For example: The app is named "Happy Birthday" and the domain name is google.com, the default package name is Com.google.happybirthday)
Disk location where the 1.2.1.4 project resides
1.2.1 Select the Android device you want to develop

1.2.2.1 Android phones and tablets
1.2.2.1.1 chooses android4.0.3,api15 according to the recommendation.

1.2.2.2 Android Watch (may also include other wearable devices)
1.2.2.3 Android TV (TV box?) )
1.2.2.4 Google Smart Car? (later Baidu, said to be used for car and mobile phone information interaction)
1.2.2.5 Google Glasses (really great ah ~ But the project was canceled due to lack of application, high cost, information security issues, distracting user attention, etc.). As a result, there must be fewer developers developing the Google Eyewear app.
1.2.3 Select "Empty Activity" (the old version of Androidstudio in the video does not have this option, only "Blank Studio")

1.2.4 activity name, layout file name, temporarily do not modify, direct "Finish"

1.2.5 Loading ...

1.2.6 Project Default Display interface

1.3 Running the first project
1.3.1 Real Machine
1.3.1.1 Ready USB Cable +android Phone

1.3.1.2 USB Cable One end attached to the phone, one end attached to the PC
1.3.1.3 driver installation (feel plugged into the computer, will automatically install the driver ...) )
1.3.1.4 ensure that USB debugging is turned on
1.3.1.4.1 Open Developer mode (different phones open developer mode differently)
1.3.1.4.1.1 The Android native system is opened as the video says
1.3.1.4.1.2 Vivo x3t (step High) is opened by dialing the phone interface##7777 ##Go to developer mode (my friends and I are stunned)
1.3.1.4.1.3 Vivo x1st: Development->USB Debugging with application---general--
1.3.1.4.1.4 Nexus 6 P: Yes, this is the native Android system should be categorized as the first class. (I'm not going to say I'm here to show the phone.)
1.3.1.4.2 Open the developer options, turn on USB debugging
1.3.1.5 Click on "Android Monitor" to see your phone's model number and Android version, indicating that it is connected to the

1.3.1.6 Click the Run button

1.3.1.7 Choose your own phone, click OK (the default is to choose the first in the list, if you do not run the emulator, there is no other phone connection, direct click OK)

1.3.1.8 may be a bit time-consuming to run (although I've heard that the androidstudio of recent updates has greatly accelerated the compile rate), wait a moment to see it running successfully on your phone! (Yes, my screen is broken, do not care about these details)

1.3.2 Virtual Machines
1.3.2.1 creating a new virtual machine
1.3.2.1.1 point it, yes it is, the phone in the lower right corner to hide the Android small robot head button

1.3.2.1.2 Click on the "Create Virtual Device" button

1.3.2.1.3 Choose a phone (don't go to TV, watch or tablet ...), click Next
1.3.2.1.4 Select System image, there are three page cards: recommended system, x86 image, other mirrors. In fact, it is best to choose the latest, because backward-compatible, the latest can show the effective (TE) fruit (xiao) (very dark and bright add special effects, all chemical ingredients ~) There are hints that my computer CPU is too slag can not "accelerate the virtualization (Accelerated virtualization)", Probably a new feature of AndroidStudio2.0, regardless of ...

1.3.2.1.5 then is to fill in your virtual machine name, (note can not duplicate, is a false demo), modify the resolution and screen size, modify the Android version (if you choose Android version on the previous page is not satisfied, you can also change), and choose the default horizontal screen vertical screen what, Use the default bar, click Finish. Then wait for the load to complete.

1.3.2.1.6 OK, now see the created virtual machine appears in the list of virtual devices, click Run. (Note that the memory you assign to the virtual machine will not run if the computer has enough memory.) If the computer memory is too small, it is recommended to add a memory bar. Play Androidstudio, no 8G memory is not brought up at all)

1.3.2.1.7 First is the black screen, then appeared the Android Word, then on the light, unlocked, perfect!

1.3.2.1.8 Click the Run button, select the virtual machine, wait a moment to see HelloWorld running on the virtual machine.

1.4 Happy Birthday The specific writing process will not repeat. First show the run, below the direct show code.

1.5 Talk was cheap, show you My Code.
1.5.1 XML Layout file:

<?xml version= "1.0" encoding= "Utf-8"?><relativelayout xmlns:android="Http://schemas.android.com/apk/res/android" android:layout_width="Match_parent"android:layout_height="Match_parent" >            <imageview  android: Layout_width  = "match_parent"  android:layout_ Height  = "match_parent"  android:scaletype  = "Centercrop"  android:src  = "@mipmap/pic" />     <TextViewandroid:layout_width="Wrap_content"android:layout_height= "Wrap_content" android:fontfamily="sans-serif-condensed"android:text="Happy Birthday, taryn!" android:textsize="36sp" />                                            <TextView        Android:layout_width="Wrap_content"        Android:layout_height="Wrap_content"        Android:layout_alignparentbottom="true"        Android:layout_alignparentend="true"        Android:layout_alignparentright="true"        android:fontfamily="sans-serif-condensed"        Android:text="from relish"        Android:textcolor="#280000"        android:textsize="36SP"/></relativelayout>
2 Coffee Quiz

(StudyJams's video didn't give the answer, so I answered it with my understanding, the answer is for reference only)
2.1 If I want to show a picture on my phone, what XML element should I use? (What controls in XML do I use when I want to display a picture on my phone?)
For:

ImageView, ImageButton, Quickcontactbadge

In fact, all view has Android:background property, so can be used to display pictures, if you want to say ANDROID:SRC attribute, I remember only ImageView and ImageButton. (The Help document was later checked to see if such a class Android.widget.QuickContactBadge also had ANDROID:SRC properties, or ImageView subclasses)

2.2 ANDROID:LAYOUT_WIDTH,ANDROID:TEXT,ANDROID:SRC is all examples of what? (Which of these three properties belong to what control?) )
For:

No answer?

To tell you the truth, the question is a little bit clouded. The first thing to think about is ImageButton. I think ImageButton inherit Button,button have Android:text attribute ... After I hit a code in the Androidstudio, I found that ImageButton did not have the Text property. Then view the document (CTRL+Q) on the Android:src property, which says "sets a drawable as the content of this ImageView." Visible src is a unique attribute of Imagview. There is a word game here, because ImageView and Quickcontactbadge are Imagview subclasses, so they are all imageview. (Just like men and women are people). I think there is no answer. (Be afraid to say wrong, please correct the great God.) )
2.3 Write The sentence "I like practice sets the best" in CamelCase. (write this sentence into the big hump naming format)
For:

Ilikepracticesetsthebest.

2.4 Relativelayout and LinearLayout is known as what? (What are the relative and linear layouts?) "Probably asking what their public parents are like")
For:

ViewGroup.

Actually answer view also can, after all, view is ViewGroup's parent class, ViewGroup is a kind of view. (play word games again ...) Escape ~)
2.5 I always need to _ and __ my tags. (I always need to do those two things with my labels?) )
For:

Turn tabs on and off.

Originally wanted to answer the definition width (android:layout_width) and height (android:layout_height). I thought of it later. And the problem is not said to be the View Control label, as well as the selector selector, as well as androidmanifest, as well as the front-end time to hear the vector diagram vectordrawable (by the way, to see the contents of the Android:pathdata tag, My whole person is crazy) and so on. So still Open, close the label more reliable.
2.6 What is the names of the instructors? (What are the names of the two mentors?) )
For:

Katherine Kuan & Kunal Chawla.

Ask the name of the instructor in the previous two tutorial videos. I really don't remember. Open the first episode of video in 00:06 seconds and you can see it.
2.7 which line have an XML error on it? (which row has an XML error?)
For:

21 lines.

The attribute value of the android:weight tag requires double quotation marks.
2.8 What's the width of the TextView? (what's the width of the text box?)
For:

350DP.

Since its father's width is 350DP and its own width is match_parent (matching the parent layout), its width is also 350dp.
2.9 Here's some code with the attributes missing inside of the button tag. The "This" button is positioned here on the phone screen. (There are two properties in the label of the button missing, fill it up, make the button appear here on the phone screen)
For:

android:layout_alignParentBottom="true//底部与父布局底部对齐android:layout_centerHorizontal="true"//水平居中

2.10 Assume you is using the-the XML to the left and you have a-screen that has a-dp tall. What is the height of the Chaitea text view? (If you use the XML file on the left.) You have a 600DP high screen. So what's the height of chai tea text box? )
For:

100DP.

(600-200)/(2+1+1) * = 100DP.

(No nonsense, trapped dead.) )

studyjams-No. 03 Lesson _ Happy Birthday app+ Coffee Quiz

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.