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 a "force close" or "unfortunately app has stopped" problem in your app or any other exception, always include the exception stack trace from Logcat in the question.

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 which 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

1336337 questions
6040
votes
34 answers

What is the difference between "px", "dip", "dp" and "sp"?

What is the difference between Android units of measure? px dip dp sp
4039
votes
119 answers

How do you close/hide the Android soft keyboard programmatically?

I have an EditText and a Button in my layout. After writing in the edit field and clicking on the Button, I want to hide the virtual keyboard when touching outside the keyboard. I assume that this is a simple piece of code, but where can I find an…
3768
votes
11 answers

Proper use cases for Android UserManager.isUserAGoat()?

I was looking at the new APIs introduced in Android 4.2. While looking at the UserManager class I came across the following method: public boolean isUserAGoat() Used to determine whether the user making this call is subject to…
Ovidiu Latcu
  • 68,451
  • 14
  • 71
  • 82
3451
votes
77 answers

Why is the Android emulator so slow? How can we speed up the Android emulator?

I have got a 2.67  GHz Celeron processor, and 1.21  GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android Emulator should start fairly quickly on such a machine, but for me, it doesn't. I have followed all the…
Andrie
  • 3,461
  • 3
  • 14
  • 3
3007
votes
53 answers

How to stop EditText from gaining focus at Activity startup in Android

I have an Activity in Android, with two elements: EditText ListView When my Activity starts, the EditText immediately has input focus (flashing cursor). I don't want any control to have input focus at startup. I…
Mark
  • 37,835
  • 15
  • 37
  • 46
2895
votes
50 answers

Is there a unique Android device ID?

Do Android devices have a unique ID, and if so, what is a simple way to access it using Java?
Tyler
  • 29,539
  • 8
  • 19
  • 22
2715
votes
35 answers

How to save an activity state using save instance state?

I've been working on the Android SDK platform, and it is a little unclear how to save an application's state. So given this minor re-tooling of the 'Hello, Android' example: package com.android.hello; import android.app.Activity; import…
Bernard
  • 43,502
  • 18
  • 52
  • 69
2523
votes
64 answers

How to fix 'android.os.NetworkOnMainThreadException'?

I got an error while running my Android project for RssReader. Code: URL url = new URL(urlToRssFeed); SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = factory.newSAXParser(); XMLReader xmlreader =…
bejoy george
  • 27,155
  • 5
  • 15
  • 15
2149
votes
67 answers

How do I center text horizontally and vertically in a TextView?

How do I center the text horizontally and vertically in a TextView, so that it appears exactly in the middle of the TextView in Android?
pupeno
  • 256,034
  • 114
  • 324
  • 541
2092
votes
30 answers

What is 'Context' on Android?

In Android programming, what exactly is a Context class and what is it used for? I read about it on the developer site, but I am unable to understand it clearly.
Brigadier
  • 21,663
  • 4
  • 15
  • 9
2088
votes
23 answers

Is there a way to run Python on Android?

We are working on an S60 version and this platform has a nice Python API.. However, there is nothing official about Python on Android, but since Jython exists, is there a way to let the snake and the robot work together??
e-satis
  • 515,820
  • 103
  • 283
  • 322
2001
votes
40 answers

How to lazy load images in ListView in Android

I am using a ListView to display some images and captions associated with those images. I am getting the images from the Internet. Is there a way to lazy load images so while the text displays, the UI is not blocked and images are displayed as they…
lostInTransit
  • 68,087
  • 58
  • 193
  • 270
1940
votes
17 answers

"Debug certificate expired" error in Eclipse Android plugins

I am using Eclipse Android plugins to build a project, but I am getting this error in the console window: [2010-02-03 10:31:14 - androidVNC]Error generating final archive: Debug certificate expired on 1/30/10 2:35 PM! How do I fix it?
hap497
  • 129,793
  • 42
  • 77
  • 91
1895
votes
43 answers

How to get screen dimensions as pixels in Android

I created some custom elements, and I want to programmatically place them to the upper right corner (n pixels from the top edge and m pixels from the right edge). Therefore I need to get the screen width and screen height and then set position: int…
Niko Gamulin
  • 63,517
  • 91
  • 213
  • 274
1460
votes
39 answers

How can I open a URL in Android's web browser from my application?

How to open an URL from code in the built-in web browser rather than within my application? I tried this: try { Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link)); startActivity(myIntent); } catch…
Arutha
  • 24,390
  • 25
  • 64
  • 80
1
2 3
99 100