android-lint

How Do We Configure Android Studio to Run Its Lint on Every Build?

北城以北 提交于 2019-11-30 06:14:43
问题 Once upon a time, particularly in Eclipse-land, Lint would run on every build, and so if you failed Lint checks, you would find out immediately. With Android Studio (tested on 1.3), Lint does not run by default on a build. Newcomers might make mistakes that Lint would check, but since Lint doesn't actually run, the newcomers don't find out about them. (IOW, if a Lint test did not run in a forest, is there really a Lint test?) Comments on this blog post show how to kinda sorta get Lint to run

Missing support for Firebase App Indexing (android lint)

守給你的承諾、 提交于 2019-11-30 06:12:56
问题 I receive this lint warning when analysing my code (Analyse > Inspect Codes) on Android studios. App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent-filler. See issue explanation for more details. What is this warning, and how do I make my app indexable by Google Search? it sounds important for SEO, but I can't find any details on Google. I also like to know how to access the "Issue Explanation" from android studio. Edit: "App is not

How to address android lint complaint about exported Firebase Messaging service implementations?

左心房为你撑大大i 提交于 2019-11-30 02:42:50
Following the Google developer instructions on implementing Firebase in my app , I notice that android lint complains. The idea is that we have to implement two services which inherit from Firebase services: public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService { ... } public class MyFirebaseMessagingService extends FirebaseMessagingService { ... } and then register those services in the manifest. But, it's not quite perfect. In particular, these two recommended AndroidManifest.xml service entries do not contain any special permissions: <service android:name="

Understanding @SuppressLint(“NewApi”) annotation

蓝咒 提交于 2019-11-29 20:17:17
I am an android beginner. While trying a code of managing activity life cycle, I encountered a new thing. package com.example.activitylaunch; import android.os.Build; import android.os.Bundle; import android.annotation.SuppressLint; import android.app.ActionBar; import android.app.Activity; import android.view.Menu; import android.widget.TextView; @SuppressLint("NewApi") public class MainActivity extends Activity { TextView mTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTextView = (TextView)

How does setting baselineAligned to false improve performance in LinearLayout?

断了今生、忘了曾经 提交于 2019-11-29 19:38:14
I was just building some UI in xml, and Lint gave me a warning and said to set android:baselineAligned to false to improve performance in ListView. The docs for the Lint changes that added this warning say Layout performance: Finds LinearLayouts with weights where you should set android:baselineAligned="false" for better performance, and also finds cases where you have nested weights which can cause performance problems. Can somebody explain why this improves performance, specifically when weight is involved? Nima G By setting android:baselineAligned="false" , you're preventing the extra work

Context of lint.xml and inspection profile

房东的猫 提交于 2019-11-29 12:24:43
问题 In Android Studio there is the lint.xml configuration and ./idea/inspectionProfiles/.xml manageable via Settings => Editor => Inspections . I understand lint.xml is used by lint command line tool and the inspection profile is used by Android Studio IDE. The official documentation is here. I also found this post How is lint integrated with IntelliJ inspections in Android Studio? and this post Android lint on command-line missing issue groups (versus options available in Android Studio). This

Android API level annotation for Android libraries

孤人 提交于 2019-11-29 12:00:56
问题 I am writing an Android library. The vast majority of the interface in the lbirary supports Android API level 10 or above. Some functionality, though, requires a higher API level. For instance, part of the library requires API 18 for Bluetooth Low Energy. For the sake of concreteness, let's say that the library produces three classes ClassA , ClassB and ClassC . ClassA uses functionality available in API 10, ClassB uses functionality available in API 14 and ClassC uses functionality available

Constant 'Running Android Lint' Failed, nullpointerexception popping up in Eclipse (but doesn't seem to be my code)

旧城冷巷雨未停 提交于 2019-11-29 10:43:31
问题 I don't recall what it is I updated (probably some android ADK items), but suddenly I keep getting a "Problem Occurred" text box in Eclipse, frequently . It says: 'Running Android Lint' has encountered a problem. Failed And there is an OK and a Details button. When I click Details, I get: Failed java.lang.NullPointerException From the text box, I can't tell what it is that failed....it sounds like the running of Lint itself failed, and failed from a NPE. There is no line number associated

Android Lint: how to ignore missing translation warnings in a regional locale string file that purposely only overrides some default translations?

假如想象 提交于 2019-11-28 23:39:26
问题 Is it possible to translate some strings, but not all, in a separate resource file without Lint complaining about MissingTranslation ? For example: my app's strings are all in res/values/strings.xml . One of the strings is <string name="postal_code">Postal Code</string> Since "postal code" is usually called "zip code" in the US, I want to add another resource res/values-en-rUS/strings.xml with contents: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="postal_code">Zip Code<

Android Lint contentDescription warning

倾然丶 夕夏残阳落幕 提交于 2019-11-28 16:35:52
I am getting warning as "[Accessibility] Missing contentDescription attribute on image" for imageview. while using android lint What does that mean? Santhosh Shettigar Resolved this warning by setting attribute android:contentDescription for my ImageView android:contentDescription="@string/desc" Android Lint support in ADT 16 throws this warning to ensure that image widgets provide a contentDescription. This defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used