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
votes1
answer1422
viewsPassword validation saved in Sqlite
Hello I’m doing a project for college and I’m new on Android,I’m making an application that the purpose of it is to check if the password is correct to be able to finalize the application, but I’m…
-
4
votes1
answer2307
viewsHow to format text in a Textview?
I want to add a formatted text (can be in html) on my Textview screen but I’m not getting it. I have string in values: <string name="lbl_explicacao"> <![CDATA[ <b> TESTE </b>…
-
4
votes1
answer88
viewsSparsearray vs Hashmap what’s the difference?
I was doing my daily refactoring and came across a warning. use new Sparsearray(...) to Instead for Better performance Okay, but what’s the difference between Map and SparseArray? This is my code:…
-
4
votes2
answers330
viewsIs it possible to have an app with multiple apps inside?
We are thinking about developing several apps to solve problems, and each app solves the problem of a sector. To avoid the user having to download the apps separately, we thought of making a Bundle…
-
4
votes1
answer78
viewsCheckboxes in Alertdialog always return the same values
I have a AlertDialog with a custom layout with 2 checkboxes. But even if I click one of these checkboxes, by clicking the accept or cancel buttons (alert.setPositiveButton or the…
-
4
votes1
answer131
viewsDon’t send Push to users who no longer have the app?
I have a GSM PUSH panel and it turns out that when user installs the app I record his id to send future notifications. But after it uninstalls I continue with his ID saved in the bank and whenever I…
-
4
votes2
answers67
viewsHow to reverse series of denied conditions without affecting logic?
Could someone explain to me why this happens? My apk only works right if I put denial and do something: public class Main2Activity extends AppCompatActivity { private EditText nome, teste, cpf;…
-
4
votes1
answer339
viewsAlert Dialog personalized with GIF image
I would like to know how to create a Alert Dialog customized where you had an Imageview containing a GIF. On my Main. imgAndroid = (Button) findViewByid (R.id.imagandroid);…
-
4
votes1
answer844
viewsFunction of Delphi works on windows but not on android
I have two functions in my project, one for Cpf validation and another to remove different characters from numbers from the string; ok, when I run for windows it works perfectly. Already when I…
-
4
votes2
answers775
viewsWhat is the real difference between these three ways of changing from one Activity to another?
Guys I have knowledge of three forms that through a simple click on a given button, it passes from the current Activity to another. I would like to know which of these three ways is the best taking…
-
4
votes2
answers5541
viewsExpected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 Com Webservice JAX-RS e Android Retrofit
I’m studying Webservice and consumption on Android with Retrofit2. I’ve done tests with public Apis like Viacep and FIPE and I can use the retrofit quietly, very easy but when I set up my own…
-
4
votes1
answer1577
viewsHow to update Recyclerview simply and efficiently?
The most efficient way I know to update a Recyclerview is to resort to Adapter methods notifyItemMoved notifyItemRangeChanged notifyItemRangeInserted notifyItemRangeRemoved They, as opposed to…
-
4
votes2
answers498
viewsHow can I easily make application location permission?
I found this tutorial https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en but I didn’t understand anything. I looked at this tutorial: //…
-
4
votes1
answer2410
viewsHow to catch a JSON from a URL?
I continue studying Androidstudio and the ball of turn eh catch data by URL, in json format, For that reason created an example page: (http://exemplo.minha.info/nav/2.html), with the following…
-
4
votes2
answers106
viewsWhat method to make you download all the media volume on Android?
My application needs the user to be able to choose at its beginning whether they want to hear the sounds of the app or not, because it is an app to be used in the classroom and in this environment…
-
4
votes3
answers180
viewsHow to use repeated methods?
I have some methods that I use in various points of the applications and I end up having to copy in each class. For example: String getStringOrEmpty(EditText editText) { String mString =…
-
4
votes1
answer379
viewsFirebase: How to load random data into a Recyclerview?
I am using a Query to load only 6 items from the Firebase database in Recyclerview but so far I can only sort using the orderByChild, limitToFirst or last. Everything is working fine but... I want…
-
4
votes1
answer678
viewsError while recovering data from Sqlite
I’m starting to work with database and I’m already in trouble. I ask for a hand! Well, I have a database, apparently, there’s no mistake in adding data to it. I have a Dbhelper class that inherits…
-
4
votes1
answer771
viewsPicasso cache of images
I’m testing the library Picasso in the android in two situations: 1 - When loading an image, in a url publish (without sending headers authentication), the image is loaded into the ImageView, and…
-
4
votes3
answers1946
viewsAnimate the text of a textView in order to be displayed progressively?
I would like the text of the textView present in my Activity not to be displayed all at once, but gradually, something like a Power Point transition. An example of what I want to do exactly would be…
-
4
votes2
answers829
viewsHow to support various types of screens/screens
I started on Android recently (self-taught) and came across the following situation: support for several screens. I saw some tutorials and doubts of other people but found nothing to help me with…
-
4
votes1
answer1892
viewsHow to call one function inside another in Java for Android?
Every letter the user types in EditText, invokes the function TextWatcher that leads to a Text-to-speech. So if it writes 'c', the app returns a line saying 'c'. if it then enters 'a', returns 'a'.…
-
4
votes1
answer419
viewsData persistence levels in android applications
I’m studying persistence for android, however I’m having difficulty understanding the levels of persistence they make in applications. I saw that there are 5 types: onSavedIntanceState…
-
4
votes1
answer253
viewsDoes AJAX requests work on Webview?
I got the following WebView: WebView myWebView = (WebView) findViewById(R.id.webview); myWebView.getSettings().setJavaScriptEnabled(true); myWebView.getSettings().setBuiltInZoomControls(true);…
-
4
votes1
answer1215
viewsHow to change the background of a button when clicked?
I need to change the background of a button when clicked. Here’s the code I tried: private Button btn; private int colorFlag = 0; @Override protected void onCreate(Bundle savedInstanceState) {…
-
4
votes2
answers1548
viewsHow does Asynctask actually work?
Still, sometimes I get a little confused by the AsyncTask. See an example below: private class MyAsyncTask extends AsyncTask<String, Void, String> { @Override protected String…
-
4
votes1
answer321
viewsHow to cut part of a bitmap?
I want to create a Bitmap that its content is a part of another Bitmap For example: I have a Bitmap (400x900) width = 400 height = 900 I want to cut it in the dimensions (400x400) in order to leave…
-
4
votes2
answers123
viewsHow to apply attributes of a parent Viewgroup to child in android studio?
How to make children of a Viewgroup inherit a parent attribute? For example, I would like to set up layout_marginTop="16dp" for all Textview daughters <LinearLayout…
-
4
votes2
answers214
viewsList values of an array in a spinner, and when selecting an item print its value from another array
I have a spinner that lists the types of person (physical and legal - respectively Ids = 1 and 2) and would like when selecting one of them, to be printed in a Toast your ID. //array tipoPessoa…
androidasked 7 years ago Thyago Dias 465 -
4
votes1
answer236
viewscom.google.firebase.database.Databaseexception
I looked for that mistake and I didn’t find it anywhere, just a few similar but not this: com.google.firebase.database.Databaseexception: Maps with non-string Keys are not supported Controller…
-
4
votes5
answers3128
viewsHow to get Firebase data and insert it into a Textview?
I need to set the client data in a Textview. I tried to set the email, but it didn’t work because the return is null. public class PerfilActivity extends AppCompatActivity { private TextView…
-
4
votes3
answers1657
viewsConvert string to blob and save to bank
I’m developing a mobile application that has a form where the user can attach an image, the image is being sent as string via Rest to the server and will be saved in the blob database, however, I’m…
-
4
votes1
answer850
viewsHow to integrate an Android application with a Python+DB server?
Good afternoon to you all! I am a student of Computer Science, but I haven’t had the opportunity to have a deeper experience with programming, involving the necessary integrations in applications…
-
4
votes2
answers3752
viewsWhat is the difference between Compile and Implementation in the Android Studio build.Radle file?
Whenever I will add some library manually in the file build.Gradle (Module: app) of Android Studio 3, I use the format implementation, because this is the way that Android Studio itself uses by…
android android-studio gradle dependencies android-gradleasked 6 years, 9 months ago Chinnon Santos 349 -
4
votes2
answers629
viewsFirebase Cloud Messaging does not send sound in notification
I have two applications, when such action happens in one of the two applications, it sends a notification via FCM, for the other application, when it comes to notification , only makes the…
-
4
votes1
answer131
viewsDifficulty in using Datepicker
I’m studying things for a project here and I’m trying to use Datepicker, I managed to implement normally, but I want to use two in the same Activity, putting an initial date and an end date, put two…
-
4
votes0
answers207
viewsHow to make a mock in an android class at runtime?
I am having a certain difficulty in the tests, I wanted to know if there is a possibility to simulate a custom return in a method at runtime example: @RunWith(JUnit4.class) public class TesteSmile {…
-
4
votes1
answer62
viewsLITE ORM problems in saving columns bytes
My app the user can use the camera to take photo and need to save it in the database. To save in the database I convert the image into an array of bytes, however I noticed a problem in this process…
-
4
votes3
answers1697
viewsRemove 2 specific characters from a String
Good afternoon ! Devs, I’m having trouble solving the following problem: In a calculator app, calculations always return a Double, which automatically inserts a decimal place even if it is to deploy…
-
4
votes2
answers193
viewsJsonobject with multiple values without using Array
Goal Create a JSON with the following structure: { "auth": { "user": "rbz", "token": "abc123" } } Setting Creating the root structure: JSONObject JOraiz = new JSONObject(); Creating the values user…
-
4
votes3
answers715
viewsRead JSON array on Android
I’m having trouble reading a JSON in the format: [{"RESULTADO":"SUCESSO"}] Webclient.java: //PARA LER UM JSON, USAMOS A Scanner Scanner scanner = new Scanner (connection.getInputStream()); String…
-
4
votes2
answers387
viewsProblem with audio stream on android
My shorthand code is this: MediaPlayer mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setDataSource("http://stm43.srvstm.com:8474/;");…
-
4
votes2
answers489
viewsDetect URL Webview
I have a little problem, I need to know the URL every time the page is changed. my code works perfectly normally opens youtube that would be the example : WebView wv; public void onBackPressed(){…
-
4
votes3
answers165
viewsWhy authenticate your cell phone number via text in the register?
I am developing an android app, early on I come across the following question about security. Why authenticate by SMS? It brings extra security? Why not just check the number present on the cell…
-
4
votes1
answer85
viewsWhat are the widgets?
I understand that the widgets would be the components available in the Android Studio palette, for example. Thus, the components of the palette below, not only those that are in the Widgets group…
-
4
votes3
answers1637
viewsHow to iterate with two-dimensional array?
Hello, I am making a library to help in the creation of games and for that I would like to know how to iterate in two-dimensional arrays, I know that the array for one-dimensional is just to do:…
-
4
votes0
answers27
viewsBeagle crashing getBeagleCacheFromDisk function with unchecked cache
I’m using Beagle 1.4 (usebeagle.io) in a partially server driven Android app. I have the cache disabled in Beagleconfig, but when I get to the screen with the Beagle UI, the app crashes. I do not…
-
3
votes3
answers5690
viewsCatch latitude Android - Location == null
I’m having trouble getting latitude and longitude on Android. Using this function, always the "Location" returns "null". public void onCreate() { LocationManager locationManager = (LocationManager)…
-
3
votes2
answers12503
viewsHow to save data to the internal memory of an Android device?
I am writing files in the external memory of the device, I am doing it as follows: File arquivo = new File(Environment.getExternalStorageDirectory()+"/"+ nomeArquivo.getText().toString() + ".txt");…
-
3
votes1
answer5066
viewsSHA1 generation - Another way to do it?
All tutorials point to a single path, when generating the SHA1 or MD5 sequence to be used in Google Console, in order to get the Key API to be put in the manifest.xml file. I mean, they say go to…