About 3 weeks ago, I first touched Android studio (Java) (in the position of a code writer). Since all the words I didn't understand, a memorandum of what I looked up (or an article on the net). (To make it easier for you to find it. Not bad ...)
AndroidManifest.xml A very important file. Reference: Notes on AndroidManifest.xml
Activity Controllers provided for smartphone development, such as Activity and ViewConroller, control the "screen".
For example, if there are two screens A and B as an application, in a general implementation,
Activity for screen A(A_Activity)➕ Layout file(A.xml)
Activity for B screen(B_Activity)➕ Layout file(B.xml)
It seems that
Reference: What is the basic “Activity” of Android application creation? (1/2)
Fragment
Fragment represents the behavior and parts of the Activity UI. Fragment must always be embedded in Activity. Therefore, Fragment is like a "sub-activity" that can be reused in Activity. Fragment has its own life cycle, but is directly influenced by the host Activity. Activities can add or remove Fragments.
Source: Fragment Basics
I'm sleepy, so I'll omit it.
Reference: [Java] What is a constructor? Meaning of this ()
context
[There are two types of context] ①Activity context (Usage: Activity name.this) Depends on the activity life cycle. When the basic activity is destroyed, it is destroyed together, but if a static variable refers to the context, the memory of the context is not released and there is a possibility of a memory leak. ② Application context (Usage: getApplicationContext ()) Application dependent. Stay alive as long as the application is alive. This is the context referenced by the static variables listed above.
Source: [Android] What is context?
findViewById One of the most frequently used methods of Android API
A style is a set of properties that specify the appearance and format of a View or window. Reference: Android Official
A class that manages resources. Reference: [Android Studio] "R. ~" in the java source all became an error
Reference: Providing resources Android Studio Document Japanese Translation
It is necessary to prepare files for each screen density (mdpi, hdpi, xhdpi).
Reference: Application Layout
Log.v: VERVOSE (all log information)
Log.d:DEBUG(Debug information)
Log.i:INFO(information)
Log.w:WARN(warning)
Log.e: ERROR (Fatal problem)
Source: How to output log in Android application development [for beginners]
Reference: Transition the screen of the [Android] application
extends Function inherited If you want to use it, write ```extends class name` ``.
Used when the value of a member variable can be stored and referenced only via a method. Member variables prefixed with "private" are Values can only be stored and retrieved within the class in which the member variables are defined. Therefore, it is possible to prevent creating an object in another class and storing the value directly in the member variable like "object name.member variable name = value".
public may or may not be written, but to make it easier to see the program later, to make it clear that you didn't forget to write "private" but wanted to make it "public" In addition, public should be written.
Quote: public and private
If you want to use it, write `private variable type member variable name;`
.
I can understand this area somehow. (Perhaps)
It seems to be important in the basics. Recognition that if it is static, it can be called without creating an instance. Is the meaning of iOS different from static? ?? ??
Reference: [Java] How to use inner class (inner class) (static class)
Density-independent pixels (dp) Per virtual pixel that should be used when defining the UI layout. Used to represent layout dimensions or positions in a density-independent way. Density-independent pixels are equivalent to one physical pixel on a 160 dpi screen. This is the assumed reference density for "medium" density screens. Scaling in dp units is transparently processed, if necessary, based on the actual density of the screen you are using. Converting from dp units to screen pixels is easy (px = dp * (dpi / 160)). For example, on a 240 dpi screen, 1 dp corresponds to 1.5 physical pixels. Whenever you define your app's UI, you should use dp units to ensure that your UI looks good on screens with different densities.
That's right. For beginners, it is recognized as a person who represents the size of an image.
Reference: The mysterious unit "dp" (Density-independent Pixel). Also, the story of drawable in Android Android Official
import Write like this
import android.net.ConnectivityManager;
When I copy and paste a method I picked up on the net, I get an error saying that ~ ~ cannot be imported. Androidstudio, kind.
Override
override. The superclass method is being rewritten in a subclass.
Reference: What is Java @Override
-[Basics for people who do not know the basics of smartphones (Android), such as the relationship between Activity (controller) and layout file (view)](http://hide1024.hatenablog.com/entry/2015/11/23/ 220025) -I thought about the Android package structure
In the first place, a package is a function to organize classes by something like a folder.
package jp.tuyano.myapp;
The above means ``` this class is prepared in the myapp folder in the tuyano folder in the jp folder. In the package, write the hierarchy using dots.
Quote: Super Introduction to Java for Android Development Beginners
build_file_checksums.ser The one that came out as a difference when I dropped the project from git. Is it okay to add it to gitignore? ??
Reference: Do I need to add [.ideit / cache / build_file_checksums.ser to .gitignore? ](https://translate.googleusercontent.com/translate_c?depth=1&hl=ja&prev=search&rurl=translate.google.co.jp&sl=en&sp=nmt4&u=https://stackoverflow.com/questions/49557737/should-i- add-idea-caches-build-file-checksums-ser-to-gitignore & xid = 17259,15700023,15700124,15700149,15700168,15700186,15700191,15700201,15700208 & usg = ALkJrhi4yP-JfmqQa6ldV3i_a5rzGqrR3g) Things not under version control in Android Studio
that's all.
Recommended Posts