Posts by Machado • 738 points
17 posts
-
0
votes1
answer5041
viewsQ: Determine time and date of installation of an app on Android
It is possible to obtain the date and time exact that your user has installed the application? On iOS7+, you can get a receipt from when the app was downloaded using [NSBundle appStoreReceiptURL].…
-
1
votes1
answer5041
viewsA: Determine time and date of installation of an app on Android
Getting Installation Time and Date You can get the time and date of the first time the application was installed through the packageManager: long installTime = context.getPackageManager()…
-
3
votes4
answers7937
viewsQ: How can I increment a day to a Java date?
What is the best way to increase a date of the type DD/MM/YYYY?
-
14
votes1
answer276
viewsQ: Why is using String in a switch block more efficient than in an if-Else block?
According to the java documentation: The Java Compiler generates generally more Efficient bytecode from switch statements that use String Objects than from chained if-then-Else statements. Not to…
-
1
votes3
answers958
viewsA: ANDROID: How to identify user screen density?
It is possible to obtain the logical density through the code getResources().getDisplayMetrics().density; He will return you: 0.75 - ldpi (low resolution) 1.0 - mdpi (average resolution) 1.5 - hdpi…
-
9
votes1
answer1858
viewsQ: What are the differences between Hashmap and Hashtable?
What are the differences between HashMap and Hashtable in Java? Which is more efficient?
-
0
votes1
answer92
viewsA: How to get the screen Density on Android via code?
It is possible to obtain the logical density through the code getResources().getDisplayMetrics().density; He will return you: 0.75 - ldpi (low resolution) 1.0 - mdpi (average resolution) 1.5 - hdpi…
-
1
votes1
answer92
viewsQ: How to get the screen Density on Android via code?
I am developing an application where images and layouts adapt according to the logical density of the device. You can get the screen dpi from the device through Java?
-
1
votes4
answers2064
viewsA: What are the main differences between Handler, Thread and Asynctask?
If we look at the source code of AsyncTask and of Handler we can realize that the code is written purely in Java. (Of course, there are some exceptions , but this is not the most important). So…
-
5
votes4
answers2064
viewsQ: What are the main differences between Handler, Thread and Asynctask?
The Android documentation can end up being a little confusing for those who are starting to understand better what are the differences between a Handler, one Thread and a AsyncTask. Handlers sane…
-
7
votes2
answers1031
views -
9
votes3
answers4676
viewsQ: Is the Finally block always run in Java?
In this code there is a block of Try/catch with a Return within it. try { alguma_coisa(); return successo; } catch (Exception e) { return falha; } finally { System.out.println("Eu não sei se será…
-
0
votes2
answers4816
viewsA: Java, random numbers (no repetition)
This is method pattern to generate random numbers in Java: import java.util.Random; /** * Returns a pseudo-random number between min and max, inclusive. * The difference between min and max can be…
-
1
votes1
answer1724
viewsQ: What is Recyclerview on Android?
What is the function of RecyclerView in an Android app?
-
1
votes2
answers818
viewsQ: What is the most efficient way to resize bitmaps on Android?
When a device has smaller screen resolutions, you need to resize the bitmaps to optimize its display on the display properly. The problem is that the use of createScaledBitmap can generate a lot of…
-
4
votes2
answers818
viewsA: What is the most efficient way to resize bitmaps on Android?
This answer is summarized from the article Loading large bitmaps Efficiently, which explains how to use inSampleSize to carry a bitmap low-scale In particular, Pre-scaling bitmaps explains the…
-
1
votes1
answer975
viewsA: After upgrading the SDK, my project appeared with errors
I believe it’s a class R error. R.java is a file that Eclipse Android plugins creates while building your application. R.java is created under the directory "gen". This file is generated from the…