Questions tagged as 'java'

1
answer

Android stops when you press a button several times

I am developing an app to listen to streaming radios but if I press the button 3 times, it stops. Another problem is that I would like you to be a second in buferring before I start playing to prevent it from starting, stop and continue. Log Cat...
asked by 02.10.2017 / 21:00
1
answer

Error when comparing if: "java: bad operand types for binary operator"

I have a small problem in which I try to compare an array with an int option in an IF entered by the user, I get an error. I do not program everything in the Main and I use several classes and I communicate with each other. I would like to ma...
asked by 29.05.2018 / 22:38
4
answers

how do I get the correct value to an HttpResponse response = mHttpClient.execute (httppost);

I have a post method. That consumes a Webservice that returns a boolean (ws) (everything is correct up here), as you know, it returns a true or false (which makes it correct) How can I recover this result? This is the code HttpResponse r...
asked by 02.10.2017 / 19:41
3
answers

How to avoid blanks when saving the split result in an array with Java?

I am working on the development of a calculator which should receive a string of characters that form an operation. The purpose is that the calculator must do the calculations taking into account the priority of the operators. Currently the calc...
asked by 24.08.2017 / 17:50
1
answer

Make the average of three values of an array in Java

I want to get the average of three notes entered in an array: Code: System.out.println("\nIntroduca notas correspondientes(1-10)"); for(j=0;j<3;j++) { do{ System.out.print("Nota "+(j+1)+" : ");...
asked by 26.08.2017 / 17:44
1
answer

Tomcat 8 does not recognize Api REST

I have a Rest API created with Java 1.7, using spring boot. When I start the server in eclipse (which uses an embedded tomcat) the application works correctly and when I show localhost: 8080 / hello the message appears in JSON "Hello World"....
asked by 28.06.2017 / 11:06
1
answer

Moving an array in Java

I have an array with integers int[] intColorArray = new int[3]; I would like to obtain a different value sequentially of the array but if you reach the end that you get back from the beginning, that is 0,1,2,0,1,2,0,1,2... I ha...
asked by 12.08.2017 / 21:16
2
answers

Permit Application

I am currently asking for permission separately: if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shou...
asked by 10.11.2017 / 14:05
3
answers

Show Java ArrayList elements

I'm doing an exercise where I should do a program for a point of sale. The functionalities are to add merchandise (name, quantity, price), sell merchandise and list inventory. Each merchandise is added to a ArrayList . The problem is that...
asked by 27.11.2017 / 17:36
1
answer

Extract the value of an enum class

I try to get the value of an enum class When ordering a whole number by console, the code would be something like this: //metodo class public enum TipoDeMadera { ROBLE,CAOBA; } //metodo main System.out.println("introduzca un numero p...
asked by 28.11.2017 / 05:40