Most voted "android" questions
Android is an operating system for mobile devices developed by Google and the Open Handset Alliance. Use this tag to reference questions related to programming for Android and be relevant only to this operating system. Use the [android-subject] tag instead of [subject] alone.
Learn more…8,935 questions
Sort by count of
-
4
votes2
answers121
viewsError when setting Background
When trying to change the background (image or color) the following error occurs. What can be? MY XML 07-22 20:29:52.223 4967-4967/? E/AndroidRuntime﹕ FATAL EXCEPTION: main…
androidasked 9 years, 4 months ago Priscilla Andrade Machado 41 -
4
votes2
answers79
viewsReusing string in XML
Ex.: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="primeiro_nome">Bigown</string> <string name="nome_completo">{primeiro nome} Silva</string>…
-
4
votes1
answer1749
viewsApplication icon does not appear
I’m making an application, but when I install it on my phone, the icon does not appear. I have no idea what it might be, the ic_laucher is there in the drawable folders. What can be? Manifest…
-
4
votes1
answer10348
viewsHow to create a txt file?
In Java I use the PrintWriter and works perfectly, but on Android I’m getting a lot, it doesn’t work at all. Can someone help me with this? It’s a simple thing, but I’m stuck. I needed to create a…
androidasked 9 years, 3 months ago daniel12345smith 2,120 -
4
votes4
answers20361
viewsAndroid Studio emulator with AMD processor
I’m trying to start developing apps for Android, but unfortunately I’m having some problems using the Android Studio emulator when it comes to testing the app. Basically while trying to run I get…
-
4
votes1
answer3067
viewsAndroid login and password "cache"
Hello, how to login automatically? ex: I made an application for android with login, password and webservice, when the user logs I send the information and return true or false. How do I store in…
androidasked 9 years, 2 months ago Kleber Souza 451 -
4
votes1
answer142
viewsEdittexts dependent on an Android Gridview
I have two Edittexts, a discount value, a percentage and an update Imagebutton, all are in a Gridview. When clicking on the Imagebutton, the value entered in the percentage field should be converted…
-
4
votes7
answers10560
viewsHow to test if an Edittext is empty?
I would like to know how I do to test whether a Edittext is empty or filled on Android. For example, I want to make an app that will perform a registration, but there are fields that cannot be empty…
-
4
votes2
answers215
viewsProblem with XML Linearlayout
I’m having a little problem with my layout. I wanted to insert a button that would be at the bottom corner on the right side of the layout, but when I do this the button is added to each item in the…
-
4
votes2
answers1633
viewsSplashcreen plugin (Cordova) and icons do not work on Crosswalk
I’m using this module that automatically adds a Crosswalk wrapper to a Cordova project. Obs: It requires "Platform" to be [email protected]. Okay, then I give the command to Wrap the Crosswalk in the…
-
4
votes3
answers2310
viewsKeyboard hides Edittext
I have an activity with a EditText to enter values. Whenever the keyboard appears, the editText (the keyboard hides the EditText). I tried to put in the Manifest in the relevant activity the…
-
4
votes3
answers7988
viewsHow to put an animated GIF in an APP on Android?
Well, I have been with this problem for some time, I tried to solve using answers from Stackoverflow gringo but I was not successful. I need to put an animated GIF image in my Activity but Imageview…
-
4
votes3
answers2212
viewsHow to use replace() for the last occurrence?
The method String#replaceFirst() is used to replace the first occurrence of a substring in a string, but how should I proceed if I want to do this with the last occurrence? The doubt is as follows…
-
4
votes1
answer934
viewsHow to add button in Maps?
I selected a Google Maps Activity when creating the project, as I added this button in the layout? <Button android:id="@+id/btn_draw_State" android:layout_width="40dp"…
-
4
votes2
answers1326
viewsBarcode reading on a single screen
My friends and I are developing an application in which in one of the functions the smartphone should scan the barcode of a product and search for it in a database (ours). As this can be done for…
-
4
votes2
answers5149
viewsCreate a Alertdialog with an Edittext of type "number" - Android
Guys, I have a problem with my alert: In it I have an Edittext, only I can’t declare Edittext with type numbers(android:inputType="number"). Any idea? Follow the code of the Alert: public void…
-
4
votes2
answers94
viewsParameters of Android configuration
I wonder if you have any way to get the values straight from the settings of android example want to know if the "Unknown Sources" is enabled, "Developer Mode" is enabled,"Language" ,"Brightness…
-
4
votes1
answer142
viewsIs there any way to import a project into Android Studio by fixing the dependencies automatically?
I have had frequent difficulties in importing projects into Android Studio. Whenever I make a new import, the IDE points out several dependencies that are not satisfied and I have to fix them…
-
4
votes1
answer2273
viewsHow to avoid floating keyboard?
I’m testing my app on a tablet Samsung and the number keyboard is floating, the keyboard is on top of my application, does anyone know how to disable this in the code? Thank you in advance! Obs: The…
androidasked 9 years, 1 month ago daniel12345smith 2,120 -
4
votes1
answer181
viewsManifest error after Android Studio upgrade to version 1.4
I am starting on Android now and had not come across this error before, I have tried to see other projects but even so the error persists, I wonder what is causing the error and how to resolve it.…
-
4
votes1
answer1907
viewsApply Material Design (android:Theme.Material) to Android versions smaller than API 21?
I was studying a little about the Android layout guidelines as: Colors; Design material; And how to implement these guidelines; So I tried to customize my Theme, thus: <resources> <!--…
-
4
votes2
answers681
viewsHow to display a Toast inside a Thread on Android?
I’m developing an app and I needed to display a Toast at some point within a Thread, but I’m not getting it, does anyone know how it’s possible and if it’s possible to do so? Thank you in advance.…
-
4
votes1
answer1412
viewsHow to create a new Build.Radle?
Since I imported my project from github, I’m trying this error: Migrate Project to Gradle? This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build…
-
4
votes1
answer647
viewsHow to play a sound using Mediaplayer?
How can I create a button with Soundeffect using the Mediaplayer class or any other android class? I tried using the following code I found some examples, but I was not successful. public void…
-
4
votes1
answer1039
viewsHow to pass the Edittext value of a Fragment to the Textview of another Fragment?
I have a Fragment that contains an Edittext in which the user will enter his name. In another Fragment is Textview which will receive the name typed in the previous Fragment. Fragment Edit (where…
-
4
votes1
answer541
viewsType of android keyboard, text and number
There’s how I make the android keyboard stay with two types, in case I wanted numbers and letters. I tried using android:inputType, but it didn’t work. Do you already have a way to solve this? Thank…
-
4
votes1
answer836
viewsHow to read a local json file using retrofit 2.0?
For API testing purposes, I need to read json files that would be my answer in API requests. Well, with Retrofit 1.9 it was possible to implement a "Client" and overwrite the "execute()" method to…
-
4
votes1
answer417
viewsDifference between Listview and Listactivity
I’m having a little doubt, what’s the difference between a Listactivity and a Listview ?
androidasked 8 years, 11 months ago Alan Martins 123 -
4
votes1
answer369
viewsAvoid uninstalling application even after factory restore
How to develop an app that, even after the device is restored, it remains installed, the same as the mobile operators' apps? Thanks from now on.
androidasked 8 years, 10 months ago Rudda Beltrao 149 -
4
votes1
answer1664
viewsHow to prevent Alertdialog from being closed when a button is clicked?
Problem I’m trying to validate certain data contained in a View customized of a AlertDialog in the Save button click event. Then after the validation I save the data and close the Alertdialog, and…
androidasked 9 years, 6 months ago Fernando Leal 9,770 -
4
votes1
answer670
viewsHow to make the text fit in the text box on Android?
To set a range for the font size for the text to automatically adjust in the text box Android (TextView) the extent to which it is entering or inserting. There is a configuration to do on Android…
-
4
votes1
answer70
viewsDetect copied text
How to perform an action whenever someone copies some text in Keyboard android? And would have to use a service to leave running all the time?
androidasked 8 years, 10 months ago felipe.rce 1,969 -
4
votes0
answers545
viewsMaterial design status bar android Delphi-10
Is there any way or some style to change the color of the status bar of the Android smartphone as material current design in Delphi? The image below illustrates what I want: .…
-
4
votes2
answers3630
viewsHow to center a Textview?
How to center horizontal text on TextView that is to center on the top and bottom line. <TextView android:id="@+id/txt" android:layout_width="match_parent" android:layout_height="match_parent"…
-
4
votes1
answer853
viewsCreating doc or docx file
I was wondering if there is any lib able to create a doc or docx file directly from an android app. I’ve tried using apache poi, but it doesn’t work. I’m using android studio. I’ve tried several…
-
4
votes2
answers176
viewsHow, by clicking on the notification, delete the notification and do not open the application?
I need to send a notification but would like when the user clicks on the notification it is deleted and does not open the application The part of generating the notification that is already working…
-
4
votes1
answer570
viewsFiltering data from acceleration and magnetic sensors on Android
I have a player open source for Android some time ago. Months ago I created an audio viewer (the type of ones with bars and colors) where the user could interact, simulating an augmented reality…
-
4
votes4
answers1244
viewsHow to Catch Data with JSON on Android
Hello how do I get the data from a web-service that I have? I have the following code in JAVA Android to save the information:…
-
4
votes1
answer391
viewsAndroid SDK Build-tools 22.0.1 inventing folders inside res in generated APK
I’m using the Android Studio 1.2.1.1, with the Gradle 2.2.1, and this is an excerpt (the relevant part) of my resource folder structure: res |- layout |- layout-v21 |- values |- values-v11 |-…
-
4
votes2
answers670
viewsHow can I make a variable wait for the user to press 1 of 4 buttons?
Well, I’ll try to be clearer. I have a variable called int tentativa and I want it to receive a specific value depending on the button the user presses. The buttons are btPedra[0], btPedra[1],…
-
4
votes1
answer603
viewsHow to get the string of a parent Json or a Json in array format?
I got the following JSON: String json = "{\n" + "\n" + " \"Pessoas\":[\n" + " {\n" + " \"NomeHomem\":{\n" + " \"Idade\":1\n" + " }\n" + " },\n" + " {\n" + " \"NomeMulher\":{\n" + " \"Idade\":true\n"…
-
4
votes2
answers1183
viewsMy layout does not render
I was watching and copying a code from the first class of Material Design of the Thiengo Calopsita youtube, It turns out that the file xml of activity_main and of toolbar_bottom is not rendering in…
-
4
votes1
answer1665
viewsHow to pass information from listview to a new Activity?
I have an agenda about events where I live I can already receive through my database in Mysql and JSON a list with the titles of events. Now I wanted when I clicked on the event to redirect to an…
-
4
votes2
answers498
viewsService versus Broadcastreceiver
What’s the difference, on Android, between Service and Broadcastreceiver? How long a Service can run (running)? How long can a Broadcastreceiver run (running)? I can create notifications via…
-
4
votes1
answer572
viewsHow to return more than one value using an Asynctask on android?
Briefly, my class that extends an Asynctask, downloads a series of data byte type, then I need to perform some calculations with this data, and finally return all these values to my Mainactivity.…
-
4
votes1
answer94
viewsHow to create a sound library?
In my application is recorded sound normally, only I wanted to rename the recorded sound and then store in the device. outputFile = Environment.getExternalStorageDirectory().getAbsolutePath() +…
-
4
votes2
answers5680
viewsHow to authenticate a user in an android app that uses Facebook login
I’m creating an Android app where the user will have to register to have access to the application content (a login). For this, I use by default the famous Facebook Login. When the user logs through…
-
4
votes2
answers837
viewsAndroid Progressdialog does not appear
I am trying to show a Progressdialog in the process of downloading a binary file, however this does not appear, and I get no error either. I will briefly explain the way I have structured code In my…
-
4
votes1
answer1601
viewsGps or antenna triangulation - How to know the accuracy of the location?
I have an app that uses the Location api and works right on most devices, but has one that even on the gps does not work with adequate accuracy( goes over the house and not on the street). By the…
-
4
votes1
answer127
viewsWhy the compiler alerts me Anonymous new Runnable() can be replaced with lambda
Because that code (Thread) shows this message (on the compiler), and how to make it not show more? Code: public void onCreate(Bundle icicle) { ... mVideoView.setOnPreparedListener(new…