Questions tagged [android]

Android is Google's mobile operating system, used for programming or developing digital devices (Smartphones, Tablets, Automobiles, TVs, Wear, Glass, IoT). For topics related to Android, use Android-specific tags such as android-intent, android-activity, android-adapter, etc. For questions other than development or programming but related to the Android framework, use this link: https://android.stackexchange.com.

Android is a mobile operating system developed by a consortium of developers known as the Open Handset Alliance, with the main contributor and commercial marketer being Google. It is based on a modified version of the Linux kernel and other open source software and is designed primarily for touchscreen mobile devices such as smartphones and tablets. In addition, Google has further developed Android TV for televisions, Android Auto for cars, and Wear OS for wrist watches, each with a specialized user interface. Variants of Android are also used on game consoles, digital cameras, PCs, and other electronics.

Tag Usage

When asking about your app force closing or crashing, you have to include an MCVE, which has to include a stacktrace. See also: How to Ask

When adding additional tags to questions, please use the Android-specific tags such as , , , and not individual tags like , or .

For non-developer Android questions, see Android Enthusiasts Stack Exchange.

Manufacturer-Monitored Tags

These tags are used for developer assistance by Android device manufacturers for their specific devices:

ISV-Monitored Tags

These tags are meant for libraries, services, etc. for Android that are monitored by their respective developers:

( (now deprecated))

Resources

Android Versions

Official API Documentation

Applications

Source Code and Building

Developers

Playlist of videos for Google I/O.

  • Android Tools Project Site
    On this site, you will find information about the Developer Tools for Android (Dalvik Debug Monitor Server (DDMS), hierarchy viewer, lint) and various tips & how-to documents.

In addition, there are other Android developer support sites, operating in other languages.

For non-developer questions, see the Android Enthusiasts Stack Exchange site.

Android Programming Books

Android Loggers

  • logger - Simple, pretty and powerful logger for android
  • timber - A logger with a small, extensible API that provides utility on top of Android's normal Log class.
  • LoggingInterceptor - An OkHttp interceptor which pretty logs request and response data.
  • Bugfender - Upload your logs and check them online, specially made for mobile
  • EzyLogger - Simple Lightweight logger
  • Logback Android - Logback port to Android which provides a highly configurable logging framework for Android apps.

Chat Rooms

Chat about Android with other Stack Overflow users:

Stack Exchange

IRC:

Development IDEs

Tutorials & Examples

Online Courses

Online Specialization Verified Courses

Sites that list Android libraries

Open-sourced Android apps

Samples

Podcasts for Android

Weekly

Frequently Asked Questions

1409497 questions
174
votes
13 answers

What is Activity.finish() method doing exactly?

I'm developing android applications for a while, and followed a lot of posts about activity life cycle, and application's life cycle. I know Activity.finish() method calls somewhere in the way to Activity.onDestroy(), and also removing the activity…
Tal Kanel
  • 10,475
  • 10
  • 60
  • 98
173
votes
10 answers

How to draw rounded rectangle in Android UI?

I need to draw a rounded rectangle in the Android UI. Having the same rounded rectangle for TextView and EditText would also be helpful.
M.A.Murali
  • 9,988
  • 36
  • 105
  • 182
173
votes
20 answers

Why am I seeing net::ERR_CLEARTEXT_NOT_PERMITTED errors after upgrading to Cordova Android 8?

After upgrading to Cordova Android 8.0, I am seeing net::ERR_CLEARTEXT_NOT_PERMITTED errors when trying to connect to http:// targets. Why is that and how can I resolve this?
Oliver Salzburg
  • 21,652
  • 20
  • 93
  • 138
173
votes
17 answers

How can I enable or disable the GPS programmatically on Android?

I know that the question about turning on/off GPS programatically on android has been discussed many times, and the answer is always the same: "You can't for security/privacy reasons, you have to forward to location preferences screen and let the…
maid450
  • 7,478
  • 3
  • 37
  • 32
173
votes
11 answers

Start Activity from Service in Android

Android: public class LocationService extends Service { @Override public void onStart(Intent intent, int startId) { super.onStart(intent, startId); startActivity(new Intent(this, activity.class)); } } I launched this…
d-man
  • 57,473
  • 85
  • 212
  • 296
173
votes
15 answers

Android soft keyboard covers EditText field

Is there a way to make the screen scroll to allow the text field to be seen?
Alexis
  • 23,545
  • 19
  • 104
  • 143
173
votes
8 answers

Check if a path represents a file or a folder

I need a valid method to check if a String represents a path for file or a directory. What are valid directory names in Android? As it comes out, folder names can contain '.' chars, so how does system understand whether there's a file or a folder?
Egor
  • 39,695
  • 10
  • 113
  • 130
173
votes
16 answers

How can I maintain fragment state when added to the back stack?

I've written up a dummy activity that switches between two fragments. When you go from FragmentA to FragmentB, FragmentA gets added to the back stack. However, when I return to FragmentA (by pressing back), a totally new FragmentA is created and…
Eric
  • 5,323
  • 6
  • 30
  • 35
172
votes
6 answers

Why are nested weights bad for performance? Alternatives?

I have written a couple layout files where I used the layout_weight attribute to create a ratio between different views. At some point, I start getting lint warnings about nested weights. So, I wonder why are nested weights bad for performance, and…
MobileCushion
  • 7,065
  • 7
  • 42
  • 62
172
votes
4 answers

Event for Handling the Focus of the EditText

Can anyone suggest to me any event related to the focus of the EditText? My application contains an EditText, which accepts a URL in it. Now my problem is that, that after the user will enter the URL in the field and Move further, without any of the…
Sheetal Shelar
  • 1,731
  • 2
  • 11
  • 5
172
votes
17 answers

How can I decrease the size of Ratingbar?

In my activity I have some Rating bars. But the size of this bar is so big! How can I make it smaller? Edit Thanks to Gabriel Negut, I did it with the following style:
Hesam
  • 52,260
  • 74
  • 224
  • 365
172
votes
8 answers

Where are shared preferences stored?

Where in an Eclipse project might one encounter a shared preferences file?
farm ostrich
  • 5,881
  • 14
  • 55
  • 81
172
votes
33 answers

Generate SHA-1 for Flutter/React-Native/Android-Native app

I'm trying to generate a SHA-1 for a Flutter app, for Android studio to support Google Sign in, but I don't know how to do that, I saw some posts that indicate to run a command, but there I need a jks file I guess, and flutter doesn't create…
Joseph Arriaza
  • 12,014
  • 21
  • 44
  • 63
172
votes
16 answers

How to draw a line in android

Can anybody tell how to draw a line in Android, perhaps with an example?
mohan
  • 13,035
  • 29
  • 108
  • 178
172
votes
8 answers

android.content.res.Resources$NotFoundException: String resource ID #0x0

I'm developing an Android app which reads data from MySQL database and I faced this error. I have this XML layout:
user2881604
  • 2,330
  • 3
  • 21
  • 38
1 2 3
99
100