deathprincess
Posts: 8
Joined: Wed Nov 19, 2008 8:08 am
Location: Philippines

Send Multiple Files with single prompt.

Tue Dec 16, 2008 8:24 am

Hi Jonas,

Is is possible to send multiple files and only prompt user on the first file? I am using obex Object Push.
Thanks!

-DP

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Send Multiple Files with single prompt.

Tue Dec 16, 2008 9:18 am

Prompt on the receiving end you mean?
That depends on the remote device.

Regards,
Jonas

deathprincess
Posts: 8
Joined: Wed Nov 19, 2008 8:08 am
Location: Philippines

RE: Send Multiple Files with single prompt.

Tue Dec 16, 2008 9:51 am

Thanks for this information. Is there no way to control this behavior in sending batched files? I put the files in a loop and send each file to single remote device. I want to prompt the receving end once per batch. But what happens is it prompts for every file it is sending. I've tried this with Nokia N73 and SE K750i.

deathprincess
Posts: 8
Joined: Wed Nov 19, 2008 8:08 am
Location: Philippines

RE: Send Multiple Files with single prompt.

Tue Dec 16, 2008 12:27 pm

Hi Jonas,

I've read from a thread here that it is possible for nokia phones to be prompted only once. I modified my code to close the stream after all of the files has been sent, but it result to an exception saying that the stream is not open. With regard to this, can I also ask for the source of Obex component so i could modify PushFile() if it is the one closing the stream?
Thanks in advance!

-DP

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Send Multiple Files with single prompt.

Tue Dec 16, 2008 12:35 pm


deathprincess
Posts: 8
Joined: Wed Nov 19, 2008 8:08 am
Location: Philippines

RE: Send Multiple Files with single prompt.

Fri Dec 19, 2008 11:46 am

Hi Jonas,

I've made an application to test the obex component that was downloaded from the URL. Here's the result of the test.

> It works well for SE K750i, Sony Ericsson Z610, and Nokia 5300.

> Only 1 out of 3 contents was successfully received by Nokia N72 and Nokia 7610. An exception, saying “Stream not open”, occurs for each succeeding content after sending the first one.

> Sony Ericsson Phones were prompted for each content.

Here's my source code:

RemoteDevice targetDevice = _network.ConnectDevice(new Address(ui_BTIDTextBox.Text), ui_DeviceNameTextBox.Text);
RemoteService currentService = targetDevice.ConnectService(int.Parse(ui_ServiceCHannelNumberTextBox.Text),
ui_ServiceNameTextBox.Text);

Stream currentStream = null;

try
{
currentStream = currentService.Stream;

FileStream fileStream = new FileStream(ui_fileTextBox.Text, FileMode.Open, FileAccess.Read);
ObexObjectPush objectPush = new ObexObjectPush(-1);

objectPush.PushFile(fileStream, Path.GetFileName(ui_fileTextBox.Text), currentStream);

FileStream fileStream1 = new FileStream(ui_fileTextBox.Text, FileMode.Open, FileAccess.Read);
objectPush.PushFile(fileStream1, Path.GetFileName(ui_fileTextBox.Text), currentStream);

FileStream fileStream2 = new FileStream(ui_fileTextBox.Text, FileMode.Open, FileAccess.Read);
objectPush.PushFile(fileStream2, Path.GetFileName(ui_fileTextBox.Text), currentStream);
}
catch (Exception ex)
{
EX.Message.ToString();
}
finally
{
if (currentStream != null)
{
currentStream.Close();
}
}

I'm wondering why did it throw an exception on the second push when the receving device is Nokia 5300 and Nokia N77, and it worked as expected with Sony Ericsson phones and Nokia 5300. Is there a probem with my source code? Are the phones the one closing the stream after sending the first content?

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Send Multiple Files with single prompt.

Fri Dec 19, 2008 2:04 pm

Yes, the phones probably close the Stream. That's what I thought when I made the component at least.

Regards,
Jonas

Return to “BlueTools”