×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    6

    Can we share any files using ShareMediaTask?

    Hello,
    I am creating a xml file within my application. I want to send this file as an attachment when the user sends mail.
    Since the EmailComposeTask do not allow attachments, and I don't want to use third party api's at present, I was looking at using ShareMediaTask api.
    Here is the code that invokes the shareMediaTask:
    Code:
    void ShowShareMediaTask(string path)
            {
                MessageBox.Show("now sharing file at:" + path);
    
                MessageBox.Show("the file exists?:" + File.Exists(path));
    
                ShareMediaTask smt = new ShareMediaTask();
                MessageBox.Show("now assigning path to sharemediatask");
                smt.FilePath = path;
                MessageBox.Show("path assigned!, now opening share media");
                smt.Show();
            }
    I deployed the solution on a Lumia device (not emulator) and it runs till the last message i.e "path assigned!, now opening share media" but after that instead of showing the list of mediums to share, it just returns back to the page (I only have a single test page).
    Can someone provide some insight.

    Thanks.

  2. #2
    Registered User
    Join Date
    Jan 2013
    Location
    Timisoara, Romania
    Posts
    14

    Re: Can we share any files using ShareMediaTask?

    Hi,
    From what I know, the ShareMediaTask Class allows the user to share just media files, so, I think you don't have any chance to send a xml file with it.
    Maybe Microsoft will change the EmailComposeTask in SDK 8.1 and we'll have attachements.
    Now, I think your only chance is to use LiveMailMessage(Probably you found it already)
    If anyone knows something more, share with us

  3. #3
    Registered User
    Join Date
    Jun 2013
    Posts
    6

    Re: Can we share any files using ShareMediaTask?

    Thanks ADU.
    You're right, (it seems that) the LiveMailMessage is the only way at present.
    Just a thought, can I rename my xml file to a media file extension and then share it?

  4. #4
    Registered User
    Join Date
    Jan 2013
    Location
    Timisoara, Romania
    Posts
    14

    Re: Can we share any files using ShareMediaTask?

    I will try, because I don't know for sure, but if you don't have too much information to send, you can create an image, and put the information into it's title

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    960

    Re: Can we share any files using ShareMediaTask?

    Quote Originally Posted by patelpareshc View Post
    Thanks ADU.
    You're right, (it seems that) the LiveMailMessage is the only way at present.
    Just a thought, can I rename my xml file to a media file extension and then share it?
    I would not do that as it may be blocked at some email servers that detect that the file contents is not what the extension represents.

Similar Threads

  1. Replies: 3
    Last Post: 2009-11-06, 08:51
  2. How to share files using OBEX via Bluetooth ?
    By islam.abdo in forum Bluetooth Technology
    Replies: 3
    Last Post: 2009-06-24, 10:36
  3. Share Online 3.0 N76
    By bler in forum General Development Questions
    Replies: 4
    Last Post: 2008-04-14, 06:12
  4. How to share common files from folder in multiple projects
    By Tejaswini in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 14
    Last Post: 2007-04-16, 12:51
  5. Storing Audio/ image files as byte arrays in flat files(eg. bin files)
    By anantharaj1999 in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 11:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×