• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
managing your content
 

managing your content

on

  • 1,314 views

managing your content

managing your content

Statistics

Views

Total Views
1,314
Views on SlideShare
1,313
Embed Views
1

Actions

Likes
0
Downloads
21
Comments
0

1 Embed 1

http://www.docshut.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    managing your content managing your content Presentation Transcript

    • Managing your content Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.
    • Content Background knowledge Remote content features Summary *This material is based on bada SDK 1.0.0b3 Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 2
    • What Jane wants to do… 1. Jane wants to take a picture and save it in remote Server 2. Jane wants to view the saved picture 3. Jane wants to share the picture with Mike Jane Mike Server Network Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 3
    • Background knowledge 1. bada Server 2. Content namespace Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 4
    • bada Server Framework Service Device Kernel Server Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 5
    • What is Content in bada? The logical representation of various media types such as images, audios, and videos, etc Content in bada consists of content type, attributes and physical media file Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 6
    • Local Content Local content – Content on device • Media files: Stored in /media directory • Content info: Internal bada DB – 4 pre defined types • CONTENT_TYPE_IMAGE • CONTENT_TYPE_AUDIO • CONTENT_TYPE_VIDEO • CONTENT_TYPE_OTHERS Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 7
    • Remote Content Remote content – User defined content type with attributes • Defined at the bada developer site • Saved in bada Server • Accessible through RemoteContentInfo class – Physical file • Stored in workspace storage(Amazon S3) Content info Physical file bada Server Amazon S3 Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 8
    • Content namespaces 1. “Remote” prefix is for the bada Server 2. Require “System” privilege Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 9
    • Content app step-by-step Sign in with a Samsung account Upload contents to the bada Server Create remote contents Share remote contents Search shared contents Download shared contents Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 10
    • Sign up/in the bada Server How to create the Samsung account? – Sign up in device – developer.bada.com How to implement sign in? – Use signin app control AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_SIGNIN, OPERATION_SIGNIN); if(pAc) { pAc->Start(null, this); delete pAc; } Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 11
    • Jane Upload image file Server Network Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 12
    • Upload contents (1/3) Step 1: Construct a content transfer instance __pTransfer = new ContentTransfer(); __pTransfer ->Construct(/*IContentTransferListener*/); Step 2: Upload content __pTransfer->Upload ( /*[in]srcFilePath*/, /Media/Images/Photoxxxx.jpg /*[in]destFilePath*/, /Image/Photo0008.jpg /*[in]replace*/, /*[out]uri*/, true /*[out]RequestId*/ ); *Uri: remote:/app/xxxxxxxxx/user/abcdefgh/Image/Photoxxxx.jpg App ID User ID DestFilePath Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 13
    • Upload contents (2/3) Step 3: Confirm results void ContentViewForm::OnContentUploadCompleted( RequestId reqId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage) { /* Check result */ } Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 14
    • Upload contents (3/3) Check the transfer status and confirm through various event handler – OnContentUploadCompleted() – OnContentTransferInProgress() – OnContentTransferCanceled() – Etc. Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 15
    • Jane Create content (Set content name, etc) Server Network ! The content has not been created yet! Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 16
    • Create contents (1/4) Step 1: Construct a RemoteContentInfo instance __pRemoteContentInfo = new RemoteContentInfo(); __pRemoteContentInfo->Construct( /*[in]Content Type*/, /*[in]URI*/, /*[in]Content Size*/ ); __pRemoteContentInfo->SetContentName(/*Content Name*/); __pRemoteContentInfo->SetKeyword(/*Keyword Name*/); Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 17
    • Create contents (2/4) Step 2: Construct RemoteContentManager instance and create content __pRemoteContentManager = new RemoteContentManager(); __pRemoteContentManager ->Construct(/*IRemoteContentManagerListener*/); __pRemoteContentManager ->CreateContent(*__pRemoteContentInfo, reqId); Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 18
    • Create contents (3/4) Step 3: Confirm results void ContentViewForm::OnContentCreated( RequestId reqId, const Osp::Base::String& contentId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage) { /* Check result */ } Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 19
    • Create contents (4/4) Check the content creation status and confirm through various event handler – OnContentCreated() – OnContentInfoReceivedN() – OnContentUpdated() – Etc Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 20
    • Jane Set content sharing Server Network Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 21
    • Share contents (1/3) Step 1: Construct a RemoteContentSharing instance __pSharing = new RemoteContentSharing(); __pSharing ->Construct(/*IRemoteContentSharingListener*/); Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 22
    • Share contents (2/3) Step 2: Set access level – Access level • ACCESS_NONE : Share with no one in particular. • ACCESS_BUDDY : Only buddies can access • ACCESS_ALL_USERS : Share with all. No restrictions __pSharing->SetAccessLevel( /*[in]RemoteContentId*/ /*[in]level*/ /*[out]RequestId*/ ); Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 23
    • Share contents (3/3) Step 3: Confirm result void ContentSearchForm::OnSetAccessLevelReceived( RequestId reqId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage) { /* Check result */ } Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 24
    • Demo: Demo sequence: – Sign in bada Server – Capture and upload image – Create contents – Share contents Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 25
    • Mike Remote content searching Server Network Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 26
    • Search contents (1/5) Step 1: Construct a RemoteContentSearch instance __pRemoteSearch = new RemoteContentSearch; __pRemoteSearch ->Construct(/*IRemoteContentSearchListener*/); Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 27
    • Search contents (2/5) Step 2: Search the remote content reference result r = __pRemoteSearch->Search( /*[in]ContentType*/ /*[out]RequestId*/ /*[in]PageNo*/ /*[in]CountPerPage*/ /*[in]ConditionList*/ ); Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 28
    • Search contents (3/5) Condition search – E.g. condition1(L”USER_ID = ’mike’”) Column name Operator Value Operators – similar to SQL query = : equal <= : less than or equal >: more than != : not equal >= : more than or equal LIKE < : less than • The logical relationship of multiple conditions is AND Example ArrayList conditionList; String condition1(L"KEYWORD='sample'"); String condition2(L"LANGUAGE='en' "); conditionList.Add(condition1); conditionList.Add(condition2); Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 29
    • Search contents (4/5) Step 3: Confirm result void ContentSearchForm::OnRemoteContentSearchResultReceivedN ( RequestId reqId, Osp::Base::Collection::IList* pRemoteContentInfoList, int currentPage, int countPerPage, int totalPageCount, int totalCount, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage) { /* Check result */ } Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 30
    • Search contents (5/5) Check the content searching status and confirm through various event handler – OnCategoriesReceivedN() – OnContentTypesReceivedN() – OnRemoteContentSearchResultReceivedN() Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 31
    • Mike Remote content downloading Server Network Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 32
    • Download contents (1/2) Step 1: Construct a ContentTransfer instance __pDownload = new ContentTransfer(); __pDownload->Construct(/* IContentTransferListener */); Step 2: Download content __pDownload->Download( /*[in]URI*/ /*[in]fileSize*/ /*[in]destFilePath*/ /*[in]replace*/ /*[out]RequestId*/ ); * If file size is set to 0, the method doesn’t check the storage limitation Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 33
    • Download contents (2/2) Step 3: Confirm result void ContentSearchForm::OnContentDownloadCompleted( RequestId reqId, Osp::Content::ContentId contentId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage) { /* Check result */ } Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 34
    • Demo Demo sequence: – Sign in bada Server – Search remote shared contents – Download remote contents Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 35
    • Remote Content management 1. Set up My Applications 2. Manage Content types Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 36
    • Demo: Demo sequence: – Set up My Applications – Manage remote content type Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 37
    • Summary Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 38
    • What we have learned (1/2) bada Server – System privilege – Content, location, social namespaces Content namespace – Include <FContent.h> – Set FContent library Remote content type management – User defined content type – Defined in developer.bada.com Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 39
    • What we have learned (2/2) Primary classes on content namespace – ContentSearch – ContentInfo – ContentTransfer – RemoeContentSearch – RemoteContentSharing – RemoteContentInfo – etc. Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 40
    • Find out more Tutorial: – bada Tutorial.Content.pdf Samples: – LocalContent – RemoteContent – TransferApp Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 41
    • Dive into Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 42