Tomek Kondrat · Mar 11, 2014 at 05:30 pm

Learn about Concurrency in Java, and Optimize Your Applications

Understanding the structure of Java code is key to being a good Android programmer. One topic that should be understood better by most developers is concurrency. Every machine can perform more than one task at a time. For example, you are able to listen to music, browse the Internet, and have Android compiling in the background. Java, which is the main language of Android, is perfectly ready to handle more than one process at the same time.

There are two basic units of execution: processes and threads. New CPUs available both on PCs and phones have more than one thread, that’s why some new Intel chips can run up to 12 threads at the same time. The number of processes is greater, and shared among the number of currently available threads. That does not mean that a single-core processor doesn’t support concurrency. It does, but the performance will be lower than on an eight-core machine.

If you want to learn about concurrency in Java, you should check out a guide written by XDA Senior Member sak-venom1997. Sak-venom1997 put forth tremendous effort to thoroughly explain concurrency handling in Java. By following suggestions from this guide, you can get the most performance from your application and optimize it to use all threads available on your device.

The guide can be found in its original thread. If you are an app developer or you are planning to become one, don’t hesitate to go there to learn more.


_________
Want something on the XDA Portal? Send us a tip!

Tomek Kondrat

eagleeyetom is an editor on XDA-Developers, the largest community for Android users. Tomek is the only Polish moderator on XDA Developers. He graduated from the University of Warmia and Mazury in Olsztyn with a degree in journalism and public communication in 2013. He's a big fan of football (not hand egg), post rock and cooking. A total addict of mobile technology, especially Android. Currently flashes dozens of custom ROMs on his OPO. View eagleeyetom's posts and articles here.
Jack Jennings · Jul 30, 2015 at 11:09 am · 1 comment

Huawei’s Rapid Rise to Third Place in the Smartphone Race

Huawei has quickly grown to become one of the world's biggest telecommunications companies since its inception in 1987, owning huge swathes of network infrastructure across different countries. It looks as if its smartphone sales are really beginning to take hold too - results this year have been great for the Chinese manufacturer, with an increase in global smartphone sales of 39% in the first half of 2015.     Now a new report from Strategy Analytics now states that Huawei has risen to take the title...

XDA NEWS
Faiz Malkani · Jul 30, 2015 at 10:30 am · no comments

OnePlus 2 Bares All in New Tear Down Gallery

Last year, the launch of the OnePlus One, dubbed 'the flagship killer', visibly shook the foundations of the mobile OEM sphere, with OnePlus delivering high-end flagships specs at a very affordable price. The initial launch phase was met with mixed feelings after a few controversial marketing tactics, but they eventually gave way to strong sales figures.   Earlier this week, OnePlus went on to unveil the successor to the One, and while the device continues to offer top-of-the-line specs at...

XDA NEWS
Jack Jennings · Jul 30, 2015 at 10:00 am · no comments

Focus – An Attractive But Raw Gallery Replacement

Focus is an attractive new app built by XDA members Liam Spradlin and Francisco Franco, the latter being well-known in the forums for his kernels. Focus aims to completely replace your gallery app with some neat tricks, but at a potentially risky time considering that Google has thrown its weight into the photo-organization arena. This is a first draft of the app of course, but we'll pitch it against its main rivals here, namely the popular QuickPic and the aforementioned Google Photos.     The first...

XDA NEWS