Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 13:49, 8 December 2007.

Sending files with SendUi

From Forum Nokia Wiki

CSendUi API in 3rd edition and CSendAppUi API in pre-3rd edition is probably the easiest way on sending files from Symbian S60 devices. Note that it has internal protection against sending copy protected content, thus you can not send some files for example SIS files with it.

First define following member variables in your class definition:

#ifdef __SERIES60_3X__
	CSendUi* 				iSendUi;
#else
	CSendAppUi* 			iSendUi;
#endif

The indef with __SERIES60_3X__ will make sure that code compiled for 3rd edition will use CSendUi and other platforms will use CSendAppUi. Then to construct the SendUi instance, just add following lines into the ContsructL()-function of your class.

#ifdef __SERIES60_3X__
	iSendUi = CSendUi::NewL(); 
#else
	iSendUi = CSendAppUi::NewL(0); 
#endif

Which after you can add your files to be sent into descriptor array and then you can use the following function to send the files out from the phone.

void CreateAndSendMessageL(CDesCArray* aArray)
{
	if(aArray && iSendUi)
	{
		TSendingCapabilities MySendCapa;
		MySendCapa.iFlags  = TSendingCapabilities::ESupportsAttachments;
			
		if(aArray->Count())
		{	
	#ifdef __SERIES60_3X__
			CMessageData*  Mymessage = CMessageData::NewLC(); 
			
			for(TInt i=0; i< aArray->Count(); i++)
			{
				Mymessage->AppendAttachmentL(aArray->MdcaPoint(i));
			}
				
			TUid MyServiceUid = iSendUi->ShowSendQueryL(Mymessage,MySendCapa);
            if(iSendUi->ValidateServiceL(MyServiceUid,MySendCapa))		
            {
            	iSendUi->CreateAndSendMessageL(MyServiceUid,Mymessage);
            }
           
            CleanupStack::PopAndDestroy( Mymessage);
    #else
            iSendUi->CreateAndSendMessagePopupQueryL(KtxApplicationName,MySendCapa,NULL,aArray);
	#endif
            		
		}
	}
}

The Sending function will cause SendUi to pop up selection list box filled with possible methods for sending the files, and selecting one will cause files to be sent with selected method.

Related Discussions
Thread Thread Starter Forum Replies Last Post
Problems (Bug List) that need to be fixed on 3230! Saeid General Discussion 49 2005-08-21 12:09
sms application problem mikeaf Mobile Java Networking & Messaging & Security 5 2007-09-14 11:39
email pictures? newtoallthis Symbian Networking & Messaging 1 2005-12-06 21:17
Is this possible using sockets?? mayur_24 Symbian Networking & Messaging 2 2005-01-07 11:54
help on getting etelgprs.h for sending SMS on series 60 sajindra General Symbian C++ 6 2004-06-25 20:30
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZmessagingQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX