質問

Each message that I am downloading is quite large. However, I am only interested in the JSON MIMETYPE. Is there a way to specify to the server that I am would only like to download the JSON part of the message? I have looked into the FetchProfile settings, but it does not seem to support this.

役に立ちましたか?

解決

I supposed that you are using javamail and have been able to retrieve the messages right?

Perhaps you can try this: Get the bodypart and check for the mimetype.

        if (part.isMimeType("text/plain")) {
            // Handle plain text
            Log.i("Mime Type: ", "Plain Text!");
        } else {
            // Special non-attachment cases here of
            // image/gif, text/html, ...
            Log.i("Mime Type: ", "Others!");
        }

他のヒント

Once you're at the stage of downloading the message contents it's an all-or-nothing situation, unfortunately. The standards that JavaMail adheres to don't specify a way to separate parts of message contents before downloading; the only way to accomplish that sort of thing would be server-side.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top