Questions tagged as 'java'

1
answer

Communication between Android and USB devices

I'm developing an Android application that communicates with a USB device, printer, Arduino, or other Android device. Is it possible to read and write to Android's USB port? How do I proceed with the drivers? Does Android have libraries to wo...
asked by 25.02.2014 / 20:53
8
answers

How to know all possible combinations of 0 and 1 in Java?

What combinations can you get only with 0 and 1 numbers using 5 boxes (digits)? For example: 00000 00001 00011 ... 11111. I wanted to save all the combinations, but I do not know how to find all of them.     
asked by 17.05.2017 / 15:26
8
answers

Recognize word repetitions in String

I have text within StringBuffer and I need to check and mark the words that appear more than once. At first I used a circular queue of 10 positions, because I'm interested only in words repeated in a "ray" of 10 words. It is worth noting...
asked by 06.02.2015 / 20:19
2
answers

Definition of the day of the week in the GregorianCalendar

I have the following code which is responsible for creating a GregorianCalendar for handling a date. TimeZone tz = TimeZone.getTimeZone("America/Sao_Paulo"); TimeZone.setDefault(tz); Calendar calendar = GregorianCalendar.getInstance(tz); c...
asked by 11.12.2013 / 21:29
1
answer

How to develop two versions of the same application, one being free and the other paying?

I'm starting to develop an Android app using Android Studio, and I want to make it available in two versions, one paid, with more features, and one free, more basic. I thought about starting to develop and after finishing the base version, co...
asked by 09.01.2015 / 22:32
4
answers

How to do LTRIM () and RTRIM () in Java?

I need to process strings in Java. I know there is the trim() method, but I need a Left Trim and a Right Trim . How do I do this? For the time being I'm traversing the string with a loop and removing all the blanks from the b...
asked by 04.02.2014 / 18:55
2
answers

What is the difference between String [] args and String args []?

What is the difference between the statements String[] args and String args[] in Java?     
asked by 06.12.2016 / 13:28
2
answers

What is the / ** code used for in Java language?

>, I did not quite understand what that meant, could anyone explain?     
asked by 20.02.2014 / 18:05
1
answer

Requests for API Rest

The application uses Spring Rest in which the paths of a CRUD are generated automatically for each entity, I have the Vehicle, Contact and Agency entities and each one with its respective repository. Vehicle has as an attribute an Agency li...
asked by 14.07.2015 / 17:20
4
answers

Java: When to use interrupt vs flags?

To indicate to a thread that it should "break" its work, Java provides a mechanism known as Interrupts : public void run() { while(!Thread.interrupted()) { // Fazer algo } } // para interromper minhaThread.interrupt(); Tha...
asked by 01.11.2016 / 15:37