Sending files over Bluetooth using RSendAs
Article Metadata
This small snippet shows how to send a file over Bluetooth using the RSendAs class present on Symbian 3rd edition devices.
Header Required:
#include <rsendas.h>
#include <rsendasmessage.h>
#include <senduiconsts.h>
Library needed:
LIBRARY sendas2.libSource File:
RSendAs sendas;
// Connecting to the SendAs server
TInt res = sendas.Connect();
User::LeaveIfError(res);
CleanupClosePushL(sendas);
RSendAsMessage message;
// Selecting the appropriate Bluetooth MTM UID
TRAP(res, message.CreateL(sendas, KSenduiMtmBtUid));
User::LeaveIfError(res);
CleanupClosePushL(message);
// The file we’re going to push, you need to make sure that the file
// is present on the device
_LIT(KFile, "C:\\pushfile.txt");
// Constructing the message
TRequestStatus status;
message.AddAttachment(KFile(), status);
User::WaitForRequest(status);
User::LeaveIfError(status.Int());
CleanupStack::Pop(1); // RMessage
// Launch the dialog allowing us to choose a receiver
// device and send the file
TRAP(res, message.LaunchEditorAndCloseL());
User::LeaveIfError(res);
CleanupStack::PopAndDestroy(1); // RSendAs
An example depicting another way of transferring files over bluetooth in symbian using QtMobility is here : Bluetooth File Transfer Example


Mohamed12271 - Dosenot working with E72
this code Dose not working with E72 when I EXECUTE this code i found it in Drft box with name Unknown WITH Bluetooth ICON
How to resolve this???mohamed12271 00:43, 21 September 2011 (EEST)
Hamishwillee - @Mohamed12271 - try Symbian C++ discussion boards?
Hi Mohamed12271,
The author may not be monitoring this article any more, so I suggest you also raise issue on the discussion boards. If you find an answer, would be great if you could repost it back here. One thought - does your app have the right capabilities?
Cheers
Hamishhamishwillee 05:00, 21 September 2011 (EEST)