Posts by Eduardo Rafael Moraes • 710 points
64 posts
-
0
votes0
answers28
viewsQ: Android Unit Test -> Problems mocking a method that has static class
I am doing unit tests of my Viewmodel and have a method that saves the data in Firebase generating an id internally with the help of the Base64 class. In my class structure I call the…
-
1
votes0
answers239
viewsQ: unit test with mocked Json
I am trying to create a test from a json file that I have with the mocks of the Api response. But when I run the unit test the variable stream the return is null, ie it can’t read the file resulting…
-
1
votes1
answer17
viewsQ: Run call in retrofit 2
I am having trouble creating the call with retrofit 2 to the following url: https://api.themoviedb.org/3/movie/2310?api_key=MINHA_API_KEY&language=pt-BR On android, the call I’m making is…
-
0
votes1
answer54
viewsQ: Thread Android error that is crashing the app at the time of opening
I’m doing an initial project to test the functionalities of the Speechrecognizer library from google for android, but at the time if climbing the App I’m having problems, in this case it just closes…
-
2
votes1
answer170
viewsQ: Calculations with String in Java
I need to average some numbers I receive via JSON in the format of Strings, this calculation must return a value so that I can set it within a TextView on Android, but I’m not able to format this…
-
4
votes3
answers1697
viewsQ: Remove 2 specific characters from a String
Good afternoon ! Devs, I’m having trouble solving the following problem: In a calculator app, calculations always return a Double, which automatically inserts a decimal place even if it is to deploy…
-
-1
votes2
answers849
viewsQ: Condition within the WHERE clause
Good afternoon ! I have a task to perform a select, but the parameters are passed as variables and I need to treat the input of one of these variables with the following logic: if &CT is not…
-
-2
votes1
answer49
viewsQ: Call conversion from Java to Kotlin
I’m creating an app that will have a main Activity and some interspersed Fragments, in this case I’m trying to release a fragment_main but I can’t get this Java code to become Koltin code:…
-
0
votes1
answer596
viewsA: Python imports not found
I managed to solve my problems, I actually needed to configure virtualenv, probably because some of these Imports really needed it, so I ran this command: pip.exe install virtualenv and now it works…
-
-1
votes1
answer596
viewsQ: Python imports not found
I am facing some problems with downloaded Imports with pyPI, more specifically Imports Pypi Wikipedia and Google... I install both via Pip install and they can be found in the site-Packages folder…
-
0
votes1
answer283
viewsQ: recover txt file formatted with utf-8 in python
Good night! I’m having trouble recovering files. txt with python for popular lists or dictionaries, the problem is that these files do not come with uft-8 formatting. example of txt content: what is…
-
4
votes2
answers6030
viewsQ: Compare dates in Python
Good afternoon ! I need to solve the following scenario in python: I have one or more files . txt in a folder, but I want to return only the files that have the modification date according to the…
-
2
votes1
answer174
viewsQ: String search with character "|"
I need to perform a query in a txt file in Python, but I have 2 problems due to interpretation of special characters. When I insert | or \ the result is replaced: the | is addressed as white space…
-
0
votes0
answers42
viewsQ: TO_TIMESTAMP in Oracle Packages
I was doing some maintenance on object database oracle 11g, but in the middle of this adventure I ended up compiling and recompiling versions that gave error. I wonder if there is any way to perform…
-
1
votes1
answer680
viewsQ: Return Oracle PL/SQL string range
Good morning ! I need to return the value inside a string between a range of | in the select below I can get the value from the first |. The expected result is: 83,1 SELECT…
-
2
votes0
answers274
viewsQ: Send push notification with FCM direct from an Activity on android
Good night ! I’m having trouble adding the functionality of sending notifications to the users of the application, through the Firebase console these notifications are already sent and received,…
-
1
votes2
answers1328
viewsA: Problem dragging components in Android Studio
Good morning ! Henrrique, in this case this is happening because you are using Coordinatorlayout, which came by default when you created the project and the Main class. If you are a beginner in…
-
4
votes3
answers902
viewsQ: RETURN THE SUM OF MAXIMUM 3 SQL VALUES
I have a table and I need to return the following: check based on recipient column, add the 3 largest amount of that recipient, bring in query only if the sum of the 3 largest ones are >= 1024:…
-
1
votes1
answer98
viewsA: Accessing a specific component within a listview
I was able to find the solution to my problem and would like to share, in case anyone else has the same scenario I had, the solution was very obvious, ie the layout containing the component in which…
-
0
votes1
answer98
viewsQ: Accessing a specific component within a listview
I have a music list with a favorite icon, when the user clicks on this icon I want to change the color of the icon as the like action. In this structure I have an Activity, a listview in this…
-
2
votes1
answer1192
viewsQ: Count the number of records in firebase
Good morning Developers! I’m having a hard time in a project that I can’t move forward, here’s the problem/scenario: We have a screen that brings information, a message, and on the screen there is…
-
5
votes1
answer176
viewsQ: How do you check if two Drawables are the same?
Good night ! I’m having trouble recovering the current image from my android imageView. It is a favorite image for the user(dar like), and I want that when the user click on this image, I check if…
-
2
votes2
answers1957
viewsQ: background image of android screen
Good afternoon ! I am trying to put a background image in my application login screen, this image was downloaded from the site Unsplash, and when I put it in the background property of my layout the…
-
2
votes2
answers313
viewsA: Status bar with three-color gradient in Android Studio
for versions from API 21 you could set the status bar color as follows: Configure your app theme: <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your…
-
1
votes0
answers726
viewsQ: Change the text color of a button via XML by clicking on it
Good afternoon ! I’m creating a styleGuides for an android application and I’m having difficulty changing the color of the button text at the moment it is clicked by the user: In this example I am…
-
1
votes1
answer341
viewsQ: Converting JSON to android arraylist
Good afternoon! I’m trying to consume an API on android but I’m having difficulty because in the JSON file it brings a category, I tried to add the variable "acronym" but it did not work; the JSON…
-
0
votes1
answer100
viewsQ: A service that runs every day in the background on android
Good afternoon ! Perhaps my question does not fit the criteria perfectly because it is another question whether "it is possible or not possible". Here is the problem: I want to create an app in the…
-
1
votes1
answer67
viewsQ: Run service even if the app is not open
I am creating an alarm clock app and in the tests I would like it to wake up (in this example it still vibrates), but I am not able to make it run in the background and so does not end up awakening,…
-
0
votes2
answers112
viewsA: Capture the moment the mobile screen was lit and when it was deleted
Thank you so much for your help, and I finally got what I wanted, capturing the SCREEN_ON and SCREEN_OFF event and so I’d like to share the full code so I can help other people who need it, follow…
-
0
votes1
answer47
viewsQ: FATAL EXCEPTION main when using service on android
Good night ! I’m trying to generate a service that can identify when the screen of the mobile phone is erased or access, so I followed some tips to get to this point that is a simple test code, but…
-
1
votes2
answers112
viewsQ: Capture the moment the mobile screen was lit and when it was deleted
Hello ! I’m building a project similar to an alarm clock but I’m having a hard time trying to use the broadcastreceiver class. Problem: I want to capture the date and the exact time that the mobile…
-
2
votes2
answers402
viewsQ: Configure list-group with scrollspy bootstrap
Good night ! I’m struggling with one of the layouts of my project in which I have a div divided into 3 parts, where the top right will contain cards that selected will bring the data into a list at…
-
1
votes1
answer2700
viewsQ: I can’t use bootstrap glyphicons
I am not able to use the bootstrap glyphicons, just do not appear, I am using a linux machine, and I know it is something related to fonts folder because it did not come in the common bootstrap…
-
0
votes1
answer1658
viewsQ: Remove the last value found inside a string
I need to take an average of payment conditions in the database and I came across the situation where the condition column is a string and it can receive parcel values separated by bar. I need to…
-
0
votes2
answers536
viewsQ: Running threads on android
I’m new at work with threads on Android and I’m having difficulties to implement them. To thread will be used to make a calculation and finally send an email depending on the result of the…
-
1
votes0
answers490
viewsQ: List data from an API on android
Hello, I’m trying to list data from a web API, as I’ve never listed this way I’m finding problems to understand the solution of the listing, the API Url returns some values I want to list them in…
-
0
votes1
answer549
viewsQ: Android Application Consuming Webservice
I’m trying to create my first app to make use of a Webservice, in which case I’m just trying to return some of the information via string and later put each piece of information in its proper…
-
0
votes1
answer362
viewsA: Find text in sequence in a string
Well, I managed to solve the problem here, doing as below I will always have the order value(in this case if the request contains the same number), or I can hide the value of the substr then it will…
-
0
votes1
answer362
viewsQ: Find text in sequence in a string
I have this String in oracle: 'Order linked with Sale : 4575987/10' and I would like to return only the order number in this case the 4575987/10. Until now the maximum I could is passing a fixed…
-
1
votes1
answer966
viewsQ: Convert input to date with oracle
I’m having trouble returning the results of the following query, where I put the variable &mes, if I put '01-Sep-2017' would bring the results I need, but in the dialog box wanted the user to…
-
1
votes1
answer147
viewsA: Insert data into firebase from Alertdialog
Well, assuming you’ve already created your Alert or know how to create it because you haven’t posted any code, you can do the following: Assuming the user enters some data in edits, and Alert has a…
-
0
votes2
answers49
viewsQ: Change the color of a list according to a certain variable
I’m trying to get my schedule list to have each line with different colors for each category that was defined, this list is filled by data recovered from firebase that goes to the model class,…
-
0
votes1
answer863
viewsA: How to enable Firebase persistence offline
I did some research on the Internet and I can get it right according to the structure of the project I’m building. To solve the problem and enable Firebase offline data persistence I needed to add…
-
0
votes1
answer863
viewsQ: How to enable Firebase persistence offline
I’m having trouble enabling firebase’s offline data persistence in my app. The problem is this, I have an auxiliary class called Configurationfirebase which starts the required firebase objects, to…
-
0
votes2
answers131
viewsA: Assign values to a Alertdialog views
Francisco, at these times I normally create Dialogfragment, which follow the principles of common Fragments, receiving layout.xml and everything else and the form of deployment is very simple, for…
-
0
votes1
answer283
viewsA: Problems creating Child in Firebase
I don’t know if I got it right but from what I got from your story, I’d make the bank with that structure: .... in saving your model class would look like this: public void Salvar(String key){…
-
0
votes1
answer830
viewsA: Problems to list firebase data on android
Apparently the problem was related to the fact that when I saved the data I didn’t add any kind of key, just pure data at the nodes, so I added an encryption precisely at the node that I needed to…
-
1
votes1
answer830
viewsQ: Problems to list firebase data on android
Good morning ! I’m having trouble listing data from a certain node in my application... when I list it as the codes below I get the following return from Exception:…
-
2
votes2
answers83
viewsA: Listview surpassing Toolbar
Good night Artur! try this way, I believe it is only because the configuration is missing Below: <android.support.design.widget.AppBarLayout android:id="@+id/toolbar"…
androidanswered Eduardo Rafael Moraes 710 -
0
votes1
answer210
viewsQ: Use Searchview to search for a populated model class with firebase
Good night ! I am stuck in a problem, in this I have a list of items I receive from firebase, in this list I have visibly 3 attributes of the model class (idAtivity, title and time), thus, I would…