Most anwered "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
-
16
votes9
answers17662
viewsError: R cannot be resolved
I am creating an Android project and am facing the following error in my IDE. package br.com.app; import android.R; public class MinhaApp extends Activity { @Override public void onCreate (Bundle…
-
21
votes8
answers7407
viewsWhat better way to work offline and synchronize data with server?
I am working on a project where it will be necessary for users to register offline and then submit their registration to the server as soon as the internet connection is available. My problem is…
-
156
votes7
answers20768
viewsHow to protect source code?
I am thinking of making an application to sell, I would like to know how to protect my source code to keep my software safe. I saw the Java bytecodes, stored in the file .class are easily 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…
-
16
votes6
answers14835
viewsAndroid app development: what are the tools and language to start a project?
I would like to venture into creating apps for Android. At first I would make one just for own use. What tools would I need to build my development environment? My application would use database,…
-
5
votes6
answers922
viewsListview very long
I created a ListView that features the songs of my sdcard, but as you can see in the image below it is very long regardless of the amount of items, I want its height to be smaller to display more…
-
9
votes6
answers19681
viewsHow to fix this error "Error cannot resolve Symbol R" in Android Studio
I imported a project made on Eclipse to the Android Studio and errors appeared in the code regarding the R with the following message cannot resolve Symbol R How to correct this error?…
-
7
votes6
answers8471
viewsDo not open keyboard automatically when on screen with Edittext
I have a screen with a EditText ai whenever I enter it already opens the keyboard. I wanted you to only open the keyboard when I clicked on it. I tried that but the keyboard is not opening at all:…
androidasked 9 years, 6 months ago Ilgner de Oliveira 1,098 -
7
votes6
answers18836
viewsRemoving Titlebar from the android app
I’m starting on android, and know very little! I’m developing slowly and with each change I save the apk and see it running on my phone. I noticed that there is a bar in the app with the name of the…
-
2
votes6
answers3996
viewsCheck if Edittext is empty
Hello guys I’m making an app on android studio but I don’t know exactly how to check if the text fields are empty, I tried the following solution in the code below : public class MainActivity…
-
8
votes6
answers422
viewsHow to "call" this correctly?
When the Elements are inside the onCreate, use the (this) it’s very easy... Example 1 : that works from within onCreate itself protected void onCreate(Bundle savedInstanceState) { Spinner spinner =…
-
2
votes5
answers1154
viewsMap does not load, showing error
I’m starting to develop on Android, only I came across a problem to generate a simple map, I’ve seen and reviewed the documentation of Google Developer and other internet tutorials that show how…
-
10
votes5
answers2656
viewsHow to manage a Sqlite connection between multiple simultaneous threads?
So I’m facing some problems with my Sqlite connection, where I’m not finding a skilled solution. Setting My scenario is this:: I synchronize the data of my application with a legacy system, through…
-
5
votes5
answers13518
viewsHide the keyboard
As soon as the user clicks on one of EditText from my Android app, the keyboard appears, however, it does not disappear when you finish typing and click off it. I would like to know which method…
-
6
votes5
answers1382
viewsNo return on method?
I have a method where its function is to read a file and store the value written in the file in a variable and return the variable,: public String addItemCreative(File f){ String line = null; try{…
-
2
votes5
answers1534
viewsIonic 2 - Status Bar
I am unable to change the color of my Status Bar with Ionic 2. I have checked the documentation and am doing the following. app js. import {StatusBar} from 'ionic-native'; app.js (constructor())…
-
2
votes5
answers1896
viewsChange Button Background
How can I change the background of a Button click on it? For example: I have the shape01 and the shape02, for default the Button this with the shape01, when clicking on it I need to change to the…
-
4
votes5
answers12363
viewsOne component on top of the other
I’m in trouble that I do not think how to solve, I have an Activity as in the photo below, the problem is, that when I emulate the application, the Button and the textView go down the two colored…
-
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…
-
3
votes4
answers5487
viewsProblems with installing Android Studio on Fedora Linux
A few days ago I try to install the Android Studio editor on Fedora linux and I can’t. I searched in some tutorials, websites, google and could not find a solution to deal with the error below:…
-
0
votes4
answers3330
viewsHow to use Asynctask on Android?
I’m trying to get my application to download an XML (RSS Feed) and read your tags to display it on the home screen. But the application closes after downloading before trying to start the method…
-
3
votes4
answers7507
viewsArduino and Android Bluetooth Connection (Java) - Inputstream storing old data
I’m making a class in Java very simple, just to simulate the communication of Android with Arduino via Bluetooth. The idea is the following: The Arduino every 5 seconds will light and erase an LED.…
-
5
votes4
answers1387
viewsHow do I know if it’s a tablet or a smartphone?
How do I know I’m working on one tablet or a smartphone with the Android API? Nowadays resolutions, dpi are almost the same thing between tablets and smartphones and it gets complicated to know…
-
5
votes4
answers1224
viewsHow to exchange data between a mobile(android) and another device through Bluetooth communication?
How can I connect and disconnect with any device through Bluetooth communication and then exchange (send and/or receive) data?
-
0
votes4
answers1377
viewsError on AVD startup - Android Studio
When android emulator starts the following error occurs: 07-22 15:14:14.669 2387-2488/com.android.systemui E/JavaBinder﹕ Uncaught remote exception! (Exceptions are not yet supported across…
-
7
votes4
answers10421
viewsHow can I get a date (day, month, year, time, minute, and second) converted into milliseconds in Java?
How can I get a date in milliseconds? Example: 24, Sat, Jan, 17:39:50 2015
-
4
votes4
answers5215
viewsError in v7 appcompat in v21 themes
Recently, I went to make a clean project in my project, and I don’t know why it didn’t generate the R.java, and my project was working normally. So I had the brilliant idea to reinstall the SDK and…
-
3
votes4
answers3216
viewsHow to know if the app is open
I wonder if there is how to check if the application is open, with user using it or if it is in the background and he is using another application. Depending if you have it open and user using it I…
-
7
votes4
answers1152
viewsIs it possible to build an HTML5 app for Android with Material Design?
I wonder if it is possible to develop an html/css/js app for android using material design. If not, is there any framework that has the look?
-
0
votes4
answers2941
viewsSplit String using comma as parameter
I am trying to get the values of a Listview to send them to another screen by clicking on the item. So I have the following code: @Override public void onItemClick(AdapterView<?> parent, View…
-
0
votes4
answers374
viewsIs it recommended to use more than one Activity in an Android project?
I always use several (in large project with web service and everything), the ideal is to use only one or no problems use several?
-
5
votes4
answers2064
viewsWhat are the main differences between Handler, Thread and Asynctask?
The Android documentation can end up being a little confusing for those who are starting to understand better what are the differences between a Handler, one Thread and a AsyncTask. Handlers sane…
-
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…
-
1
votes4
answers197
viewsCalling Gridview event in Activity
I have a Gridview Adapter and in it I possess a ImageButton to delete items. It is deleting correctly, however, every time an item is deleted I need to set the current quantity in one TextView that…
-
3
votes4
answers2456
viewsSet coordinates when opening map
I need to open a map with specific coordinates (latitude and longitude). These data I already have, but I don’t know how to set them on the map. PS: It is possible to open directly in Google Maps?…
-
6
votes4
answers756
viewsRemove a specific space in a string
I’m having trouble implementing replace in a String in Android Studio. I need to remove a certain blank in the String. Real examples: 8 hrs 2 mins 1 day 2 mins I need the text to look like this:…
-
5
votes4
answers334
viewsAdvantages of Inner Class
Since I started programming for Android (I believe due to Google examples), I have a habit of creating internal classes for functionalities related to Activity. Example: If the Activity connect to…
-
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:…
-
3
votes4
answers3938
viewsHow to open another Activity from a Navigation Drawer?
I need to call a Activity from an item of a navigation drawer. Anyone can help? These are the items I want to call for Activitys: public boolean onNavigationItemSelected(MenuItem item) { // Handle…
-
10
votes4
answers16860
viewsHow to get the current location of android device?
I am developing an android application that needs to get the current location of the device (Latitude, Longitude) and use this data in google maps...how can I do this? If you help me get only the…
-
2
votes4
answers1242
viewsError with "Cordova run android"
I’m getting an error entering command: "Cordova run android" NOTE: Remembering that I have already set the path of sdk: export…
-
4
votes4
answers6012
viewsHow to increase memory of Android Studio IDE?
Lately I’ve been developing for Android, and I’ve noticed that the Android Studio IDE takes a long time to load and start. I would like to know, how to increase the memory of Android Studio IDE? To…
-
10
votes4
answers6185
viewsWhat is the difference between match_parent and fill_parent?
When I am editing the xml layout I always get confused when choosing between the match_parent and the fill_parent, and I always end up thinking I’m doing everything wrong because I don’t know what…
-
5
votes4
answers602
viewsHow can I replace "String.isEmpty()" in Java?
I got the following: data = new Json().execute(URL).get(); System.out.println(data); if (!data.isEmpty()) { //erro neste data.isEmpty I have a mistake: has an error: Call requires API level 9…
-
3
votes4
answers1275
viewsHow to identify changing the state of connectivity to the Internet to perform a method when connecting?
I’m trying to implement this train and I’m not getting it. I wanted to do the same thing as the colleague who opened the topic, but I could not even follow these examples. I have some questions: In…
-
1
votes4
answers2422
viewsHow to open a keyboard when you "focus" on an Edittext?
I have an Edittext where I used the requestFocus() to get his Focus. I put the setFocus(true) and the setFocusableInTouchMode also. When I open Activity, requestFocus() works, but does not open the…
androidasked 8 years, 6 months ago daniel12345smith 2,120 -
4
votes4
answers2661
viewsWhen creating folder inside the folder /res it is not visible in the left panel
When I put the name of the new folder and press Enter, that same folder does not appear on the left side of the Project nor can I reference its path. The strange thing is that if I put the folder…
-
2
votes4
answers311
viewsCreating Data Base through Stringbuilder
I am creating my database with the class sqliteOpenHelper, passing the creation of DB by String through the StringBuilder. The problem is, it’s just creating the first table, and then it doesn’t…
-
4
votes4
answers1390
viewsHow to change the dynamically displayed Layout
I want to do this, I currently have a Listview that is embedded within my activity_main.xml as follows: <include layout="@layout/lista_categoria" /> I would like to know a way to display…
-
2
votes4
answers304
viewsLeave part of the APP in library
I have an APP with a separate package(Package) for PUSH notification, I would like to take this package and turn it into Library, so that in future apps only add to Library in my project. How can I…