It should. But the only way to make 100% sure is to test on the device.

On Monday, December 14, 2020 at 1:25:33 PM UTC+2 P5music wrote:

> I would like to know if this code snippet will work on iOS.
> I want to use the message send feature to export some application data.
> The user is asked for the filename, then a temporary file is created 
> containing the JSON text to be exported (with a custom file extension), 
> then that file is used to create an output stream and attached like plain 
> text (or should the json mimetype be used?), with no subject and no 
> recipients.
> Thanks in advance
>
>   try {
>                     file=File.createTempFile(fileName,"ext");
>
>                     OutputStream os = 
> Storage.getInstance().createOutputStream(file.getAbsolutePath());
>                     os.write(text.getBytes("UTF-8"));
>                     os.flush();
>                     os.close();
>                 } catch (IOException e) {
>                     return;
>                 }
>                 Message m = new Message("");
>                 m.getAttachments().put(file.getAbsolutePath(), 
> "text/plain");
>                 Display.getInstance().sendMessage(new String[] {""}, "", 
> m);
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/ab1e4198-6127-40e4-87e4-45b3289edae4n%40googlegroups.com.

Reply via email to