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
847
votes
16 answers

Android getResources().getDrawable() deprecated API 22

With new android API 22 getResources().getDrawable() is now deprecated. Now the best approach is to use only getDrawable(). What changed?
838
votes
22 answers

What's the best way to limit text length of EditText in Android

What's the best way to limit the text length of an EditText in Android? Is there a way to do this via xml?
hpique
  • 119,096
  • 131
  • 338
  • 476
833
votes
10 answers

How do I discover memory usage of my application in Android?

How can I find the memory used on my Android application, programmatically? I hope there is a way to do it. Plus, how do I get the free memory of the phone too?
Andrea Baccega
  • 27,211
  • 13
  • 45
  • 46
831
votes
36 answers

How do you install an APK file in the Android emulator?

I finally managed to obfuscate my Android application, now I want to test it by installing the APK file and running it on the emulator. How can I install an APK file on the Android Emulator?
aryaxt
  • 76,198
  • 92
  • 293
  • 442
831
votes
39 answers

How to change fontFamily of TextView in Android

So I'd like to change the android:fontFamily in Android but I don't see any pre-defined fonts in Android. How do I select one of the pre-defined ones? I don't really need to define my own TypeFace but all I need is something different from what it…
Tarik
  • 79,711
  • 83
  • 236
  • 349
830
votes
33 answers

Set up adb on Mac OS X

I spent quite sometime figuring how to set up adb on Mac, so I figure writing how to set it up might be useful to some people. adb is the command line tool to install and run android apps on your phone/emulator
changey
  • 18,606
  • 9
  • 28
  • 34
828
votes
31 answers

How do I add a library project to Android Studio?

How do I add a library project (such as Sherlock ABS) to Android Studio? (Not to the old ADT Eclipse-based bundle, but to the new Android Studio.)
Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158
824
votes
27 answers

How to determine when Fragment becomes visible in ViewPager

Problem: Fragment onResume() in ViewPager is fired before the fragment becomes actually visible. For example, I have 2 fragments with ViewPager and FragmentPagerAdapter. The second fragment is only available for authorized users and I need to ask…
4ntoine
  • 19,816
  • 21
  • 96
  • 220
823
votes
45 answers

How can I access my localhost from my Android device?

I'm able to access my laptop web server using the Android emulator, I'm using 10.0.2.2:portno works well. But when I connect my real Android phone, the phone browser can't connect to the same web server on my laptop. The phone is connected to the…
gath
  • 24,504
  • 36
  • 94
  • 124
823
votes
19 answers

How to define a circle shape in an Android XML drawable file?

I have some problems finding the documentation of the definitions of shapes in XML for Android. I would like to define a simple circle filled with a solid color in an XML File to include it into my layout files. Sadly the Documentation on…
Janusz
  • 187,060
  • 113
  • 301
  • 369
823
votes
11 answers

Service vs IntentService in the Android platform

I am seeking an example of something that can be done with an IntentService that cannot be done with a Service (and vice-versa)? I also believe that an IntentService runs in a different thread and a Service does not. So, as far as I can see,…
roiberg
  • 13,629
  • 12
  • 60
  • 91
816
votes
23 answers

How to put a border around an Android TextView?

Is it possible to draw a border around an Android TextView?
yamspog
  • 18,173
  • 17
  • 63
  • 95
812
votes
21 answers

How to prevent a dialog from closing when a button is clicked

I have a dialog with EditText for input. When I click the "yes" button on dialog, it will validate the input and then close the dialog. However, if the input is wrong, I want to remain in the same dialog. Every time no matter what the input is, the…
807
votes
24 answers

Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

I've always programmed Android with Eclipse and decided to start migrating to Android Studio. I decided to use the same SDK I already had for Eclipse, then: Started a new project Set minimum SDK 4.0 (API Level 14) Choose Blank Activity option Used…
Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
805
votes
54 answers

All com.android.support libraries must use the exact same version specification

After updating to android studio 2.3 I got this error message. I know it's just a hint as the app run normally but it's really strange. All com.android.support libraries must use the exact same version specification (mixing versions can lead to…
humazed
  • 74,687
  • 32
  • 99
  • 138