막상 졸업을 하고나니까 보니까 가볍게 본다면 쉬운 분야도 많고 노가다같은 분야도 많고 쉽게 돈 벌수 있는 길도 있다. 하지만 깊게 보고 큰 기업을 가고싶다면 개발은 어렵고 복잡한 일이 맞는것 같다. 그리고 학점도 잘 나온 편이 아니고 그동안 코딩테스트를 위한 알고리즘을 판 것도, 엄청난 수상 내역도, 대단한 인턴 경험이 있는것도 아니다. 그래서 나는 두려운 사기업을 놓고 공기업을 준비하려고 계획했었다. 토익, 토익스피킹, 한국사, 기사자격증, NCS, 면접준비, 자소서, 인턴경험 이정도가 공기업을 위한 스펙이다. 필수는 아니지만 다 가산점이 있어서 고고익선, 다다익선이라고 불리며 필요한 것들이다. 2학년 말부터 잘 준비를 해왔고 학점도 괜찮았다면 사기업으로 준비를 했을텐데 후후후…
이제 오퍼가 들어온 상황이고 나는 ok를 하였지만, 개발책 다 집어던지고 오래된거 버리고 중고책으로 팔고 있는 시기에 콜이왔네? 그냥저냥하는 열정없는 개발자보다는 잘할 자신이 있었지만, 단순히 면접어필만 하고 회사를 들어가기 싫었던 나라서 개발직 던지고 블라인드를 위한 공기업을 준비하고 있었는데 다시 개발의 길로 걸으란다. 그렇게 엄청 어렵지도 그러나 쉽지도 않겠지만 잘되서 이쪽길로 간다면 쉽게쉽게 돈을 벌 수 있는 아이디어는 구상해놓았긴 했다.
속에서 열심히 일도 하고 공부도 해서 개발쪽으로 뜻을 두던, 공기업으로 취업을 하던 나 자신한테 응원의 메세지를 보내는 3월 5일이 될것같다. 화이팅하자. Boki!!!! 아자아자
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button android:id="@+id/btnStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="사진보기 시작"/>
<Button android:id="@+id/btnStop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="사진보기 정지"/>
</LinearLayout>
<ViewFlipper android:id="@+id/viewFlipper1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/cupcake"/>
<ImageView android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/donut"/>
<ImageView android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/eclair"/>
<ImageView android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/honeycomb"/>
</ViewFlipper>
</LinearLayout>
MainActivity.java
package com.example.boki.viewflipper;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ViewFlipper;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button btnStart, btnStop;
final ViewFlipper viewFlipper;
btnStart = (Button)findViewById(R.id.btnStart);
btnStop = (Button)findViewById(R.id.btnStop);
viewFlipper = (ViewFlipper)findViewById(R.id.viewFlipper1);
viewFlipper.setFlipInterval(1000);
btnStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
viewFlipper.startFlipping();
}
});
btnStop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
viewFlipper.stopFlipping();
}
});
}
}
<uses-permission android:name="android.permission.INTERNET"/>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.boki.simplewebbrowser">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/emo_im_cool"
android:label="웹브라우저"
android:logo="@drawable/web"
android:roundIcon="@drawable/web"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:label="간단 웹브라우저">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText android:id="@+id/edtUrl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="URL을 입력하세요."
android:singleLine="true"/>
<Button android:id="@+id/btnGo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="이동"/>
<Button android:id="@+id/btnBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="이전"/>
</LinearLayout>
<WebView android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true">
</WebView>
</LinearLayout>
MainActivity.java
package com.example.boki.simplewebbrowser;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;
@SuppressWarnings("deprecation")
public class MainActivity extends AppCompatActivity {
EditText edtUrl;
Button btnGo, btnBack;
WebView web;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
edtUrl = (EditText)findViewById(R.id.edtUrl);
btnGo = (Button)findViewById(R.id.btnGo);
btnBack = (Button)findViewById(R.id.btnBack);
web = (WebView)findViewById(R.id.webView1);
web.setWebViewClient(new CookWebViewClient());
WebSettings webSet = web.getSettings();
webSet.setBuiltInZoomControls(true);
btnGo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
web.loadUrl(edtUrl.getText().toString());
}
});
btnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
web.goBack();
}
});
}
public class CookWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return super.shouldOverrideUrlLoading(view, url);
}
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".MainActivity">
<DatePicker android:id="@+id/datePicker1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:datePickerMode="spinner"
android:calendarViewShown="false"></DatePicker>
<EditText android:id="@+id/edtDiary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#00FF00"
android:lines="8"/>
<Button android:id="@+id/btnWrite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Button"/>
</LinearLayout>
MainActivity.java
package com.example.boki.simplediary;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Toast;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Calendar;
public class MainActivity extends AppCompatActivity {
DatePicker dp;
EditText editDiary;
Button btnWrite;
String fileName;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setTitle("간단 일기장");
dp = (DatePicker)findViewById(R.id.datePicker1);
editDiary = (EditText)findViewById(R.id.edtDiary);
btnWrite = (Button)findViewById(R.id.btnWrite);
//Todo 데이트피커 설정
Calendar cal = Calendar.getInstance();
int cYear = cal.get(Calendar.YEAR);
int cMonth = cal.get(Calendar.MONTH);
int cDay = cal.get(Calendar.DAY_OF_MONTH);
dp.init(cYear, cMonth, cDay, new DatePicker.OnDateChangedListener() {
@Override
public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
fileName = Integer.toString(year) + "_" + Integer.toString(monthOfYear + 1) + "_" + Integer.toString(dayOfMonth) + ".txt";
// month는 0부터 시작이 되어서 우리가 10을 선택해도 9가 되기때문에 1을 더해줬다
String str = readDiary(fileName); // 현재 날짜의 파일을 읽어오는 메소드
editDiary.setText(str);
btnWrite.setEnabled(true);
}
});
//Todo 버튼 클릭 리스너
btnWrite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
FileOutputStream outFs = openFileOutput(fileName, Context.MODE_PRIVATE);
String str = editDiary.getText().toString();
outFs.write(str.getBytes());
outFs.close();
Toast.makeText(getApplicationContext(),fileName+" 이 저장됨", Toast.LENGTH_SHORT).show();
readDiary(fileName);
} catch (IOException e) {
}
}
});
}
//Todo 현재 날짜의 파일을 얻어 일기 내용을 반환
String readDiary(String fName) {
String diaryStr = null;
FileInputStream inputStream;
try {
inputStream = openFileInput(fName);
byte[] txt = new byte[500];
inputStream.read(txt);
inputStream.close();
diaryStr = (new String(txt)).trim();
btnWrite.setText("수정하기");
} catch (IOException e) {
editDiary.setHint("일기 없음");
btnWrite.setText("새로 저장");
}
return diaryStr;
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.boki.miniphotoshop">
<application
android:allowBackup="true"
android:icon="@drawable/lena256"
android:hardwareAccelerated="false"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout android:id="@+id/iconLayout"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<ImageButton android:id="@+id/ibZoomin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/zoom_in"/>
<ImageButton android:id="@+id/ibZoomout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/zoom_out"/>
<ImageButton android:id="@+id/ibRotate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/rotate"/>
<ImageButton android:id="@+id/ibBright"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bright"/>
<ImageButton android:id="@+id/ibDark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/dark"/>
<ImageButton android:id="@+id/ibGray"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gray"/>
</LinearLayout>
<LinearLayout android:id="@+id/pictureLayout"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="9"
android:gravity="center"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
MainActivity.java
package com.example.boki.miniphotoshop;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.LinearLayout;
public class MainActivity extends AppCompatActivity {
ImageButton ibZoomin, ibZoomout, ibRotate, ibBright, ibDark, ibGray;
MyGraphicView graphicView;
static float scaleX = 1, scaleY = 1;
static float angle = 0;
static float color = 1;
static float satur = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setTitle("미니 포토샵");
LinearLayout pictureLayout = (LinearLayout)findViewById(R.id.pictureLayout);
graphicView = (MyGraphicView) new MyGraphicView(this);
pictureLayout.addView(graphicView);
// setContentView(new MyGraphicView(this));
clickIcons(); // 6개 아이콘을 클릭했을 때 수행할 기능을 메소드로 정의함
} //onCreate
private void clickIcons() {
ibZoomin = (ImageButton)findViewById(R.id.ibZoomin);
ibZoomin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
scaleX += 0.2f;
scaleY += 0.2f;
graphicView.invalidate();
}
}); // 확대아이콘 클릭리스너
ibZoomout = (ImageButton)findViewById(R.id.ibZoomout);
ibZoomout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
scaleX -= 0.2f;
scaleY -= 0.2f;
graphicView.invalidate();
}
}); // 축소아이콘 클릭리스너
ibRotate = (ImageButton)findViewById(R.id.ibRotate);
ibRotate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
angle += 20;
graphicView.invalidate();
}
}); // 회전아이콘 클릭리스너
ibBright = (ImageButton)findViewById(R.id.ibBright);
ibBright.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
color += 0.2f;
graphicView.invalidate();
}
}); // 밝기아이콘 클릭리스너
ibDark = (ImageButton)findViewById(R.id.ibDark);
ibDark.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
color -= 0.2f;
graphicView.invalidate();
}
}); // 어둡게아이콘 클릭리스너
ibGray = (ImageButton)findViewById(R.id.ibGray);
ibGray.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (satur == 0) {
satur = 1;
}
else satur = 0;
graphicView.invalidate();
}
}); // 흑백아이콘 클릭리스너
}
//TODO 임의 View클래스 만들기
private static class MyGraphicView extends View {
public MyGraphicView(Context context) {
super(context);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int cenX = this.getWidth() / 2;
int cenY = this.getHeight() / 2;
canvas.scale(scaleX, scaleY, cenX, cenY);
canvas.rotate(angle, cenX, cenY);
Paint paint = new Paint();
float[] array = {
color, 0, 0, 0, 0,
0, color, 0, 0, 0,
0, 0, color, 0, 0,
0, 0, 0, 1, 0
};
ColorMatrix cm = new ColorMatrix(array);
if(satur == 0)
cm.setSaturation(satur);
paint.setColorFilter(new ColorMatrixColorFilter(cm)); // paint 이게 satur 밑에 있어야 작동함!
Bitmap picture = BitmapFactory.decodeResource(getResources(), R.drawable.lena256);
int picX = (this.getWidth() - picture.getWidth()) / 2;
int picY = (this.getHeight() - picture.getHeight()) / 2;
canvas.drawBitmap(picture, picX, picY, paint);
picture.recycle();
}
}
}
dialog1.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView android:text="사용자 이름"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText android:id="@+id/dlgEdt1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView android:text="이메일"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText android:id="@+id/dlgEdt2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
toast1.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="#FF0000"
android:gravity="center">
<ImageView android:src="@drawable/icon1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView android:id="@+id/toastText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="20dp"/>
<ImageView android:src="@drawable/icon1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
`activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
android:gravity="center_horizontal">
<TextView android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="사용자 이름"/>
<TextView android:id="@+id/tvEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="이메일"/>
<Button android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="여기를 클릭"/>
</LinearLayout>
MainActivity.java
package com.example.boki.listdialog;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
TextView tvName, tvEmail;
Button button1;
EditText dlgEdtName, dlgEdtEmail;
TextView toastText;
View dialogView, toastView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setTitle("사용자 정보 입력");
tvName = (TextView)findViewById(R.id.tvName);
tvEmail = (TextView)findViewById(R.id.tvEmail);
button1 = (Button)findViewById(R.id.button1);
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialogView = (View)View.inflate(MainActivity.this, R.layout.dialog1, null); // dialog1.xml파일을 inflate하여 dialogView에 대입
AlertDialog.Builder dlg = new AlertDialog.Builder(MainActivity.this);
dlg.setTitle("사용자 정보 입력");
dlg.setIcon(R.drawable.icon1);
dlg.setView(dialogView); // 인플레이트한 뷰를 대화상자로 사용
dlg.setPositiveButton("확인", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dlgEdtName = (EditText)dialogView.findViewById(R.id.dlgEdt1);
dlgEdtEmail = (EditText)dialogView.findViewById(R.id.dlgEdt2);
tvName.setText(dlgEdtName.getText().toString());
tvEmail.setText(dlgEdtEmail.getText().toString());
}
});
dlg.setNegativeButton("취소", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast toast = new Toast(MainActivity.this);
toastView = (View)View.inflate(MainActivity.this, R.layout.toast1, null); // toast1.xml파일을 inflate하여 toastView에 대입
toastText = (TextView)toastView.findViewById(R.id.toastText1);
toastText.setText("취소했습니다");
toast.setView(toastView);
toast.show();
}
});
dlg.show();
}
});
}
}