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
928
votes
35 answers

How to send an object from one Android Activity to another using Intents?

How can I pass an object of a custom type from one Activity to another using the putExtra() method of the class Intent?
UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278
924
votes
71 answers

"Conversion to Dalvik format failed with error 1" on external JAR

In my Android application in Eclipse, I get the following error. UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Lorg/xmlpull/v1/XmlPullParser; .... Conversion to Dalvik format failed with error 1 This error only…
Michel
  • 9,220
  • 13
  • 44
  • 59
912
votes
27 answers

android.os.FileUriExposedException: file:///storage/emulated/0/test.txt exposed beyond app through Intent.getData()

The app is crashing when I'm trying to open a file. It works below Android Nougat, but on Android Nougat it crashes. It only crashes when I try to open a file from the SD card, not from the system partition. Some permission problem? Sample…
Thomas Vos
  • 12,271
  • 5
  • 33
  • 71
906
votes
35 answers

How to call a method after a delay in Android

I want to be able to call the following method after a specified delay. In objective c there was something like: [self performSelector:@selector(DoSomething) withObject:nil afterDelay:5]; Is there an equivalent of this method in android with…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
906
votes
32 answers

Making TextView scrollable on Android

I am displaying text in a TextView that appears to be too long to fit into one screen. I need to make my TextView scrollable. How can I do that? Here is the code: final TextView tv = new…
889
votes
35 answers

How to pass an object from one activity to another on Android

I am trying to work on sending an object of my customer class from one Activity and displaying it in another Activity. The code for the customer class: public class Customer { private String firstName, lastName, address; int age; …
Adil Bhatty
  • 17,190
  • 34
  • 81
  • 118
882
votes
29 answers

How to display HTML in TextView?

I have simple HTML:

Title


description here

I want to display HTML styled text it in TextView. How to do this?
UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278
879
votes
37 answers

How can I connect to Android with ADB over TCP?

I am attempting to debug an application on a Motorola Droid, but I am having some difficulty connecting to the device via USB. My development server is a Windows 7 64-bit VM running in Hyper-V, and so I cannot connect directly via USB in the guest…
JDM
  • 9,797
  • 4
  • 22
  • 22
877
votes
23 answers

Unfortunately MyApp has stopped. How can I solve this?

I am developing an application, and everytime I run it, I get the message: Unfortunately, MyApp has stopped. What can I do to solve this? About this question - obviously inspired by What is a stack trace, and how can I use it to debug my…
nhaarman
  • 98,571
  • 55
  • 246
  • 278
867
votes
44 answers

Android Studio Error "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8"

I downloaded the newest Android Studio, and I wanted to run the Android Jetpack Compose Project, but when I ran it, I got the error: > Failed to apply plugin 'com.android.internal.application'. > Android Gradle plugin requires Java 11 to run. You…
Ven Shine
  • 8,739
  • 2
  • 9
  • 24
860
votes
17 answers

Dilemma: when to use Fragments vs Activities:

I know that Activities are designed to represent a single screen of my application, while Fragments are designed to be reusable UI layouts with logic embedded inside of them. Until not long ago, I developed an application as it said that they should…
Emil Adz
  • 40,709
  • 36
  • 140
  • 187
857
votes
18 answers

How do I get extra data from intent on Android?

How can I send data from one activity (intent) to another? I use this code to send data: Intent i=new Intent(context,SendMessage.class); i.putExtra("id", user.getUserAccountId()+""); i.putExtra("name",…
Adham
  • 63,550
  • 98
  • 229
  • 344
856
votes
28 answers

What is the simplest and most robust way to get the user's current location on Android?

The LocationManager API on Android seems like it's a bit of a pain to use for an application that only needs an occasional and rough approximation of the user's location. The app I'm working on isn't really a location app per se, but it does need to…
emmby
  • 99,783
  • 65
  • 191
  • 249
848
votes
10 answers

Sending an Intent to browser to open specific URL

I'm just wondering how to fire up an Intent to the phone's browser to open an specific URL and display it. Can someone please give me a hint?
poeschlorn
  • 12,230
  • 17
  • 54
  • 65
848
votes
32 answers

How to avoid reverse engineering of an APK file

I am developing a payment processing app for Android, and I want to prevent a hacker from accessing any resources, assets or source code from the APK file. If someone changes the .apk extension to .zip then they can unzip it and easily access all…
sachin003
  • 8,983
  • 4
  • 21
  • 23