문제

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