8월, 2013의 게시물 표시

[C#-MVC] JSONAttribute

C# - JSON Result


publicclassJSONAttribute : ActionFilterAttribute {     publicoverridevoid OnActionExecuted(ActionExecutedContext filterContext)     {         var result = newJsonResult();         result.Data = ((ViewResult)filterContext.Result).Model;         result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;         filterContext.Result = result;     } }//TEST[JSON] publicActionResult GetJson() {      var data = new { x = 10, b = 20, c = 20 };      return View(data); }//Result{"x":10,"b":20,"c":20}

Google Drive Sample Code

Google Drive Sample Code
구글 개발자 페이지 


package com.example.googledrivesample;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Locale;

import android.accounts.AccountManager;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.widget.Toast;

import com.google.api.client.extensions.android.http.AndroidHttp;
import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential;
import com.google.api.client.googleapis.extensions.android.gms.auth.UserRecoverableAuthIOException;
import com.google.api.client.http.FileContent;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.drive.Drive;
import com.google.api.services.drive.DriveScopes;
import com.google.api.services.drive.model.File;

public class MainActivity extends Activit…