java

Timer in the Android app

How do I make a timer in an android app? Simple to use java.util.Timer?

Web application architecture for dummies

I was going to write a small web application in JavaEE (forum or guest) and I think how to do it, so to speak, according to F ... /?var1=1&var2=2 (i.e., in other words, a request was made with both the post and get parameters passed at the same time)?

Android resource linking failed error

According to the book Head First Android, I make a program, it gives an error, when you click on the error, it shows t ... R.id.color); String beerType = String.valueOf(color.getSelectedItem()); brands.setText(beerType); } }

How do I detect soft keystrokes?

What ways are there to detect soft keystrokes in my app? Problem to solve: Protection from bots.

Specify the path to the folder

The user must specify the path to the file folder via the visual file manager. I found the following code. But this is not a ... e == RESULT_OK) { Uri uri = data.getData(); Toast.makeText(this, uri+"", Toast.LENGTH_SHORT).show(); } }

Sorting the TreeSet in reverse order

Tell me how to sort the TreeSet in reverse order. If just Set you can do this: List<Integer> list = new ArrayList( ... Order()); Set resultSet = new LinkedHashSet(list); return resultSet; And how to do the same thing only for TreeSet?

How can I access the camera's flashlight/flash in Android if the flashlight is not attached to this camera?

In the standard Camera app on your phone, you can turn on the flash/flashlight. However, when I try to do this in my app usin ... flash is turned on separately from the camera. Is there any other way to access this flashlight? Not via Camera or Camera2.

RTSP client for Android

Hello everyone, please tell me how you can start streaming video from an IP camera in your app? I tried using this scheme imp ... } } But instead of the video, there is a black screen.Please tell me where to dig?The manifest has access to the Internet.

Help us understand how return works

I would like to understand how return works, in principle I understand how it works. But the question arose, in the example b ... for (int i=0;i<newArray.length;i++ ) { newArray[i]=scr.nextInt(); } return newArray; } }

Does not start файл.ехе Created in Launch4j

I'm trying to run the file exe. I use Launch4j 3.12 The exe file just won't start. There are no messages. Here is the Launch4 ... \out\artifacts\EnglishTest_jar>java-jar EnglishTest.jar Why? What am I doing wrong? Or how do I know what I'm doing wrong?

How does the java factorial calculation program work?

I analyze a program that counts the factorial and do not understand how it works. I understand this so that result = (5-1)*5 ... ring args[]) { Recursia2 f = new Recursia2(); System.out.println("Факториал 5 равен " + f.factR(5)); } }

Converting a double from one number system to another

I wrote this code: import java.util.Scanner; public class Main { public static void main(String[] args) { Scann ... Double.toString and parseDouble only work with one parameter and do not allow you to convert numbers to other number systems)

Generic and arrays

Good time to all! I thought I knew how to use generics, but it turned out that I didn't. Code: class MyClass<T> { T mas[]; void foo() { mas = new T[10]; // ошибка! } } Question - why does the error occur?

How to parse Json in Java?

Hello! There is such a response from the server: { "p_result": "ok", "p_item": [ { "p_id": 132 ... sonObject userObject = user.getAsJsonObject(); userObject.get("p_id"); str = userObject.get("p_id").toString(); }

Parsing JSON java

Guys trying to parse json { "tokenResult": { "accessToken": "eyJhbGciOiJIsIm ... a result, the tokenResult gets null. The isTwoFactorAuth protocol works on this field. Guys where I made a mistake tell me ((

Java-SQL procedure

Hi everyone. You need to get the ResultSet from such a procedure: exec ais_disp.p_lk.p_add_client (v_sis_id => 1640, ... ommit; How to cram this into java code? I tried using CallableStatement, but I can't insert select from the procedure there.

How to build stack traces of specific threads with sample interval ± 100ms

There is OpenJDK8. There is a pool of ExecutorService threads, for example, size 40. The principle of operation is as follo ... ate -i 100ms, the withdrawal occurred approximately once per second and the RMI thread consumed one CPU core per second. 90%.

Volatile and CPU caches

Hello, here is such a question. As far as I understand, Volatile variables are required to be permanently written to memory. ... But if on one core, then the cache is one and all threads write there, then the meaning of volatile? Or I don't get it right.

How do I check from the app whether data transfer is enabled on my phone?

Good afternoon, please tell me in which direction to go. The fact is that my application uses the Internet, and there are ca ... app.ActivityThread.handleCreateService(ActivityThread.java:1945) 06-30 09:22:28.429: E/AndroidRuntime(1063): ... 10 more

What is the difference between Spring Framework and Spring Boot

You need to write a website using Spring and Hibernate. Which is better to choose for the first time: Spring Framework or Spring Boot?