¿ì¼± ±ÛÀ» ÀбâÀü¿¡..
Á¦°¡ º»¹®¿¡¼ ±¸±Û API¸¦ »ç¿ëÇÏÁö ¾Ê°í ±×³É Çغ¸¾Ò¾ú½À´Ï´Ù.
º»¹®³»¿ëÀ» ¾Èµå·ÎÀ̵å·Î ¿Å°Ü¿Í¼ ÆĽÌÇغ»°á°ú
1. API¸¦ »ç¿ëÇÏÁö ¾Ê´Â´Ù¸é, ÁöÁ¤ÇÑ ³¯Â¥, ±×¸®°í ½Ã°£ Àå¼Òµî »ó¼¼³»¿ë ¿¶÷ ºÒ°¡´É.(¾Æ¿¹ ÅÂ±× ÀÚü°¡ Á¸Àç ÇÏÁö ¾Ê½À´Ï´Ù. ´Ü¼øÈ÷ Á¦¸ñ°ú ³»¿ë¸¸ ÀÖ±º¿ä)
2. API¸¦ »ç¿ëÇÏÁö ¾ÊÀ¸¸é ÀÏÁ¤µî·Ï ÀÚü°¡ ºÒ°¡´É ÇÑ°Í °°½À´Ï´Ù..
¾Æ·¡´Â Gdata¸¦ ÀÌ¿ëÇÑ ¹æ½ÄÀÔ´Ï´Ù.
¾Æ·¡ ¼Ò½º¸¸ °¡Áö°íµµ "µî·Ï" ¹Ø Äõ¸®·Î Á¶È¸°¡ °¡´ÉÇϽʴϴÙ.(°Ë»ö)
÷ºÎµÈ ÆÄÀÏ ¾ÐÃàÀ» Ǫ½Ã¸é Á¦°¡ »ç¿ëÇÑ gdata-calendar¿ä±¸ ¶óÀ̺귯¸®°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù.
public void LoginUser()
{
Toast.makeText(getBaseContext(), "login..", Toast.LENGTH_SHORT).show();
CalendarService myService = new CalendarService("Test_app");
try {
myService.setUserCredentials(USER_ID,USER_Pass);
URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");
/** À̺κÐÀº À¯Àú°¡ Ķ¸°´õ¿¡ ÀÏÁ¤À» µî·ÏÇÏ´Â ºÎºÐÀÔ´Ï´Ù.
¿ì¸®´Â Çѱ¹¿¡ »ì°í Àֱ⠶§¹®¿¡ ŸÀÓÁ¸À» 9·Î ¸ÂÃß¾î¾ßµÇ°í ´Ù¸¥ Áö¿ªÀÌ¸é ´Ù¸¥Áö¿ªÀ¸·Î
º¯°æÇϼžߵ˴ϴÙ.
¶ÇÇÑ µ¥ÀÌÅÍ ¼³Á¤Áß¿¡ 2011-1900,12-1,2,12,0 À̶ó´Â ºÎºÐÀÌ º¸À̽ÇÅÙµ¥
À̺κÐÀº 2011Àº µî·ÏÇÒ ³âµµÀÌ°í 1900Àº µ¥ÀÌÆ®Á¸ÀÔ´Ï´Ù. 12´Â ¿ª½Ã µî·ÏÇÒ ´ÞÀÌ°í,
±× µÚÀÇ 1µµ ¿ª½Ã µ¥ÀÌÆ®Á¸À» ÀǹÌÇÕ´Ï´Ù. 2´Â µî·ÏÇÒ ÀÏÀ̸ç, 12´Â ½ºÄÉÁì µî·Ï½Ã°£
0Àº µî·ÏÇÒ ºÐÀÔ´Ï´Ù. ÁÖÀÇÇÒÁ¡Àº ½Ã°£Àº 30ºÐ´ÜÀ§·Î ²÷¾î¼ µî·ÏÇϼžߵ˴ϴÙ.*/
EventEntry myEntry = new EventEntry();
myEntry.setTitle(new PlainTextConstruct("Test_App"));
myEntry.setContent(new PlainTextConstruct("¾È³çÇϼ¼¿ä"));
Person author = new Person("Test_app",null,USER_ID);
myEntry.getAuthors().add(author);
DateTime startTime = new DateTime(new Date(2011-1900,12-1,2,12,0));
startTime.setTzShift(9);
DateTime endTime = new DateTime(new Date(2011-1900,12-1,2,13,0));
endTime.setTzShift(9);
When eventTimes = new When();
eventTimes.setStartTime(startTime);
eventTimes.setEndTime(endTime);
myEntry.addTime(eventTimes);
Where evLocaiton = new Where();
evLocaiton.setValueString("¼¿ï");
myEntry.addLocation(evLocaiton);
/** À̺κÐÀº °£´ÜÇÑ À¥Ä¿¸®¸¦ ÀÌ¿ëÇÏ¿© µ¥ÀÌÅ͸¦ Á¶È¸Çϴ°ÍÀ¸·Î½á, ¸®½ºÆ® Áß ÀϺθ¦
¹ßÃéÇÒ¶§ »ç¿ëÇÏ½Ã¸é µË´Ï´Ù.**/
EventEntry insertedEntry = myService.insert(feedUrl, myEntry);
URL entryUrl = new URL(insertedEntry.getSelfLink().getHref());
EventEntry retrievedEntry = myService.getEntry(entryUrl, EventEntry.class);
Query myQuery = new Query(feedUrl);
myQuery.setFullTextQuery("fghgfhfgh");
Feed myResultsFeed = myService.query(myQuery, Feed.class);
if(myResultsFeed.getEntries().size()>0)
{
Entry firstMatchEntry = myResultsFeed.getEntries().get(0);
text.setText("Title : "+firstMatchEntry.getTitle().getPlainText());
}
} catch (AuthenticationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)