Posts by Leonardo Lima • 3,541 points
120 posts
-
1
votes1
answer315
viewsA: How can I copy a machine from android studio to another machine, without needing to install android studio?
For pattern Avds are created in $HOME/.android/avd. In Windows it’s probably something like C:\Users\MeuUsuario\.android\avd. It is possible to create the environment variable $ANDROID_AVD_HOME to…
-
3
votes1
answer922
viewsA: How to create an emulator without using the ide?
TL;DR A valid command example to create an Avd: avdmanager create avd -n "Meu-Emulador" -k "system-images;android-26;google_apis_playstore;x86" avdmanager The program used to create Avds is the…
-
1
votes2
answers542
viewsA: How to convert json to object and put into a system.out.println?
First you should store the entire body of the HTTP response in a variable: StringBuilder resultado = new StringBuilder(); String line = null; while ((line = buffread.readLine()) != null) {…
-
2
votes1
answer154
viewsA: Build Variant Android studio
To add Flavors as in the image, you should add a block of productFlavors in his build.gradle. Within it you can create several Flavors and personalize them. ... buildTypes { release { minifyEnabled…
-
0
votes2
answers60
viewsA: Problem with inifnito loop Randomaccessfile
You could set a variable before the while and store the return of the first read in it. With while: RandomAccessFile arq = new RandomAccessFile("teste.txt", "r"); int letraByte = arq.read(); while…
-
0
votes1
answer22
viewsA: Android: Have a job to check url
To schedule tasks that will be performed over and over again in the future, you can use the mechanism of Alarms android. Depending on your use case the parameters and the alarm type can change, but…
androidanswered Leonardo Lima 3,541 -
3
votes1
answer86
viewsA: What is a Circuitbreaker?
I believe that the explanation by Martin Fowler is one of the easiest to understand, with illustrations and examples in code. Imagine a system that makes several HTTP requests to a webservice…
-
4
votes2
answers308
viewsA: Why does Kotlin use a way of declaring functions and variables other than "traditional"?
To FAQ had an answer regarding this, but was removed: Why have type declarations on the right? We Believe it makes the code more readable. Besides, it Enables some nice syntactic Features, for…
-
8
votes1
answer49
viewsA: Java is not splitting a String correctly
The pipe "|" is a special character of regex. Therefore, you should escape it: split("\\|");
javaanswered Leonardo Lima 3,541 -
0
votes2
answers37
viewsA: Photo Album Android
Try: Uri uri = Uri.fromFile(new File(getItem(position).toString())); Glide.with(context).load(uri).into(image); A tip: Inflating a layout for each Adapter item can become costly and make the scroll…
androidanswered Leonardo Lima 3,541 -
1
votes1
answer216
viewsA: Return Vector within JSON Retrofit Array
The way your JSON is, your interface should be: @GET("nutricao/") Call<ArrayList<ArrayList<Pratos>>> getListPratos( @Query("acao") String acao, @Query("tipo_refeicao") int tipo,…
-
2
votes1
answer224
viewsA: Published iOS, Rejected: Guideline 2.3.3 - Performance - Accurate Metadata
As you said yourself, your app is "just a link to the site". According to the guidelines: Your app should include Features, content, and UI that Elevate it Beyond a repackaged website. If your app…
-
31
votes3
answers2697
viewsA: What is reactive programming for?
Many people mix the terms and concepts of reactive programming and of reactive systems, perhaps due to Reactive Manifesto. In January 2017, Lightbend published a whitepaper (in English) which…
-
1
votes1
answer46
viewsA: Date comparison goes wrong
When you compare two objects of the type Date, in fact you’re comparing the millisecond representation of these objects. The method Date.compareTo(Date anotherDate) is implemented as follows: public…
-
1
votes1
answer355
viewsA: "Virtual Keyboard" - Java Android
You can use the method append() of Edittext. It will add what you pass as parameter to what is already present in Edittext. editText.append(")"); editText.append("1");…
-
6
votes1
answer2788
viewsA: Program for Android without Android Studio
Android Studio is an IDE (Integrated Development Environment), and as such offers several tools that facilitate and accelerate development, such as code Completion, debugging, linting, Refactoring,…
-
1
votes1
answer263
viewsA: Continue running after you accept Android Permission
In his method onRequestPermissionsResult you did not treat the case that he accepted the permissions. public void onRequestPermissionsResult(int requestCode, String[] permissions, int[]…
-
1
votes1
answer190
viewsA: Result Web Service RETROFIT in Other Activity - Android
The method enqueue() of the Retrofit accepts a Callback which is executed asynchronously after the request is made and converted. You can just pass the Callback as a parameter for your method…
-
0
votes1
answer64
viewsA: Switching screens with the same XML file
Yes, it is possible to reuse a single XML file in several activities. To change properties of views declared in XML, assign an id to them: <LinearLayout android:layout_width="match_parent"…
-
2
votes2
answers1196
viewsA: Consuming Json[Array & Object] on Android
When interpreting JSON, a piece of its structure was disregarded: the object shoppingsObj and the array malls contained within it. Latitudes and longitudes are also within an array. It is also worth…