Posts by Costamilam • 9,556 points
509 posts
-
1
votes1
answer505
viewsQ: How to check if file exists in Firebase web Storage?
I’m making a web application with firebase, in this application I have an image registration (optional), similar to the idea of a profile (the user may or may not have a registered image if a…
-
-1
votes2
answers159
viewsA: Problem calling javascript function
I solved the problem by changing the function mudar(), instead of making a loop to show the data she received two parameters (key and name) and called the function by passing the values instead of…
-
-2
votes2
answers159
viewsQ: Problem calling javascript function
I am making a web application with javascript, my js file has several CRUD functions, I wanted when HTML was loaded, call two functions, so I added this code: document.addEventListener('load',…
-
1
votes1
answer347
viewsQ: Which database connection is best?
I started working and am updating the company system, it currently uses this connection: $link = mysqli_connect("0.0.0.0", "teste", "teste", "teste"); mysqli_set_charset($link, "utf8"); if…
-
-1
votes1
answer49
viewsQ: Security with Wordpress
I am updating a site and I have a question related to the security of it: In the database files the connection variable with the database is global; The PHP part is bundled with HTML; Variables of…
-
0
votes2
answers44
viewsQ: Add javascript to worddpress
I have an application that uses wordpress and I need to add a javascript in it, I saw several videos and posts on the internet and I understood just do this: <?php wp_register_script("meuscript",…
-
2
votes1
answer236
viewsA: com.google.firebase.database.Databaseexception
The problem was that the variable key was null, failed to assign the firebase generated key
-
0
votes1
answer41
viewsA: Class control Android internet connection - Wifi-3G
Just create a normal class with this method, and call in the constructor: public class Conexao { private boolean wifi; private boolean movel; public Conexao() { verificarConexao(); } public boolean…
-
4
votes1
answer236
viewsQ: com.google.firebase.database.Databaseexception
I looked for that mistake and I didn’t find it anywhere, just a few similar but not this: com.google.firebase.database.Databaseexception: Maps with non-string Keys are not supported Controller…
-
0
votes1
answer191
viewsA: How to generate a small set of alphanumeric characters in PHP?
A simple password generator, you can change the password size by changing the variable length, and possible characters by changing the variable characters. Source function…
phpanswered Costamilam 9,556 -
1
votes1
answer200
viewsA: Listview in another Activity
To send the data the correct is to set the values in a class (model) and send with the putExtra(): Intent it = new Intent(this, ResultadoActivity.class); it.putExtra("objeto", classModel);…
-
0
votes2
answers82
viewsA: Structuring the content of a course
Problem 1: You can use the Bootstrap, he owns a class col that can be used for this, can already leave responsive here. Problem 2: No javascript gets complicated, but you can use the :hover to…
-
0
votes1
answer1055
viewsA: Download images
I’m not sure I understand, but if you want a button to download an image, that’s it: <a href="caminho_do_arquivo.txt" download="Nome do arquivo"><button>Download</button></a>…
-
1
votes2
answers1441
viewsA: How to call a method of a Fragment in an Activity?
You can place this function in a model class and call instantiating: Classe c = new Classe(); c.mostrarMsg(this, "mensagem") You also need to pass the context public void mostrarMsg(Context…
-
2
votes1
answer29
viewsA: How to insert a data in your respective Acitivity via Sqlite
does several else if or switch case who sent it to their respective Act, in this example I suppose that the register is being made in the MainActivity: Intent it; switch(tipo) { case "encanador": it…
-
3
votes2
answers216
viewsQ: Use of Google Admob
I am using google admob to place ads in my app, but I have some questions I can use the same ad block (id) for multiple Activity (each with a block)? How do I make the ad the first thing to load?…
-
0
votes1
answer72
viewsA: Execute a code first of all
in the <body>you can put a onload with that function <body onload="nomeDaFuncao()"> Serves?
-
3
votes2
answers24
viewsA: Error returning vector in a method
the problem is that you are creating a method of type double and is returning an array of double change public double MediaMovelSimples(double[] valores) { for public double[]…
androidanswered Costamilam 9,556 -
-1
votes2
answers787
viewsA: I have to make a form in PHP that the cost and time of a car trip
You can use the google maps api, Through it you can give the point of origin, destination and mode (car, walk, bus...) and the maps te time distance among other various things, it is also possible…
-
0
votes1
answer62
viewsA: Problem picking up a GSON variable
The problem was that json returned travel_mode, and in the classes I created used travelMode, thought gson identified these small differences.
-
0
votes2
answers120
viewsA: Create a Generic Adapter
One option would be to create a Pessoa.java class and perform an instantiation in the other classes, for example Client and Employee, in case you would make an Adapter that would have the common…
-
0
votes2
answers28
viewsA: Jlabel does not receive new text
I think you want something like this: private void btnstartActionPerformed(java.awt.event.ActionEvent evt) { btnstart.setVisible(false); Random random = new Random(); int numeroAleatorio =…
javaanswered Costamilam 9,556 -
1
votes1
answer343
viewsA: Convert Html5 video time to hours, minutes and seconds - Javascript
A simple example with Angularjs <html ng-app="helloWorld"> <head> <title>Hello World</title> <!-- Biblioteca AngularJS --> <script…
-
3
votes1
answer56
viewsQ: How to create a non-circular geofence area?
From what I saw, the geofence creates a circular area from the measurement of the radius, in case it creates a circular area, but it is possible to create a non circular area? For example a square…
-
-2
votes1
answer62
viewsQ: Problem picking up a GSON variable
I’m making an app that uses the google maps Directions api, which returns me a json, for example: { "geocoded_waypoints" : [ { "geocoder_status" : "OK", "place_id" : "ChIJeRLP8gx3GZURImtwaSWGJgY",…
-
0
votes2
answers418
viewsA: Error . class expected
I created a function that returns a String (month of the year), works as follows: public String mesesDoAno(int i) { //Crio uma variável ArrayList ArrayList<String> meses = new…
-
3
votes1
answer160
viewsQ: Framework to read json google maps api
I was wondering if there is a framework to read the data that comes in the json of google maps Directions? type, take the data and put in variables that I can take and use in the rest of the…
-
0
votes1
answer128
viewsA: Google Maps Direction API only works the first time
I solved the problem by putting this line: polyline = null; at the end of drawRoute(): public void drawRoute(){ PolylineOptions po; if(polyline == null){ po = new PolylineOptions(); for(int i = 0; i…
-
0
votes1
answer128
viewsQ: Google Maps Direction API only works the first time
I have the following code that creates a route using the Google Maps Directions API: public class MapsActivity extends FragmentActivity implements GoogleApiClient.ConnectionCallbacks,…
-
1
votes3
answers41
viewsA: Turn into function
To create a function just put everything inside a function: function bsucarUsuarioId($id) { $resultado = mysqli_query($conexao, "select * from usuarios where id= {$id}"); $dado =…
phpanswered Costamilam 9,556 -
1
votes1
answer1765
viewsQ: Save android image
I know there’s probably an answer here on the site to my question, but when I researched I saw several ways and got a little lost. I wanted to create a hidden folder and have some ImageButton or…
-
3
votes1
answer336
viewsQ: Data sharing between android apps
I created an application that works as a calendar, where it is possible to register contacts with some more fields with respect to the schedules that comes preinstalled on the device. My question…
-
1
votes3
answers447
viewsQ: Take JSON object dynamically
I have json that I created and wanted to dynamically take the array and objects inside it var json = [ {'PHP': [ {'aula1': [ 'txt','O PHP é uma linguagem ...', 'img','caminho','descrição' ] },…
-
-1
votes3
answers455
viewsA: javascript onclick event with three functions
You can also do direct by HTML <button onclick="proto();doc();nome()" ...
javascriptanswered Costamilam 9,556 -
0
votes2
answers982
viewsA: Parse error: syntax error, Unexpected ';' in C: xampp htdocs edit-anuncio.php on line 68
I think that’s what you want: <?php if ($info['estado']=='0') {?> <option value="0" selected="selected">Não Pago</option> <?php } else { ?> <option value="0">Não…
phpanswered Costamilam 9,556 -
0
votes3
answers423
viewsA: How do I remove the characters from the variables in PHP to send to the database?
The explode() asks for 3 parameters the third one missing is the maximum amount of elements in the array, remembering that the explode generates an array. In your case I believe that what you need…
phpanswered Costamilam 9,556 -
0
votes1
answer1100
viewsA: Convert Roman Numerals
private void btnConverterActionPerformed(java.awt.event.ActionEvent evt) { int[] vaNum = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; String[] vaRom = {"M", "CM", "D",…
-
0
votes2
answers1043
viewsA: How to adjust an HTML grid
I suggest using bootstrap so it will be responsive: <img alt="" src="" class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <img alt="" src="" class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <p…
-
0
votes1
answer738
viewsQ: image view and text view side by side in linear layout
I have to put the image and the text side by side but do not know how to do, my code for now: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout…
-
1
votes1
answer499
viewsA: Switch case on Submit button according to button ID
This error occurs because the $_POST['id'] search for an input that has name="id", just tidy up your inputs by placing a name, so it will take the inputs that have the name="id" and give them the…
-
1
votes2
answers130
viewsA: How to identify a device?
Can be done by checking the screen size if (screen.width < 640) { // celular } else if (screen.width < 1024) { // tablet } else { // desktop } The screen.width should not be interfered by the…
javascriptanswered Costamilam 9,556 -
-1
votes2
answers713
viewsA: Dynamic grouping of JSON data
I know it’s been a while since I responded but I found a way to do what I wanted, just to update here function agruparJSON(coluna, valor) { var array = [] for(i=0;i<lUsuarios.length;i++) { if…
-
-1
votes1
answer955
viewsQ: Trying to get Property of non-object
I have this form: <form class="login" name="login" method="post" action="../controle/usuario-controle.php?op=logar"> <input class="input" type="text" name="txtlogin"…
-
0
votes1
answer78
viewsQ: Send user to an email app
I want to send the user to an email application, but I just want to set the recipient, the rest the user himself will fill in the application he chose and then send Has as?
-
1
votes1
answer406
viewsQ: java.lang.Indexoutofboundsexception: Invalid index 4, size is 4
I’m not sure what’s going on, when I long click on a list item, it sometimes works normally (open a screen where it shows the user the registered information, allowing them to change it), sometimes…
-
2
votes2
answers504
viewsA: Query with android sqlite java filter
By Log I realized that the registered variables were gaining a space at the end of them so a variable "x" for example was "x", so it did not work the if()
-
2
votes2
answers504
viewsQ: Query with android sqlite java filter
public ArrayList<Contato> filtrar(String filtro) { ArrayList<Contato> contatoArray = new ArrayList<>(); //Consulta que traz todos dados de todas colunas Cursor cursor =…
-
0
votes2
answers1120
viewsA: How to read Json with Android
You can also read a JSON using GSON (a library that converts Java objects to JSON and vice versa) Example of use: public class ApiCliente { private Cliente cliente; public Cliente getCliente() {…
-
1
votes2
answers3290
viewsQ: Capitalize the first letter of each word
I want to standardize what the user typed in edittext by capitalizing the first letter of each word and the rest lower case. How do I do this? The part that arrow the variables in the model class…
-
0
votes1
answer270
viewsA: onload redirect aleatorio
In HTML insert an onload that calls a function: <body onLoad="mudarPagina()"> Javascript function: function mudarPagina() { var random = Math.floor((Math.random() * 100) + 1);…