Posts by viana • 27,141 points
761 posts
-
3
votes2
answers4388
viewsQ: Error creating table: Invalid default value for
I went to create a table in the bank and appeared following error: Invalid default value for "updated_at" Here is the table to create: CREATE TABLE `user` ( `id` INT( 11 ) NOT NULL , `uuid` CHAR( 12…
-
1
votes1
answer4897
viewsA: Error cannot be resolved to a type
The error is because you do not have any class with the name Livro. Based on its main, you must create the class Livro as follows: public class Livro{ String nome; String descricao; double valor;…
-
4
votes2
answers471
viewsA: Error generating Key Store
You must put the complete path into which you want to save your .jks. If I have been using Windows, default path is drive C:\ then it would be this way: C:\Users\paiva\Desktop\.....\novachave.jks…
-
10
votes1
answer6201
viewsQ: What is procedural programming and not procedural programming?
Li in that reply, but without many details, that: "[...] procedural programming is an evolution of programming structured [...]" And in this answer also: [...] procedural programming is something…
-
0
votes0
answers33
viewsQ: Dynamic size user adjustable view
I have a LinearLayout where I need the user to adjust its size dynamically. Basically it would only be its height, the width can be a fixed size, being match_parent. The property in which it would…
-
1
votes2
answers507
viewsA: Error entering data in Sqlite database
Translating the error: Please fix your application to finalize ongoing transactions and close the database when it is no longer needed. Look at you, you’re calling the mDbHelper in the method…
-
8
votes2
answers523
viewsQ: What is an extensible language?
I found some definitions on extensible language, from English Extensible language, in which it is defined that it is a language that the programmer himself can modify it. However, I did not…
-
19
votes1
answer361
viewsQ: Check if a screen screenshot has been taken
The Snapchat has a feature that is to notify the user every time someone, any other user, takes a screenshot of their stories. At first I thought about the hypothesis of checking if the user pressed…
-
2
votes1
answer55
viewsA: Programmatically set button text color
To set a color for the button text you need to use the attribute setTextColor(). Then to redeem the color you can use the static method getColor() of the public class Contextcompat. Take an example:…
-
1
votes1
answer55
viewsQ: Programmatically set button text color
I have a button created in my class Main via code, that is, programmatically. See: Button btnJonSnow = new Button(this); btnJonSnow.setText("Jon Snow"); How can I program the color of the button…
-
2
votes1
answer297
viewsA: How to use gif on Android?
There are a few possible ways to do this. One of them, which would be the easy way, is to import a ready-made module, as for example android-gif-drawable. Even though it is already in the…
-
1
votes1
answer400
viewsA: Saving Webview history/cache
A possible solution, in the case of WebView, is you save the form data using the method setSaveFormData() using the public class Websettings. See below for an example: WebView webView = (WebView)…
-
6
votes1
answer772
viewsA: Converting Textview value to double
There are several ways to limit the number of decimals. See below some: String format.() double value = 2.085; String strValue = String.format("%.2f", value ); Decimalformat double value = 2.085;…
-
2
votes2
answers755
viewsA: Where to store API connection credentials on Android
Several applications, both for Android and IOS, require credentials for use. One way or another, you can create applications that can be used after creating an account or also applications that you…
-
1
votes1
answer66
viewsA: Internalization file, how to create?
Very succinctly, you just need to create a directory, for example values-en within the res. The en means it is English. It could be fr, French, and so on. This way for each key, you make the…
-
2
votes1
answer501
viewsA: Android send message to various Whatsapp contacts
To date, Whatsapp has not yet offered any support for sharing any content to multiple contacts simultaneously. In his FAQ page, is mentioned the steps needed to share with a single person (which…
-
1
votes1
answer1721
viewsA: Update Files in Bitbucket
After having already installed the git, to propose changes in your repository you can use the add. Behold: git add <arquivo> # podes mandar um único arquivo pelo nome git add . # podes mandar…
-
1
votes2
answers407
viewsA: How to Store Splitted Strings in an Arraylist?
See a simple way using the static method Arrays.asList(), but "splintando" spaces: String str = "A HBO anunciou a sétima temporada de Game of Thrones"; ArrayList<String> arrayList = new…
-
1
votes2
answers1579
viewsA: Vertical alignment of columns
There are several ways to align vertically. I found this way that can solve your problem. See: .outer { display: table; position: absolute; height: 100%; width: 100%; } .middle { display:…
-
2
votes1
answer351
viewsA: List files from a specific folder
In addition to granting permission on AndroidManifest.xml, from Android 6.0 (API 23 level), users grant permissions to applications while they are running, not when they are installed. You can…
-
5
votes1
answer214
viewsQ: What is the difference between Preference and Sharedpreference?
Seeing some forms of data persistence on Android, I realized that has two interfaces very similar PreferenceChangeListener and SharedPreferenceChangeListener, which can be extended in the classes…
-
2
votes1
answer223
viewsA: Android Studio does not matter Adrequest or Adview
I think you have a serious problem with the AdView. Not to be appearing option to import, there is only one reason: Did not compile the lib in the Gradle. See how: dependencies { compile…
-
3
votes1
answer98
viewsA: How to execute requests in order?
From what is perceived then, one request is dependent on the other. In order to work correctly, you must call the next request only if the first request has already returned some result. As it is…
-
4
votes2
answers1407
viewsA: How to Transform Time String to an Entire?
There are several ways to do this. Another other than Guilherme would be, for example using the SimpleDataFormat to convert the string in date format, and then use the class TimeUnit converting…
-
3
votes2
answers173
viewsQ: Create a Resource string or a class of counters?
I have an application where I use data persistence with SharedPreference. From the beginning when I started creating applications, I always created a class, for example, with name Consts to store…
-
15
votes2
answers2880
viewsQ: What is cyclomatic complexity?
Regarding the complexity of algorithms, I observed that there are several citations about cyclomatic complexity. What is cyclomatic complexity? In which situation is it important to analyze this…
-
1
votes1
answer193
viewsA: What is the function of Appium in android studio?
Appium, as it says on the site itself, is a tool open source and cross-platform for automated testing for native, hybrid and mobile applications. What are its features? Appium allows you to create…
-
12
votes1
answer1016
viewsQ: What is Python Egg?
Reading a book about Python, the author shows a command in which it is possible to create a Egg and make upload of your package on Pypi (python official package repository). Basically using the…
-
1
votes1
answer1395
viewsQ: How to convert a date to timestamp in python?
I have a certain date in a variable in that format d/m/Y. Behold: strDate = "29/03/2017" How to convert that date to timestamp in Python?
-
0
votes1
answer217
viewsA: How to Install Appium
To use the Appium in its application, must first download the appium library, whose extent is .jar. Then just follow the initial tutorial identified on the Appium website itself.…
-
8
votes5
answers10407
viewsQ: Identify if there is an uppercase letter in the string
I have declared two certain variables, one of which is uppercase and the other only lowercase. See the example below: actor = "Jon Snow" pet = "wolf" How can I identify if it exists at least one…
-
2
votes1
answer518
viewsA: Webview does not show the page
The way you are doing it is correct, however you need to grant permission to access the internet in your AndroidManifest.xml to open the page through your WebView. See below: <uses-permission…
-
2
votes2
answers1453
viewsA: Leave app only in portrait mode
Beyond the way Leofontes demonstrated defining the attribute android:screenOrientation as portrait in his <activity> located in the AndroidManifest.xml, you can also insert programmatically…
-
1
votes1
answer197
viewsA: MVP - What is where?
The model is responsible for the data that will be displayed in the user interface. We could consider as a model, besides the data, any logic of manipulation and access of this data. The view,…
-
3
votes1
answer76
viewsA: Forms of monetization in applications
There are 3 basic forms of monetization: Free (with ads) Freemium (with purchases made within the App itself) Paid (with a specific value to carry out the installation) [...]easier to apply in my…
-
10
votes1
answer1762
viewsA: How to put a logo on Toolbar?
A simple way to do this is to create a Toolbar custom and insert a ImageView logo. See in this case below, I put a logo in the center of the toolbar. Not to create in it view, you can use a separate…
-
0
votes1
answer53
viewsA: Error when placing list on Android
In the Preview from Android Studio, you can only see what is set in XML. So you can see what is set in your class Lista, in which a list is generated using ListView, it is necessary to compile the…
-
3
votes1
answer70
viewsA: Timepicker as a draggable bar
Yes, it is possible to make a customization of the Seekbar, but natively has only one slider. To create 2 controls, if you are in a hurry, can use a lib ready. Here are some examples: Squeak…
-
2
votes3
answers1946
viewsA: Animate the text of a textView in order to be displayed progressively?
Although Ramaral has given a valid answer, I thought of another way in which it works for any version of Android. Basically I use the Runnanble with a delay concatenating letter by letter or word by…
-
3
votes1
answer75
viewsQ: Obsolete html.fromHtml for Android N+
In Android 7.0 (API level 24) the static method fromHtml() of the public class Html became obsolete I don’t know why, if you know tell me. See an example of how it was used:…
-
5
votes3
answers6724
viewsA: How to use Ellipsis css3?
Beyond the text-overflow: ellipsis, you must still use the property white-space, that defines how the white space inside an element is manipulated. Also the property overflow as Hidden, which…
-
2
votes1
answer197
viewsA: Error in uploading Ionic app
If you have not sent your application for simulation once, below follows the steps that should solve your problem: Open the file ionic.project.json that is at the root of your project Alter your…
-
1
votes2
answers2947
viewsA: What is Mobile and Ubiquitous Computing?
Perhaps you forgot to quote the Computação Pervasiva, in which it makes it easier to gain a better understanding. To Mobile Computing is a more popular term, as it is part of our everyday life more…
terminologyanswered viana 27,141 -
2
votes1
answer46
viewsA: Compile to a lower platform using the latest API?
To set the minimum SDK version, you need to enter the Cordova settings and specify the level value you want to use. Check the file config.xml located at the root of your project. See below how it…
-
1
votes1
answer54
viewsA: Event onClick with Android Preferences
First step is to define the android:key for the preference item. In this case you already have the pref_key_info item. Right after in your Fragment which extends the PreferenceFragment an instance…
-
0
votes1
answer54
viewsQ: Event onClick with Android Preferences
I have some preferences within the PreferenceScreen in the archive xml/preferences.xml. These are some items that I need to be shown to the user. See below: <Preference…
-
14
votes1
answer326
viewsQ: What is the difference between >>= and >>>= in Java?
Reading a book about the Java language, I came across some operators I had never noticed before. They are: >>, <<, >>=, <<=, >>>, <<<, >>>= and…
-
5
votes1
answer4966
viewsA: GOTO equivalent in Java
There is no direct equivalent to the GOTO concept in Java(1). There are some options that allow you to do some of the things similar to the classic GOTO. According to this reply on Soen, an option…
-
1
votes1
answer1077
viewsQ: When should I use Constraintlayout?
Beyond the RelativeLayout, FrameLayout, LinearLayout, TableLayout, among others already existing, which sufficiently meet the needs related to layout, Google announced on Google I/O 2016 the…
-
2
votes1
answer278
viewsQ: Why should I keep audio and video files inside the raw folder?
On Android you have inside the directory res several subdirectories, apparently separate, for better organization. Sometimes when you want to put a new audio, for example to touch, other than device…