Posts by Pedro Rangel • 2,747 points
80 posts
-
1
votes1
answer171
viewsA: How to automate testing?
A widely used software is Jenkis that through it, it is possible to expedite time-consuming tasks such as the compilation of a project and the execution of its automated tests. With a…
-
2
votes1
answer1021
viewsQ: How to perform a date check?
I would like to know how to check whether a user-provided input date is valid or not.
javaasked Pedro Rangel 2,747 -
5
votes1
answer10356
viewsQ: How to use the Toolbar widget?
I’ve seen the own documentation of android I’ve done all the steps of other forums and still could not use Toolbar in my screen layout. How I should proceed step by step regarding the implementation…
-
1
votes0
answers211
viewsQ: How to put Action Mode on top?
I am using this property in manifest.xml: android:uiOptions="splitActionBarWhenNarrow" 1- The options menu appears at the bottom, following the figure below: 2-And when a click occurs on an item,…
-
29
votes1
answer10807
viewsQ: When and how to implement Parcelable vs Serializable?
After a long time using the Serializable implementation in my classes on the Java platform (Android), I discovered Parcelable, but I was in doubt regarding the following questions below: 1. When to…
-
4
votes2
answers2136
viewsQ: How to use a Bundle with an uncivilized type?
I’m with the next class created by me: public class Telefone { private String nome; private String telefone; public String getNome() { return nome; } public void setNome(String nome) { this.nome =…
androidasked Pedro Rangel 2,747 -
6
votes2
answers760
viewsQ: How to list and monitor the apps that are installed and/or in use?
On an Android device, where many app’s are running, I would like to enable an interface where the user can see which app’s installed and which ones are running at the moment, being possible to…
androidasked Pedro Rangel 2,747 -
15
votes1
answer1351
viewsQ: What is an ergonomic?
1) What the concept or meaning of Ergonomics? 2) What features should a software possess to be considered ergonomic?
-
1
votes1
answer380
viewsA: Adding libs on android with eclipse
When you add a library through the Java Build Path/Add Jars, the project will import a reference(the path to the library) of the library, for example say add a library that is on your desktop (C:…
androidanswered Pedro Rangel 2,747 -
2
votes1
answer1621
viewsA: How to customize a listview (scrolling)?
Solution with the help of @Wakim^^: Here at this link below is the images for customization of the scroll bar(hosting for me on the mega) and shall be placed in the res/drawable: Drawable - custom…
-
1
votes1
answer1621
viewsQ: How to customize a listview (scrolling)?
Given an Activity that has an Adapter to fill a contact list: If possible wanted to get the following result as in the image below: When scrolling up and down, show the initial letter of the element…
-
4
votes1
answer227
viewsA: Error when customizing a menu using actionLayout
I’ve managed to solve it after a lot of pain and with the help of @Wakim: Xml configuration: <menu xmlns:android="http://schemas.android.com/apk/res/android"…
-
3
votes3
answers2263
viewsQ: How do I show icon in the Bar action when item is in overflow?
I wanted the item called also to appear on your side your image: The result I would expect would be this: Activity code with help from @Alexandre Strevenski: import android.app.Activity; import…
-
2
votes2
answers272
viewsA: Java Infinite Loop
You can try in this part of the code add the following lines: } catch (Exception e) { e.printStackTrace(); } System.out.println("saida 1"); timer.cancel(); timer.purge(); } }; timer.schedule(tarefa,…
javaanswered Pedro Rangel 2,747 -
2
votes1
answer160
viewsA: Return a pre-built dialog in the onActivityResult method
You can follow the following code as example of changing an item name, and only make the appropriate changes to your case(Obs: item can be a created class can you or your image in your case):…
androidanswered Pedro Rangel 2,747 -
1
votes1
answer271
viewsA: When running an Activity I want the execution to wait for the shutdown to continue, or run sequentially the code
You can use: listmarcacoes.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView adapter, View viw, int posicao,long id) {…
-
0
votes2
answers89
viewsA: How to order Contacts by name?
Having to make a method for ordination: public List<Telefone> ordenarTelefones(List<Telefone> lista) throws Exception { Collections.sort(lista, new Comparator<Telefone>() {…
-
1
votes1
answer1948
viewsQ: How to change tab when sliding on the screen?
I have an Activity that has 2 tabs and wanted to know how to change tab not only when clicking on one of them, but also when sliding (left and right) on the screen. My Activity: public class…
androidasked Pedro Rangel 2,747 -
0
votes3
answers396
viewsA: Listview items losing color when using the scroll bar
After much pain I managed, vlw by the help @Wakim and @Cícero Moura: @Override public View getView(int posicao, View convertview, ViewGroup parent) { View view = convertview; ViewHolder holder =…
-
0
votes3
answers396
viewsQ: Listview items losing color when using the scroll bar
I’m using baseAdapter: @Override public View getView(int posicao, View convertview, ViewGroup parent) { View view = convertview; ViewHolder holder = null; if (view == null) { holder = new…
-
0
votes2
answers89
viewsQ: How to order Contacts by name?
I have the following code and would like to make an ORDER BY name: try { String clsSimPhonename = null; String clsSimphoneNo = null; Uri simUri = Uri.parse("content://icc/adn"); Cursor cursorSim =…
-
2
votes1
answer227
viewsQ: Error when customizing a menu using actionLayout
I was using to customize my menu items the actionLayout attribute but, the following error occurred: Layout menu_item.xml: <?xml version="1.0" encoding="utf-8"?> <TextView…
-
1
votes1
answer231
viewsQ: When to use onCreateView() vs onActivityCreated()?
I wanted to know the questions below: -When using onCreateView() vs onActivityCreated()? -Which of these two methods should I use to fill a listview with Adapter?
-
3
votes1
answer608
viewsQ: When you have a reference in Fragment through getActivity() should I use an interface?
My doubt is knowing the best way to work for the organization of methods, I will present 2 implementation options that I am in doubt, whenever I have in Fragment a reference through getActivity() I…
-
1
votes1
answer468
viewsQ: How to list the phones of all contacts?
I’m wondering: How to list all contacts(phone number and account name) of the cell phone?
androidasked Pedro Rangel 2,747 -
9
votes2
answers2765
viewsQ: What is the concept and how to implement an Anemic Domain Model?
I would like to resolve the following doubts about the Anemic Model: What is the The Anemic Domain Model? What are the differences of implementation of that model compared to Object-Oriented Model?…
-
21
votes1
answer5221
viewsQ: How does Design Pattern Observer work and how does it implement it?
I am in doubt regarding Design Pattern Observer, when its working and how to use(present practical example).
-
1
votes1
answer335
viewsA: Layout customization of Joptionpane
With the help of @Wakim with the use of Gridlayout I managed, as a result in the figure below: Code added below, resulting in the fields in the vertical position: GridLayout experimentLayout = new…
-
1
votes1
answer335
viewsQ: Layout customization of Joptionpane
I have the following structure of my Joptionpane, with horizontal typing fields: How to vertical the input fields? Here below is the class code: import javax.swing.*; public class…
-
4
votes2
answers1762
viewsQ: How to return the position of an element in the Hashset?
I have the following structure: HashSet<Contato> contatos = new HashSet<Contato>(); How to return the position of a particular Contact element that is contained in the Hashset? I was…
-
0
votes3
answers2626
viewsA: How to exchange information between classes?
You can use the following code below: Main1 class: import android.widget.TextView; public class Main1 { private TextView t; public TextView getT() { return t; } } Main2 class: import…
androidanswered Pedro Rangel 2,747 -
0
votes2
answers353
viewsA: How to increment variables
You can try using the code below, which will perform a sum(guardaX) of the values of x as with the variable y: import java.util.Scanner; public class SEP_06_exe2_p1{ public static void main(String…
-
7
votes3
answers3768
viewsA: Using Redis in practice
Banks Nosql, means "Not only SQL": These arose from the need to scale relational databases with ACID properties in high-availability web projects that operate on a large scale. Its main features are…
-
-2
votes2
answers3112
viewsA: What would Win32 be?
Differences 32 bits x 64 bits: 32-bit applications will run on both 32-bit and 64-bit Windows versions while 64-bit applications only works on 64-bit versions. One advantage that 64-bit applications…
-
8
votes1
answer12581
viewsQ: How to reverse engineer an android app?
As from an android app in the extension . apk, get the classes, layouts, libraries etc, ie, perform reverse engineering? Note: I used 7-zip as Bacco advised and resulted in the following file…
-
2
votes2
answers1167
viewsA: How to generate Math.Run from a value other than 0?
You can use the following functions: Returns a random number between min (inclusive) and max (exclusive): function getNumeroRandom(min, max) { return Math.random() * (max - min) + min; } Returns a…
-
6
votes1
answer5913
viewsA: What is the master theorem (master Theorem)?
Division and conquest The structure of many efficient algorithms follows the paradigm of division and conquest. This paradigm (or algorithm design strategy) consists of the following: The given…
algorithmanswered Pedro Rangel 2,747 -
2
votes0
answers134
viewsQ: What are the project organization standards?
Large companies use methodologies in the development of projects that result in an organization of software (packages, classes, interfaces). There are various patterns that a programmer can use, but…
-
0
votes2
answers3914
viewsQ: What are the life cycle stages of an Activity and Fragment?
What are the life cycle stages of an Activity and Fragment? What are the differences of these stages? And how can I identify at which stage an application’s Activity or Fragment is currently?
-
17
votes1
answer5399
viewsQ: What types of collections and their differences in java?
There are many types of java collections and I have difficulty knowing the following questions presented below: What are the differences between them? What situations and/or cases should I use each…
javaasked Pedro Rangel 2,747 -
1
votes1
answer1120
viewsA: How to set font size in PDF?
According to a post made in this link, can be useful for you: Link export PDF The problem is that Ireport uses Java/AWT for mounting and previewing the report and the PDF generator does not, which…
-
3
votes2
answers1201
viewsA: How to store information when leaving an application and recover in next use?
I recommend you use Sharedpreferences for being simple for your case(recording of an integer), which: Stores preferences in files; By default, they are shared between the components of your…
androidanswered Pedro Rangel 2,747 -
12
votes4
answers930
viewsA: Behavior of different ways of comparison in Java
Answer : Comparison using : "==" versus "equals" What is the Heap? Heap is a reserved and protected place of the JVM (Java Virtual Machine) where are allocated all instantiated objects during the…
-
8
votes1
answer998
viewsA: What’s the difference between "ON" and "USING"?
Answer: The ON is used when there are different or equal column names between the tables, USING is using when both tables share a column with the same exact name. To present the differences between…
sqlanswered Pedro Rangel 2,747 -
10
votes5
answers57768
viewsA: Count equal records with SELECT DISTINCT and COUNT
You can try using the following sql expression: select distinct id, CONCAT(nome, "(",count(id),")") as Nome from teste group by nome;
-
3
votes4
answers935
viewsA: Step-by-step operation of binary search algorithm
To solve your problem: I created a graphic representation, illustrating ALL steps (where the start, middle and end) of the search for the value element 57 of the following list, as requested in the…
-
3
votes1
answer1006
viewsQ: How to complement this sql query?
I have the following tables below, where schemes(columns) are described in parentheses and the primary key appears in bold: pupil(codpupil, named, dt_ticket, codcurso) course(codcurso, naming)…
-
0
votes1
answer329
viewsQ: What are the differences between sql commands?
What’s the difference, when I should use the following sql commands and which expressions can follow these commands? order by ,group by, join e union What is it for and when to use the commands…
-
1
votes1
answer184
viewsQ: How to create "dynamic" blocks?
How to create blocks similar to the figure below, which can be created, removed, resizable (modify its size in relation to height and width) and can be placed in different places of the layout by…
-
2
votes1
answer983
viewsQ: How to measure time complexity of sorting algorithms?
Given a sort algorithm, for example burble Sort, how to measure its run time? For example, let’s say that the input of the vector or list has a size of 1000 elements, what is the time measured in…