Skip to content

Instantly share code, notes, and snippets.

@galcyurio
galcyurio / sqlite_example.txt
Created November 23, 2016 04:02
sqlite 예제
http://androidopentutorials.com/android-sqlite-example/
<ImageView
android:id="@+id/imageView"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="@drawable/img0" />
<activity
android:name=".DetailActivity"
android:label="@string/title_activity_detail"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.android.sunshine.app.MainActivity" />
</activity>
@galcyurio
galcyurio / SerchView_example.xml
Created November 28, 2016 05:34
overflow menu 에서 SearchView 를 구현
<item
android:id="@+id/action_search"
android:icon="@android:drawable/ic_search_category_default"
android:title="검색"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom|collapseActionView" />
@galcyurio
galcyurio / SharedPreference_method_정리.java
Last active November 28, 2016 07:14
what is getSharedPreferences // most important method is 'getSharedPreferences()'
// basic method
public SharedPreferences getSharedPreferences(String name, int mode) {
return mBase.getSharedPreferences(name, mode);
}
// call getSharedPreferences() internally.
public SharedPreferences getPreferences(int mode) {
return getSharedPreferences(getLocalClassName(), mode);
}
https://slipp.net/wiki/pages/viewpage.action?pageId=16711743
https://support.microsoft.com/ko-kr/kb/164015
var data = {};
data["writer"] = writeForm.writer.value;
data["title"] = writeForm.title.value;
data["content"] = writeForm.content.value;
console.log(JSON.stringify(data));
// {"writer":"qqq","title":"www","content":"eee"}
private enum Category {
POP, PTY, REH, SKY, T3H, UUU, VEC, VVV, WSD, R06, S06;
}
Category enumCategory = Category.valueOf(category);
switch (enumCategory) {
case POP:
forecast.setPopValue(fcstValue);
break;
case PTY:
@galcyurio
galcyurio / GsonTest6_Generics_TypeToken.java
Created December 13, 2016 07:22
JSON 형태로 직렬화를 하게 되면 generic 관련 데이터나 다른 primitive type 데이터를 잃게 될 때의 대처방식
package com.sds.gson;
import java.lang.reflect.Type;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
public class GsonTest6_Generics_TypeToken {
public GsonTest6_Generics_TypeToken() {