Choose Empty Activity.

Enter a project name.

Choose activity_main.xml.

Add a button.

Delete TextView (Hello World) by pressing Delete key

Add android:onClick attribute inside <Button> tag

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"
        android:onClick="onButtonClicked"
        tools:layout_editor_absoluteX="158dp"
        tools:layout_editor_absoluteY="316dp"
        tools:ignore="MissingConstraints" />

</androidx.constraintlayout.widget.ConstraintLayout>

Let's make a message appear when a button is pressed.

You need to link the button you added in activity_main.xml to MainActivity.java.

package com.jw.messageexample;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

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

    }

    public void onButtonClicked(View view){
        Toast.makeText(this,"Button clicked",Toast.LENGTH_LONG).show();

    }
}

That way, the click event from the button can be handled in the Java source.

Toast serves as a small, brief display of messages.

Press Alt + Enter to resolve import errors.

Run app

When you press the button, you can see that the message appears and disappears at the bottom of the screen.

 

 

 

 

 

package com.jwlee.quiz_budongsan;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class DatabaseHelper extends SQLiteOpenHelper {

public static final String DATABASE_NAME = "STUDENT.db"; // 데이터베이스 명
public static final String TABLE_NAME = "student_table"; // 테이블 명


// 테이블 항목
public static final String COL_1 = "ID";
public static final String COL_2 = "Name";
public static final String COL_3 = "Correct_Rate";



public DatabaseHelper(@Nullable Context context) {
super(context, DATABASE_NAME, null, 3);
}

@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table " + TABLE_NAME + "(ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT, CORRECT_RATE TEXT)");
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS "+ TABLE_NAME);
onCreate(db);

}

// 데이터베이스 추가하기 insert

public boolean insertData(String name, String correct_Rate){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COL_2,name);
contentValues.put(COL_3,correct_Rate);

long result = db.insert(TABLE_NAME, null,contentValues);
if(result == -1)
return false;
else
return true;

}

//데이터베이스 항목 모두 읽어오기 Read
public Cursor getAllData(){
SQLiteDatabase db = this.getWritableDatabase();
Cursor res = db.rawQuery("select * from "+TABLE_NAME,null);
return res;
}

//데이터베이스 선택한항목만 읽어오기 Read
public Cursor getSelectData(String select_name){
SQLiteDatabase db = this.getWritableDatabase();
Cursor res = db.rawQuery("select * from "+TABLE_NAME + " where name = " + "\""+ select_name+ "\"",null);//select * from student_table where name = "민법"
return res;
}

// 데이터베이스 삭제하기
public Integer deleteData(String id){
SQLiteDatabase db = this.getWritableDatabase();
return db.delete(TABLE_NAME, "ID = ? ",new String[]{id});
}

//데이터베이스 수정하기
public boolean updateData(String id, String name, String correct_Rate){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(COL_1,id);
contentValues.put(COL_2,name);
contentValues.put(COL_3,correct_Rate);

db.update(TABLE_NAME,contentValues,"ID = ?", new String[] { id });
return true;
}
}

[26회] 1. 공인중개사법령상 용어와 관련된 설명으로 옳은 것은?(다툼이 있으면 판례에 따름)

 

①법정지상권을 양도하는 행위를 알선하는 것은 중개에 해당한다.

②반복, 계속성이나 영업성 없이 단 1회 건물매매계약의 중개를 하고 보수를 받은 경우 중개를 업으로 한 것으로 본다.

③외국의 법에 따라 공인중개사 자격을 취득한 자도 공인중개사법에서 정의하는 공인중개사로 본다.

④소속공인중개사란 법인인 개업공인중개사에 소속된 공인중개사만을 말한다.

⑤중개보조원이란 공인중개사가 아닌 자로서 개업공인중개사에 소속되어 중개대상물에 대한 현장안내와 중개대상물의 확인ㆍ설명의무를 부담하는 자를 말한다.",

           

 

 

 

정답: 1

해설:

②단 1회는 중개업에 해당하지 않는다.

③외국의 법 X

④법인뿐 아니라 개인에 소속된 공인중개사도 소속공인중개사다.

⑤중개대상물의 확인ㆍ설명의무를 부담하는 자는 공인중개사만 할 수 있고 중개보조원은 단순업무를 보조한다.

 

play.google.com/store/apps/details?id=com.jwlee.quiz_budongsan

 

기출 공인중개사 - Google Play 앱

부동산 공인중개사 기출문제

play.google.com

            

[27회]1. 공인중개사법령상 용어와 관련된 설명으로 옳은 것을 모두 고른 것은?(다툼이 있으면 판례에 따름)

 

ㄱ. 개업공인중개사란 공인중개사법 의하여 중개사무소의 개설등록을 한 자이다.

ㄴ. 소속공인중개사에는 개업공인중개사인 법인의 사원 또는 임원으로서 중개업무를 수행하는 공인중개사인 자가 포함된다.

ㄷ. 공인중개사로서 개업공인중개사에 고용되어 그의 중개업무를 보조하는 자도 소속공인중개사이다. 

ㄹ. 우연한 기회에 단 1회 임대차계약의 중개를 하고 보수를 받은 사실만으로는 중개를 업으로 한 것이라고 볼 수 없다.

 

① ㄱ, ㄴ

② ㄱ, ㄷ

③ ㄱ, ㄴ, ㄹ

④ ㄴ, ㄷ, ㄹ

⑤ ㄱ, ㄴ, ㄷ, ㄹ

            

 

 

 

정답: 5

해설: 모두 맞다.

 

 

play.google.com/store/apps/details?id=com.jwlee.quiz_budongsan

 

기출 공인중개사 - Google Play 앱

부동산 공인중개사 기출문제

play.google.com

 

+ Recent posts