This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Call<JsonObject> jsonObjectCall = sample_RestfulAdapter.getInstance().Project(); | |
jsonObjectCall.enqueue(new Callback<JsonObject>() { | |
@Override | |
public void onResponse(Response<JsonObject> response) { | |
//통신성공 시 | |
JsonObject jsonObject = response.body(); | |
//Json 파싱 후 사용 | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RestfulAdapter { | |
public static final int CONNECT_TIMEOUT = 15; | |
public static final int WRITE_TIMEOUT = 15; | |
public static final int READ_TIMEOUT = 15; | |
private static final String SERVER_URL = "https://api.server.net/"; //2부터 url뒤에 /를 입력해야 합니다. | |
private static OkHttpClient client; | |
private static sample_Interface Interface; | |
public synchronized static sample_Interface getInstance() { | |
if (Interface == null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AuthModel implements Parcelable { | |
public static final String TAG = LoginActivity.class.getSimpleName(); | |
public static final String PARCELABLE_KEY = TAG + ":" + "ParcelableKey"; | |
String email; //json의 name 과 동일해야 함. | |
String nick_name; | |
String profile_modified; | |
String profile_thumb; | |
long storage_limit; | |
long storage_used; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface sample_Interface { | |
//URL encoding하여 보냅니다. | |
//POST 방식, 파라메터는 @Field("파라메터명") 으로 보낼 수 있습니다. | |
//Json형식에 맞게 Bean객체를 만들어 두면 설정항 Parser가 자동으로 컨버팅해 돌려 줍니다. | |
@FormUrlEncoded | |
@POST("auth") | |
Call<AuthModel> Auth(@Field("email") String email, @Field("password") String password); | |
// Get방식, 파라메터는 @Query("파라메터명")으로 보낼 수 있습니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Your.package | |
import com.facebook.imagepipeline.core.ImagePipelineConfig; | |
import android.content.Context; | |
import okhttp3.OkHttpClient; | |
/** | |
* Created by user on 2016-01-15. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package your.package | |
import android.net.Uri; | |
import android.os.Looper; | |
import android.os.SystemClock; | |
import com.facebook.common.logging.FLog; | |
import com.facebook.imagepipeline.image.EncodedImage; | |
import com.facebook.imagepipeline.producers.BaseNetworkFetcher; | |
import com.facebook.imagepipeline.producers.BaseProducerContextCallbacks; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.NinePatchDrawable; | |
import android.util.AttributeSet; | |
import android.widget.RelativeLayout; | |
public class FRelativeLayout extends RelativeLayout { |
NewerOlder