Questions tagged as 'java'

1
answer

What is the setProperty method of the System class on Android?

In my case I used this way: System.setProperty("file.encoding", "UTF-8"); Would it be the language ID used?     
asked by 24.05.2015 / 20:16
2
answers

Android: Saving data to files

I'm having trouble using files on android. Save the file and use it quietly to close the application, when I open the app again the file is recreated and I lose the recorded data. I tested several solutions, I have this code now: public...
asked by 04.01.2016 / 13:55
1
answer

Generate three-column .txt file

I have a system where I do some search in the database and store everything in Array , however I have to assemble a layout with this data so they can be printed as labels in a dot matrix printer. The part of the lines I have already for...
asked by 30.12.2015 / 19:58
2
answers

I wanted to know if each time I create an object in java it initializes a Thread

I have a class that extends the Thread class, wanted to know if each time I create an object it initializes a Thread. class Objeto{ String nomeObjeto; public Objeto(String nomeObjeto){ this.nomeObjeto = nomeObjeto;...
asked by 26.12.2015 / 11:40
1
answer

How to convert a String of this type to a Date Object

I'm working with an ontology in Protegé 4.1 and I have a DataProperty which is a DateTime. I'm getting this DateTime this way: ["2015-06-30T16:38:53"^^xsd:dateTime] How do I put the date this way in a Java Date object? (I'm using Java 7)...
asked by 01.07.2015 / 23:33
3
answers

Doubt about class inheritance in Java

I have the following code a ebook that inherits the class Livro (superclass). However, I can not create a new ebook and setar in the name, when I put the main method ( main ) it gives error. Class Autor :...
asked by 05.07.2015 / 18:41
1
answer

How to convert from Timestamp to Calendar?

I need to convert a resultSet of the database that returns Timestamp to a variable of type Calendar.     
asked by 04.06.2015 / 22:34
1
answer

How to add ellipsis if content leaks from Android layout?

How do I add ellipses if content leaks from the Android layout? For example: I have a very large text in my ActionBar , and instead of having to decrease it in size, I want it to add ellipsis if there is a layout leak, for example from "Firs...
asked by 04.06.2015 / 16:04
3
answers

How do I prevent an application running in the background from being stopped by the user?

For example, an application that requires the cordenings of the device every 30 seconds and runs in the background, and the user can not force the device to stop manually.     
asked by 01.10.2015 / 00:54
1
answer

Array without repetition

How do you not repeat the data with each execution? Each time I run it, it ends up repeating the dates at the time of execution, as I do for it to sort the dates without repeating them, and when the number of dates available in this collectio...
asked by 01.10.2015 / 14:37