Posts by regmoraes • 2,803 points
92 posts
-
-1
votes2
answers5089
viewsA: Find the Sqlite database folder in android studio
Take the following steps: In Android Studio, go to Tools > Android > Device Monitor In the Device Monitor, in the left corner, select the device that is running Select the tab File Explorer…
-
1
votes1
answer755
viewsA: How to set a checkbox as checked?
The problem is that in your main.xml there is no element of Checkbox, therefore, when trying to set d2201 as checked, error occurs. @Override public void onCreate(Bundle savedInstanceState) {…
-
10
votes3
answers694
viewsA: What best practices when implementing requests?
If you are using JSON, you can use Retrofit to make the requests. In Retrofit it is possible to make synchronous and asynchronous calls in case of asynchronous calls (outside the Uithread), you…
-
0
votes3
answers57
viewsA: How to prevent the user to enter a "." point before any number?
If you’re doing calculations with double, then by default, numbers with "." on the front are accepted and do not disturb the calculation. But if you want to prohibit the use of "." before a number…
-
1
votes2
answers276
viewsA: Insert sqlite in android app
The first thing to do is copy your file "meubanco.db" to the android app folder. For this, do the following: Create a folder called Assets in: Camiodoprojeto/app/src/main Copy the file "meubanco.db"…
-
2
votes1
answer193
viewsA: Android Toolbar occupying all layout space
In his file Toolbar.xml , make the following changes: Change the line android:layout_height="match_parent" for android:layout_height="wrap_content" Add the following line:…
-
6
votes1
answer6498
viewsA: How to Build a Webservice to Synchronize Android and Mysql Sqlite Database
You can use the combination JSON API + Retrofit. Explaining a little: You must create a data pattern so that both your application and your remote database can "understand" the information that is…
-
1
votes1
answer3833
viewsA: Redirect page after an email form
Create the page redirect.php - which will be the page that checks the form data and will redirect the user to the thank you page - and write the following code: <?php if…
-
1
votes2
answers455
viewsA: Questions about database and Android
If the game is for Android, you will need to use the database Sqlite and the Sqliteman to manage your database data more easily. A simple example of how to structure your information would be to…
-
3
votes1
answer3315
viewsQ: Ensure that generic object passed as parameter is subclass of an abstract class
First I would like to say that my doubt is not specifically about "verify that a generic object passed as parameter is subclass of an abstract class.", but I couldn’t pick a better title. If you…
-
-1
votes3
answers1481
viewsA: How to create a mini database written in php using a text file in json format
I think the ideal, and the safest, would be for you to make a copy of the database file and then make the necessary changes to it. Therefore, I recommend that you use the provided tools themselves…
-
0
votes1
answer718
viewsA: How to create button in a Simpleadapter with event click excluding item
To catch the clicked element and its position in a List View you must make your List View implement the method onItemClickListener. Suppose you have a List View where each item is one Usuario. To…
-
2
votes1
answer645
viewsA: Prevent user from copying android application
It is very difficult to make APK 100% protected for the following reasons: Any user with a phone rooteaded can copy your APK and study it. With tools like leave and Jd-Gui if you can see all the…
-
3
votes1
answer151
viewsA: How to send a die to an already created Activity?
You can use the method startActivityForResult() which allows a Activitya call a Activityb and receive a return from it. To do this, in your Activitya call on the Activityb using the method…
-
2
votes1
answer359
viewsA: Which one calls sharing?
To call the sharing screen, use this code Intent minhaIntent = new Intent(); minhaIntent.setAction(Intent.ACTION_SEND); minhaIntent.putExtra(Intent.EXTRA_SUBJECT, "Título da ação (ex.:…
-
7
votes1
answer1544
viewsA: How to get the predominant color in an image?
You can use the library Palette Android, because it allows you to extract the color of the image in a simple way ( without having to use histograms, etc.). This library allows the generation of…
-
0
votes2
answers196
viewsA: Download Genymotion Plugin to Eclipse
At first you are doing it right. Adding the download link and pressing 'Add' to search for the plugin. You could give more details about the step by step you are doing and what messages you are…
-
2
votes1
answer422
viewsA: Mockito-Android Test return method
The problem is that you are trying to test a "mocked" class, that is, you are not testing the real class but a "default" instance of it. That’s why when you give loadTexture() is returned null.…
-
3
votes2
answers198
viewsA: Listview infinity on android
The main problem is that you are making a query and returning a list of Students. Ideally you would use a CursorLoader and a CursorAdapter. The main advantages of using CursorLoader sane: Data…
-
1
votes3
answers464
viewsA: Components are not in class R
The error is not in the generation of the R class or in the layout, but in the build.Gradle file, that is, your project build configuration file. The two images you posted clearly show that the…
-
0
votes1
answer36
viewsA: Elaboration of an application for publishing events
From what I understand, your question is related to how to notify all users when adding a new event in the app, right? In that case, you must use Push Notifications, which is a method that allows…
-
1
votes1
answer321
viewsA: Change the color of the List View item if it is disabled - Android
To do this properly, you need to create a Adapter which will receive your user, perform the active and inactive check and create an item from ListView for him. You will need to: A class ( e. g.…
-
2
votes2
answers850
viewsA: How to update a listview from the bar action button
Assuming you’ve already created an xml file for the menu items and you’ve already determined that your Action Bar will use this file to generate the menu items, the next step will be to determine…
-
0
votes2
answers1344
viewsA: How to set random images in Imagebutton
You can identify the ids of each drawable and pass them as parameter in your method setBackgroundResource(). For this, use the following code: int id =…
-
5
votes3
answers10404
viewsA: Clear content from my netbeans java console
To clear the console, you can create and run the method below, which identifies the OS and executes the appropriate command to clear the console: public final static void clearConsole(){ try{ final…
-
2
votes1
answer448
viewsA: List View - returning more than 1 data in a row
To show more than one information in an item of a List View it is necessary to create a layout customized for items from List View and a List Adapter, which serves to associate the inforamations of…
-
4
votes1
answer56
viewsA: How to support foreign languages in android apps?
To support foreign languages, you must create a folder values-"Cod" - where "Cod" is a two letter code that identifies the language you are supporting. You can refer to this table to view other…
-
1
votes1
answer157
viewsA: What is the best way for an Activity to call itself?
You can implement your Asynctask class using the default Singleton. This way, you ensure that during the execution of your application there will be only one instance of Asynctask. It would look…
-
11
votes4
answers1233
viewsA: What is the difference between OO and DDD?
Actually there are differences between OO and DDD, but both fit. Quickly explaining: OO is a paradigm of programming and modeling whose purpose is to realize an abstraction of the functioning of the…
-
20
votes3
answers21628
viewsA: Definition of the "Big O" notation
It’s kind of hard to give an informal response to this kind of content, since it requires a knowledge of function limits, but I’ll try anyway: Given two non-negative functions f(n) and g(n), whose n…
-
4
votes2
answers99
viewsA: Preset in Javascript function parameters
There are several ways to do this, one of them is the following: function foo(a, b) { a = typeof a !== 'undefined' ? a : 'seu_valor_default_a'; b = typeof b !== 'undefined' ? b :…
-
2
votes1
answer434
viewsA: Android Toolbar hide Search when it is open
The problem you are experiencing is related to setting the menus that make up the Action Bar in each Fragment. It looks like you are using the same action bar menu file for different Ragments, so…
-
0
votes3
answers1949
viewsA: Implement and perform joint operations on chain lists
To make the union between two lists, just go through the list 1 until the last "valid element"( !=null) and add to list 2 as next to this element. public static void uniaoLista(Lista l1, Lista l2){…
-
0
votes1
answer34
viewsA: Capture Form Expandlelistview Fields
In order to handle click events on the elements that make up the layout of the child items in the list, you can add click listeners for each element within the method getChildView() from your…
-
1
votes1
answer69
viewsA: key from the same table
Explaining the response of @Rafael Withoeft: You must have a foreign key ( FK) in your table categoria_son that should reference the parent category code table categoria_pai and should also specify…
-
3
votes3
answers185
viewsA: Problem with program that prints three numbers increasingly
There is a problem in logic, because as you said yourself, you are not covering all the possibilities. Also there is a problem of semantics in: if(a<b<c) { //seu código } It is not possible to…
-
0
votes2
answers180
viewsA: How to use html tag as <b> in android
Apparently, you will not only have a dialog with information arranged in this format: Topic 1 Text of topic 1 Topic 2 Text of topic 2 Topic 3 Text of topic 3 Right? If this is the case, I think it…
-
2
votes1
answer2618
viewsA: Chained JAVA Lists
It’s very simple, just create a recursive function that traverses the list elements where the recursive call happens before printing the elements: public void imprimeContrario(Lista l) { //verifica…
-
2
votes1
answer794
viewsA: In the Actionbar Menu, how to allow the icon of an item to be always visible, and the text only when there is space?
It is not possible to assign more than one "showAsAction" type to a single menu item. When trying to do this, the following Exception is launched: java.lang.IllegalArgumentException:…
-
1
votes1
answer140
viewsQ: Problems to delete a "circle" object that is on google-maps
I’m having trouble deleting circle type objects (API google-maps) that are being shown on my map. I have a function that receives JSON data and creates a global array (arrayElements) containing…
-
1
votes1
answer2475
viewsQ: How to pass JSON array as parameter and access its objects in another function?
Hello, I’m having trouble accessing objects from a json array that is passed as a parameter between functions of two classes. In the functions that receive the json array, the corresponding…
-
3
votes1
answer1341
viewsA: Menu Navigation Drawer with Expandablelistview
To implement a Drawer navigation with expandadle list view, you will need basically two classes: 1- Navigationdrawer: Main Activity that will contain the navigation Drawer. 2 - Adapterdraweritem:…