Questions tagged as 'java'

1
answer

Chat Client-Server Application with Sockets not working

I'm doing a project and I got to the part of the communication between the server and the client and I did not get the output I wanted (output image intended). The goal is for the server and client to communicate with each other. That is, to...
asked by 24.11.2015 / 23:50
2
answers

How to capture the first letter of a String name and if the letter is 'C' save the name in a vector?

I have an algorithm that reads a name from any person and if the name starts with the letter "C" it should capture the name and save it to the vector. I've tried every way but I can not do it. public static void main(String[] args) { Stri...
asked by 19.01.2016 / 15:35
1
answer

Socket Multi Thread Server - Java Server and Client in C ++

I have to develop a Mini Socket Multi Thread Server (college work) in Java and I need to make a Client in C, for example, it can be in any language, but I chose those two. How do I send the values from the Client to the Server? For example...
asked by 15.05.2015 / 20:29
3
answers

How to use GestureDetector?

I would like a practical example for this method, as I want it to detect motion to the left executes a command and if it is to the right executes another command. Searching the net found this code seems to be working, however it does not sens...
asked by 14.05.2015 / 19:51
2
answers

Maximize solution: construction of sublists meeting limit

Having a set of n-values, I need to divide these items into subsets that do not exceed the value (sum of all items) stipulated and assure me that the formation of the set is as close as possible to the stipulated value. > For example, having a...
asked by 24.02.2014 / 18:22
3
answers

Map show current location

I would like to know how to make the map show the user's current location. I created this code that was apparently working, but sometimes it can not pick up the location and application of the error. public class VisualizarMapa extends Frag...
asked by 03.02.2015 / 02:04
4
answers

Intercept Exception

I'm using Demoiselle in my application, but it does not come out very well in one respect. In an association between two or more entities, deleting throws an exception. With the exception handling available in Demoiselle, I've created a method t...
asked by 23.03.2015 / 12:56
1
answer

YouTube in WebView for Android app

Does anyone know how to view a YouTube video or some streaming of video through a WebView ? In the code below, there are three buttons. The first one takes the user to the link he typed, the second is fixed to go to Google's website a...
asked by 02.01.2015 / 00:10
0
answers

How to find where is the circular reference in GSON?

Imagine that I have these classes: public class A { private B b; } public class B { private A a; } And then I have this: A a = new A(); B b = new B(); a.b = b; b.a = a; Gson gson = new Gson(); String x = gson.toJson(a); The re...
asked by 21.03.2017 / 14:56
4
answers

How to separate a string when the string does not have a separator?

I have a String: String texto = "1234"; String split[] = texto.split(?); I need to separate the characters, 1-2-3-4, with each number being 1 character only.     
asked by 28.08.2017 / 13:35