I've been touching java for the first time in class. (Object-oriented? Interface? What is that ... ('ω') ... Yeah?) To be clear, I didn't understand at all. As I learn, I will post various questions and deliverables on my blog, so I would be grateful if you could point out.
OS:Microsoft Windows Windows10(64bit)
IDE:Android Studio
It's basically similar to C #!
It looks very similar because there are classes and methods. (~~ I wondered if it was the same thing to do just because the letters were different ~~)
However, the part that I personally felt that I did not know if it was similar here ** Interface **. An interface is one that you can easily create something to use later and then call it later with implement. I recognized it. If you make a mistake, please point it out! (´Д⊂ ヽ After that, I was wondering, on the android app side, I wanted to make a message box appear when I click the button. Is there a class or method that can display a message box in one line like ** MessageBox.show ** like C #? I thought (laughs)
*** I found this language to be the best way to learn object orientation *** It's been a day since I touched it, so I haven't understood anything yet, but it's a different way of thinking from C language. I felt that I could steadily gain strength. Another reason is that it is one of the mainstream programming languages in companies, so if you learn it, you will have a wider range of employment. I think it can be expanded.
I made a simple program by touching java, though only a little.
The program I created today
MainActivity.Java
package com.websarva.wings.i_raimu.helloandroid;
import android.content.Context;
import android.os.PowerManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
//Method executed at startup
protected void onCreate(Bundle savedInstanceState) {
//Call the onCreate method of the parent class
super.onCreate(savedInstanceState);
//Set layout information
setContentView(R.layout.activity_main);
//Button class instantiation
Button button = MainActivity.this.findViewById(R.id.button);
//Button event listener settings
button.setOnClickListener(new View.OnClickListener() {
@Override
//Event when the button is clicked
public void onClick(View view) {
Log.i("lightbox","The button was clicked");
}
});}
}
Recommended Posts