Posts by Androiderson • 1,249 points
35 posts
-
1
votes1
answer76
viewsA: How do I format the actual values of my Android application?
Try this: public String formatarValor(double value) { NumberFormat formatoBr = NumberFormat.getCurrencyInstance(new Locale("pt", "BR")); return String.valueOf(formatoBr.format(value)); }…
-
2
votes2
answers988
viewsA: Message when user is exiting application
This type of approach is not recommended. First because both the back button as to the finish do not guarantee that the app is being terminated (the system decides whether to terminate an app or…
-
1
votes1
answer297
viewsA: Toolbar toggle(burger) button does not work on Android Pre Lollipop
Usually the syncState is called in the onPostCreate and make sure you are using the setDrawerIndicatorEnabled @Override protected void onPostCreate(Bundle savedInstanceState) {…
-
1
votes1
answer95
viewsA: Web Service Images Java ZIP Android
2 - Download only what is necessary when accessing the requested item and keep it in local cache. If there is internet you order the updated item, otherwise access the local item. Perf Theory:…
-
0
votes1
answer296
viewsA: How to create new directories in Android Studio?
You can configure your folder with the following configuration in Gradle. sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res2', 'src/main/res_qq_coisa'] } }…
-
-1
votes2
answers789
viewsA: Call Activity after Facebook login
Would that be? @Override public void onSuccess(LoginResult loginResult) { AccessToken accessToken = loginResult.getAccessToken(); Profile profile = Profile.getCurrentProfile();…
-
0
votes2
answers60
viewsA: Integration of TSF with Android Studio
Android Studio is based on the version Community Edition Intellij IDEA. Integration with TFS as well as various other features, are only available in the version Ultimate Edition of Intellij IDEA,…
-
0
votes1
answer164
viewsA: Avoid response delay message
I’m surprised you can even consume a service without using Asynctask. Anyway. The options you have, which alias are the most common, is to use Volley or Retrofit There’s plenty of stuff out there,…
-
8
votes1
answer417
viewsA: Difference between Listview and Listactivity
First I advise you to study the difference between Activity and View, because they are absolutely different things. After that you will realize that ListView is a type of implementation of View,…
androidanswered Androiderson 1,249 -
3
votes2
answers784
viewsA: What is the best way to create a mobile application that communicates with a Webserver?
Once you need to create a web service/API for mobile client access, your web service becomes public. And public webservices will always be subject to unauthorized access since in order for your…
-
2
votes1
answer60
viewsA: Toolbar repeating
As stated in the comments, your Toolbar needs to be in the same XML as your reclycler view. Otherwise it repeats in each item.
-
4
votes1
answer574
viewsA: Change text color in Alertdialog
Do not use setMessage use setView and do all the training by XML. AlertDialog.Builder dlg = new AlertDialog.Builder(this); dlg.setView(R.layout.um_layout_qualquer ou [view inflada dinamicamente]);…
androidanswered Androiderson 1,249 -
1
votes1
answer157
viewsA: How do I know if the email was actually sent?
The responsibility of informing if the email was sent or not is from the Activity that your client invoked. Therefore there is no need for you to deal with the success case or error of sending the…
-
1
votes2
answers304
viewsA: Android Studio - Coordinatorlayout, Appbarlayout and Floatingactionbutton
The error is self-explanatory You need to use a Theme.Appcompat Theme (or Descendant) with the design library If you are using the design library, you must obligatorily use the Theme Theme.AppCompat…
androidanswered Androiderson 1,249 -
0
votes2
answers81
viewsA: Toolbar is behind the Layouts
Simply put your Toolbar last in the layout <LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"…
-
3
votes1
answer53
viewsA: Change icon mylocation
Changing this icon is not possible, however you can disable it and insert a custom Marketer in the same position. googleMapObject.addMarker(new MarkerOptions() .position(new LatLng(lat, lng))…
-
0
votes1
answer148
viewsA: How to access Maps in Genymotion
Genymotion does not come with Play Services installed. You need to install manually. This article explains the step by step to do so.…
-
3
votes1
answer55
viewsQ: Noclassdeffounderror when implementing Espresso Idlingresource
I need to warn [Espresso][1] to wait until my Activity is idle. For this I am using the interface IdlingResource. This is all my Activity code: public class MyActivity extends Activity implements…
androidasked Androiderson 1,249 -
3
votes2
answers7874
viewsA: "Quit" button in application developed in the App Framework
First, you need to keep in mind how Android works and Google’s recommendations on app design. Android is developed so that the user does not worry whether an application is open or closed. The…
-
10
votes1
answer11955
viewsQ: Difference between Handler and Thread
I made a test app in which I would like to see a ProgressBar updating by simulating a long-duration task. I initially tried using Handler because after some research I saw that its use was…
androidasked Androiderson 1,249 -
1
votes3
answers7213
viewsA: Closing application (Unfortunately Myapplication has stopped)
You are trying to locatilize the button in the layout activity_main but your button is on the fragment fragment_main, so it is null. Just move your code from onCreate from Activity to the…
androidanswered Androiderson 1,249 -
1
votes2
answers176
viewsA: What better server side technology to serve information to cross-platform software?
As far as mobile customers are concerned, the only viable solution is the interfaces RESTFUL, that use HTTP and its different verbs: POST, GET, DELETE and PUT. And having a robust and well…
-
2
votes2
answers8992
viewsA: How do I update my application’s APK when the user requests it?
You can even have an app button that downloads an apk, but the user will have to access this apk and request the update manually. Only the operating system can update an application. No app has this…
-
3
votes1
answer1009
viewsA: Read text file via HTTP
Network operations on Android must be asynchronous, IE, They can not be performed on the main thread not to run the risk of freezing the user screen during operation. Use a Asynctask to run your…
-
4
votes1
answer208
viewsA: What are the differences between <MERGE> and <INCLUDE>?
Include and Merge are separate things but were meant to be used together. Include is used to repurpose layouts, simple as that. But this creates a problem, because every layout defined in Android…
-
2
votes1
answer485
viewsA: How to Create a Live Wallpaper
Your question is wide, but Live Wallpaper is a service, so you’ll have to declare this service on your Androidmanifest.xml, remembering that this service requires permission…
androidanswered Androiderson 1,249 -
13
votes3
answers711
viewsQ: Extend classes with private constructor
Because I can’t extend classes with private builder? Consindo the classes To: public class A { private A(){} public static void limao(){} } and B: public class B extends A { private B(){} public…
-
2
votes8
answers7407
viewsA: What better way to work offline and synchronize data with server?
To work with offline registrations on Android should use the Sqlite, a good tutorial can be found here. In cases of changing the same record, the ideal is that every time a change is detected in an…
-
14
votes3
answers6699
viewsA: Conversion of JSON string to Java object
As I wanted to show Marcio in the other answer, your object "Contest" is encapsulated, so you need to extract it. If you are in the json generation command, you can simply make it simpler that way:…
-
2
votes3
answers2188
viewsA: How to implement the fixed Actionbar below, android version 2.x or higher?
First a few considerations: Keep in mind that an Actionbar has its place defined by Google’s Guide Lines (recommendations). This place is the top of the screen. Anything you do out there is not an…
-
1
votes2
answers241
viewsA: How to know if the keyboard (Keyboard) is visible?
Try this: InputMethodManager imm = (InputMethodManager) getActivity() .getSystemService(Context.INPUT_METHOD_SERVICE); if (imm.isAcceptingText()) { writeToLog("Visível"); } else { writeToLog("Não…
-
1
votes2
answers184
viewsA: Versions of Constants according to Buildtype
Both the instructions in documentation when the solutions contained in the posts I mentioned work perfectly. The problem is that Android Studio seems to have a bug, as it recognizes only the…
-
1
votes3
answers2228
viewsA: How to make a simple square on Android?
If all you want is a square, why not simply use a Linearlayout with a background color? <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"…
androidanswered Androiderson 1,249 -
0
votes2
answers184
viewsQ: Versions of Constants according to Buildtype
I have some constants which I would like to vary according to how BuildType of Gradle. Among them are the URL’s of the API’s that I use in my app, which can be production, homologation and…
-
1
votes5
answers1154
viewsA: Map does not load, showing error
You won’t be able to use the map in the Android emulator unless you go through a complex emulator modification process (which isn’t worth it). The best thing to do is to use a third-party emulator.…