Posts by emanuelsn • 3,570 points
47 posts
-
4
votes1
answer252
viewsA: Mysql Deprecated
The message itself already says the problem: the functions mysql_* were discontinued. So, as discontinued, it is already obsolete and in future versions of PHP, the functions mysql_* will probably…
-
5
votes5
answers5756
viewsA: What is Design Pattern?
A Pattern design is a general solution to solve a problem that occurs frequently in a software development/design context. The biggest reference I know about Pattern design is the book Design…
-
7
votes2
answers928
viewsA: Best practices in the interaction between Activities
You have 5 activitys equal. And you can improve it. Today, you only show the Synopsis of the film. Can you imagine if you need to show off, besides the synopsis, the main actors? You would need to…
-
5
votes3
answers6934
viewsA: Symbol "->" in php
The official name is Object Operator, but I see people calling it 'arrow', 'arrow' and 'arrow''. This is an operator used to access the methods of an object. For example, when you use…
-
3
votes3
answers1573
viewsA: How to send parameters to a server?
Android Studio problem does not recognize the HttpClient, is that he stayed deprecated in API 22 and was removed in API 23. The solution I found to work with requests on a server/webservice, was to…
-
6
votes1
answer873
viewsQ: How to access data from the innermost "level" of a JSON?
I needed a way to access the innermost "level" of JSON below: (name, value, last query and source) { "status": true, "valores": { "USD": { "nome": "Dólar", "valor": 2.333, "ultima_consulta":…
-
2
votes2
answers224
viewsA: Doubt about Indexeddb
In your case, the problem is that with PK is the COD_IDENT_TURMA field, it does not accept two records with the same key. An alternative would be to make the table have the composite PK…
-
6
votes1
answer1106
viewsA: How to get the battery percentage?
I’ll partially answer your question. To regain battery level, you need to fire an Intent-Filter to ACTION_BATTERY_CHANGED. Below is an example of code that also programs a BroadCastReceiver to be…
-
11
votes2
answers3761
viewsA: How to select all id’s except one?
Besides the way you’ve already asked your question, not equal to ( != ), can do in other ways: Using the other than: Select * From Utilizadores Where id_ut <> 1; Using the not in: Select *…
-
3
votes2
answers6065
viewsA: Counting lines reached PDO
In order for you to get back the amount of affected lines, you have to use rowCount();. Probably, $linhasafetadas = $sqlCODCEL->rowCount() will solve your problem. An example: <?php /* Delete…
-
6
votes2
answers7055
viewsA: What is the purpose of the sizeof command?
The operator sizeof indicates the size, in bytes, of the variable type. This operator allows you to avoid specifying computer-dependent data sizes in your programs. When you say: I know I can use it…
-
1
votes5
answers3537
viewsA: Make div disappear
If you use style="display:none;" your div will be there, but will not be visible. See below for an example. function mostraDiv(id,div2) { var divstyle = new String(); divstyle =…
-
7
votes4
answers13678
viewsA: Rounding a decimal to a lower decimal
You can use the .toFixed to define how many decimal places you want. Take an example: var numObj = 12345.6789; numObj.toFixed(); // Returns '12346' numObj.toFixed(1); // Returns '12345.7'…
-
7
votes3
answers533
viewsA: Pure Java and Android App
If you already know/have knowledge in Java, will have more ease with Android, since in Android Studio you will work with java.. (You can also develop using C# and Javascript). Regarding the…
-
1
votes1
answer189
viewsA: Doubt of beginner javax.imageio library
The problem is that this class is not supported for Android. In case you try to search this class on Developer.Android, you’ll see she doesn’t show up. According to that one question asked on Soen,…
-
4
votes1
answer113
viewsA: Change color of overflow button
According to this answer in Soen, you can change the color of the Overflow Button thus: <style name="MyCustomTheme" parent="style/Theme.Holo"> <item…
-
14
votes2
answers3101
viewsA: What does "region above the fold" mean?
"Above the fold, "or top fold of the page, refers to the portion of the page that users can see without scrolling to its bottom. This term is usually linked to the display of advertisements on…
-
6
votes1
answer1111
viewsA: What is the difference between == and == in one condition?
The operator == only checks that left and right values are equal. The operator ===, checks if left and right values are equal, and also checks to see if they are of the same variable type. $a == $b…
-
7
votes2
answers1027
viewsA: Start app with splash screen image
This resource you seek is called SplashScreen. First, create a layout with the image you’d like to appear at the beginning. (Remember that it should be in the Drawable folder) You’ll have something…
-
4
votes2
answers4418
viewsA: What does it mean to create an object with that asterisk?
When there is an asterisk next to the variable name it means it is a pointer. But, it is also possible to declare pointers keeping the asterisk next to the variable type. The two forms below have…
-
3
votes1
answer104
viewsQ: Nullpointerexception when trying to open database
I’m trying to include in DB an item that was selected, but when trying to open the database using the .open(); I’m getting an error of NullPointerException. After the user selects which item to…
-
3
votes2
answers87
viewsA: Pass typed value to another method
You are already passing the String cpf when you do: contarSolicitacoesEmprestimo.Contar(cpf); Now, the problem was at the time you were assembling your sql. When you do, sql.append("WHERE socio.cpf…
-
1
votes1
answer95
viewsA: How to integrate android with visual studio 2013?
Objectively answering your question: Yes. It is possible to develop to Android using Visual Studio. To develop your apps, you have two options: Xamarin (using the C language#). Cordova (using html +…
-
30
votes3
answers12225
viewsA: What is deadlock in SQL Server?
This illustrates well what a deadlock: There are four conditions for the occurrence of deadlock: Mutual exclusion condition: At a given time, each resource is in one of two situations: either…
sql-serveranswered emanuelsn 3,570 -
6
votes3
answers8025
viewsQ: Difference between decimal and Numeric
The two types of data, DECIMAL and NUMERIC, are/can be used to store exact values. For example: Is there any difference between Salario DECIMAL(5,2) and Salario NUMERIC(5,2) in Mysql? Is there any…
-
12
votes1
answer4382
viewsA: Split the app screen into two layouts
You can work this way using the attribute weight (Heaviness). Note the code below: <?xml version="1.0" encoding="utf-8"?> <LinearLayout…
-
1
votes2
answers86
viewsA: Application closes at the touch of the button
To validate whether the field is empty use the property length. The way you did, you are (was) comparing whether the EditText is equal to 0. In your example it would look like this:…
-
0
votes1
answer738
viewsQ: Change the visibility of a layout’s fields at runtime
In a layout for client registration, there are the specific fields for Legal Entities and Individuals. Control of the type of registration is done by RadioButton who are inside a RadioGroup. I…
-
20
votes2
answers70450
viewsQ: Error trying to run Eclipse: Java was Started but Return Exit code =13
After having the hard drive changed, I downloaded and went to try to run the eclipse and it returned the error: Java was started but return exit code =13 What is causing this error?…
-
23
votes2
answers70450
viewsA: Error trying to run Eclipse: Java was Started but Return Exit code =13
First, check if the JDK is installed. Once installed, check if the variable PATH was configured. For that reason, Right click on My Computer and go to properties; Click Advanced System Settings;…
-
0
votes1
answer175
viewsQ: Problem retrieving item clicked on Listactivity and return it to previous Activity
I have an Activity where I call another Activity using the startActivityForResult. In the Activity that was called, I have a list filled by products already registered. In this list, I needed to,…
-
43
votes1
answer10807
viewsA: When and how to implement Parcelable vs Serializable?
Come on: 1. When to use (choose between) Parcelable vs Serializable? Using Serializable is easier and faster to implement. However, performance is worse. Using Parcelable takes a little more time to…
-
5
votes2
answers75
viewsA: What is the error in this return exercise: Object orientation
Are two mistakes: 1st - In your class Matematica, take off the return 0. There’s no reason he should exist there, since, if um > dois, will return um. If not, return dois 2nd - The other error is…
-
1
votes3
answers230
viewsA: SQL Query export for excel
I believe that’s it: var query = "SELECT * FROM indisponibilidades WHERE estadoIndisponibilidade = 'ABERTO' /* todas em aberto*/ OR (dataInicio = '" + dataPedido "') /* todas que foram abertas no…
-
-1
votes4
answers1944
viewsA: Run query that concatenates parameters (@p) in Firebird
I’m not sure I fully understand your question, but come on. Table: Product Code | Name | Complement 1 | Pencil | Black 2 | Pen| Blue Select Codigo, Nome, Complemento, Nome|| ' COR' || Complemento as…
-
2
votes3
answers3561
viewsA: Java and Offline Databases
Another option is to use the H2 Database. I used it on an app not long ago, and I liked it. Click here to access the official H2 Database page Click here for a tutorial with Eclipse, or Click here…
-
1
votes2
answers68
viewsQ: After clicking on any Listactivity item, always the first record is loaded
Good people, I’m having a problem loading a record from a ListActivity. When I click on some item of ListActivity, my application must open the registration screen for me to edit some data. So far,…
-
9
votes3
answers407
viewsQ: Generate setters only in class constructor or generate outside constructor
In Java classes, it is common (At least in college I only see it that way) create private attributes and generate getters and setters for these attributes. But I read that you can do something a…
-
0
votes2
answers353
viewsQ: Listview does not display loaded BD data
I have a query screen, where she should display the items already registered. It just doesn’t show. At first, I thought it was because the information wasn’t being recorded in the comic book, but…
-
5
votes2
answers2122
viewsQ: what is tools:context in layouts files?
Good morning, everyone. In some tutorials I’ve been seeing around, the creators defined this property, 'tools:context' in the main layout manager of xmls. I looked in Ricardo Lecheta’s book, but he…
-
2
votes2
answers5630
viewsQ: Keep image next to text inside a button
Maybe it’s a simple situation, but I’ve already cracked my head a little bit here and I haven’t succeeded yet. I have a button, and inside it I upload an image and text. <Button…
-
1
votes1
answer130
viewsQ: Is working with 'Weights' viable?
I’m mounting a layout here and after include the property: android:layout_weight, the eclipse returns a warning: 'nested Weights bad for performance'. Why work with this property, is it bad for…
-
27
votes1
answer1896
viewsQ: What’s the difference between "@id" and "@+id"?
When creating a component, we use @+id/nome to identify him. For example: <TextView android:id="@+id/tv_fornecedor" android:layout_width="match_parent" android:layout_height="match_parent"…
-
0
votes1
answer297
viewsA: Click button works on emulator, but does not work on mobile
Solved The problem was time to convert to 2 decimal places. You must change the line String[] part = string.split("[.]"); from the convert method: String[] part = string.split("[,]");…
-
0
votes1
answer297
viewsQ: Click button works on emulator, but does not work on mobile
I have a button and 2 values. When I am in the emulator, everything works great.. But when I export the app and install it on mobile, the same button doesn’t work. package br.emanuel.imc; import…
-
3
votes1
answer1651
viewsQ: Error opening new Activity
I’m picking up here to be able to make the click on a button, open a new Activity. I looked at the Android documentation on Activity, Intent, the methods to create and yet yes, it doesn’t work.…
-
1
votes2
answers382
viewsQ: Click on the button does nothing
I put a button on activity_main and I made a second canvas. The idea was, by clicking the button, to press this other screen. And in the class MainActivity.java I put that when I hit the button, I…