๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

์ „์ฒด ๊ธ€

(402)
Toolbar ๊ฒ€์ƒ‰๋ฒ„ํŠผ ๋งŒ๋“ค๊ธฐ Toolbar์•ˆ์— ๊ฒ€์ƒ‰๋ฒ„ํŠผ์„ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ๊ฒ€์ƒ‰๋ฒ„ํŠผ์„ ๊ตฌํ˜„ํ•˜๊ธฐ์ „์— ์•ก์…˜๋ฐ”๋ฅผ ์—†์• ๊ณ  toolbar๋ฅผ ๋งŒ๋“ค์–ด์ค˜์•ผํ•ฉ๋‹ˆ๋‹ค. activity_main.xml Toolbar๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด res/menu/search_menu.xml์„ ๋งŒ๋“ค์–ด์ฃผ๊ณ  ๊ฒ€์ƒ‰์•„์ด์ฝ˜์„ ๋„ฃ์Šต๋‹ˆ๋‹ค. MainActivity.java toolbar๋ฅผ ์„ค์ •ํ•ด์ฃผ๊ณ  ๊ฒ€์ƒ‰๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); //๋ฉ”๋‰ด ์ƒ์„ฑํ•˜๋Š” onCreateOptionsMenu @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); //search_..
Retrofit2 + Okhttp3 Retrofit2 Retrofit์€ Square์‚ฌ์—์„œ ๋งŒ๋“  ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ์„œ๋ฒ„์™€ ํ†ต์‹ ํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ๊ตฌํ˜„์ด ๊ฐ„๋‹จํ•˜๋ฉฐ ์‘๋‹ต์†๋„๊ฐ€ ๋น ๋ฅธ๊ฒƒ์ด ์žฅ์ ์ž…๋‹ˆ๋‹ค. ์•„๋ž˜ ์‚ฌ์ง„์„ ๋ณด๋ฉด Retrofit์ด ๊ฐ€์žฅ ๋น ๋ฅธ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Okhttp3 Retrofit์€ ๊ธฐ๋ณธ์ ์œผ๋กœ Okhttp๋ฅผ ๋„คํŠธ์›Œํ‚น ๊ณ„์ธต์œผ๋กœ ํ™œ์šฉํ•˜๋ฉฐ ๊ทธ ์œ„์— ๊ตฌ์ถ•๋ฉ๋‹ˆ๋‹ค. OkHttp๋Š” ์ด๋ฏธ Retrofit2 ๋ชจ๋“ˆ์˜ ์ข…์†์„ฑ์— ํฌํ•จ๋˜์–ด ์žˆ์–ด, ๋ณ„๋„์˜ OkHttp ์„ค์ •์ด ํ•„์š”ํ•˜๋‹ค๋ฉด Retrofit2์—์„œ OkHttp ์ข…์†์„ฑ์„ ์ œ์™ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ๋ฒ• mysql๊ณผ php๋ฅผ ์ด์šฉํ•˜์—ฌ ์„œ๋ฒ„ ๊ตฌ์ถ•์„ ํ•ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค. ์ €๋Š” ๋กœ๊ทธ์ธ ์„œ๋ฒ„๋ฅผ ๊ตฌ์ถ•ํ•˜๊ธฐ์œ„ํ•ด userํ…Œ์ด๋ธ”์„ ๋งŒ๋“ค์–ด์ฃผ์—ˆ์Šต๋‹ˆ๋‹ค. CREATE TABLE `USER` ( `userID` VARCHAR(20) ..