0

I wanted to test which method I should use for performing network communication for my Android app. I want fastest network communication.

How should I test these two methods java.net and java.nio for my mobile app to get to the conclusion.

Any pointers ?

2 Answers 2

3

Unless you're writing a server that expects to have tens of thousands of incoming connections there is no reason to prefer java.nio over java.net, and the latter is very much simpler to program.

I did very extensive benchmark testing with 1700 data points some years ago, which inter alia proved there was no performance difference between java.net and java.nio over single Internet connections.

Sign up to request clarification or add additional context in comments.

2 Comments

How can I perform some benchmarks test to prove this ?
(a) Why? And (b) what don't you understand about how to perform benchmarks? Just test and measure.
-1

java.net method is better for network communication using java.net or java.nio for Android applications

2 Comments

How can I perform some benchmarks test to prove this ?
Your answer is incomprehensible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.