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
1223
votes
54 answers

How do I "select Android SDK" in Android Studio?

After a successful import of an Eclipse-Android-Project into "Android Studio 1.4", I get the error "Please select Android SDK" when I click on the button to run the application in the simulator, I can't find any way of doing that. This dialog opens…
delete
  • 18,144
  • 15
  • 48
  • 79
1214
votes
64 answers

You need to use a Theme.AppCompat theme (or descendant) with this activity

Android Studio 0.4.5 Android documentation for creating custom dialog boxes: http://developer.android.com/guide/topics/ui/dialogs.html If you want a custom dialog, you can instead display an Activity as a dialog instead of using the Dialog APIs.…
ant2009
  • 27,094
  • 154
  • 411
  • 609
1212
votes
38 answers

How do I display an alert dialog on Android?

I want to display a dialog/popup window with a message to the user that shows "Are you sure you want to delete this entry?" with one button that says 'Delete'. When Delete is touched, it should delete that entry, otherwise nothing. I have written a…
UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278
1207
votes
30 answers

Can't create handler inside thread that has not called Looper.prepare()

What does the following exception mean; how can I fix it? This is the code: Toast toast = Toast.makeText(mContext, "Something", Toast.LENGTH_SHORT); This is the exception: java.lang.RuntimeException: Can't create handler inside thread that has not…
michael
  • 106,540
  • 116
  • 246
  • 346
1190
votes
34 answers

Android "Only the original thread that created a view hierarchy can touch its views."

I've built a simple music player in Android. The view for each song contains a SeekBar, implemented like this: public class Song extends Activity implements OnClickListener,Runnable { private SeekBar progress; private MediaPlayer mp; …
herpderp
  • 15,819
  • 12
  • 42
  • 45
1185
votes
37 answers

findViewById in Fragment

I am trying to create an ImageView in a Fragment which will refer to the ImageView element which I have created in the XML for the Fragment. However, the findViewById method only works if I extend an Activity class. Is there anyway of which I can…
simplified.
  • 11,977
  • 5
  • 17
  • 8
1159
votes
18 answers

Fling gesture detection on grid layout

I want to get fling gesture detection working in my Android application. What I have is a GridLayout that contains 9 ImageViews. The source can be found here: Romain Guys's Grid Layout. That file I take is from Romain Guy's Photostream application…
gav
  • 29,022
  • 23
  • 65
  • 90
1150
votes
40 answers

How to make links in a TextView clickable

I have the following TextView defined:
Richard
  • 28,691
  • 8
  • 33
  • 34
1128
votes
108 answers

R cannot be resolved - Android error

I just downloaded and installed the new Android SDK. I wanted to create a simple application to test drive it. The wizard created this code: package eu.mauriziopz.gps; import android.app.Activity; import android.os.Bundle; public class ggps…
1126
votes
16 answers

Download a file with Android, and showing the progress in a ProgressDialog

I am trying to write a simple application that gets updated. For this I need a simple function that can download a file and show the current progress in a ProgressDialog. I know how to do the ProgressDialog, but I'm not sure how to display the…
Tom Leese
  • 19,309
  • 12
  • 45
  • 70
1115
votes
45 answers

How to add dividers and spaces between items in RecyclerView

This is an example of how it could have been done previously in the ListView class, using the divider and dividerHeight parameters:
EyesClear
  • 28,077
  • 7
  • 32
  • 43
1100
votes
14 answers

How to manage startActivityForResult on Android

In my activity, I'm calling a second activity from the main activity by startActivityForResult. In my second activity, there are some methods that finish this activity (maybe without a result), however, just one of them returns a result. For…
Hesam
  • 52,260
  • 74
  • 224
  • 365
1097
votes
21 answers

Static way to get 'Context' in Android?

Is there a way to get the current Context instance inside a static method? I'm looking for that way because I hate saving the 'Context' instance each time it changes.
Andrea Baccega
  • 27,211
  • 13
  • 45
  • 46
1084
votes
22 answers

How to convert a Drawable to a Bitmap?

I would like to set a certain Drawable as the device's wallpaper, but all wallpaper functions accept Bitmaps only. I cannot use WallpaperManager because I'm pre 2.1. Also, my drawables are downloaded from the web and do not reside in R.drawable.
Rob
  • 15,041
  • 6
  • 25
  • 27
1074
votes
35 answers

Android Studio: Add jar as library?

I'm trying to use the new Android Studio but I can't seem to get it working correctly. I'm using the Gson library to serialize/deserialize JSON-objects. But the library somehow isn't included in the build. I had created a new project with just a…