android-library

Listener when an application is started?

泄露秘密 提交于 2019-12-24 08:41:38
问题 Is there any way to implement a listener which is notified when any application is started?Not my application any application is started or stopped? If not possible is there a way to find out if a particular application has started or stopped i,e a listener when facebook app(for example) is started or stopped? 回答1: use a STICKY Service that tracks all of the running application @Override public int onStartCommand(Intent intent, int flags, int startId) { Timer timer = new Timer(); timer

Referenced Java Project Compiled Update Doesn't Update Android Library Project

核能气质少年 提交于 2019-12-24 00:46:37
问题 I have an Android Project(A) that's my main application, it references an Android library Project(B). The Library Project references a standard Java Project(C) which is my standard library for many Java and Android projects. I will reference these three projects as A,B,and C. My issue is if I make a change to the C project it will auto compile but B doesn't compile hence A doesn't see the changes. The only way to do this is to clean B manually. Is there a way in Eclipse to force B to re

Failed automated Android UI-Tests on Jenkins-Server due to complex lib-project dependencies of the main project(s)

試著忘記壹切 提交于 2019-12-23 10:28:51
问题 Shortly summerized, my project structure is like follows: - A and B are android lib-projects, where B depends on A - C (normal android project) depends on B - T is test-project of C I have correspondingly two projects on my jenkins server, one for C and one for T , which have their own script for build, using actually just android and ant commands. So there is no problem with the build of C , but i can't get work build of T . "Work" should there mean, that, depending on the script, it either

How to obfuscate android library(.aar) using proguard?

大城市里の小女人 提交于 2019-12-23 09:50:02
问题 I want to obfuscate the .aar library using proguard for distribution purpose, I tried many solution over internet but nothing has worked till now, only some code are obfuscated. Can anybody help me to solve the issue? 回答1: In your build.gradle, add consumerProguardFiles under defaultConfig : android { compileSdkVersion Integer.parseInt("${COMPILE_SDK}") buildToolsVersion "${BUILD_TOOLS_VERSION}" defaultConfig { targetSdkVersion Integer.parseInt("${TARGET_SDK}") minSdkVersion Integer.parseInt(

What does checking the “is Library” checkbox do “Under the Cover”?

独自空忆成欢 提交于 2019-12-23 07:43:10
问题 I noticed that when I convert an existing Android Application project to an Android Library project by checking the "is Library" checkbox, nothing changes in the project's source code or XML files. So what really happens when the "is Library" checkbox is checked? What changes internally, in the package and/or project files ? Where can I learn more about this? To better explain my question: What I am interested to know (mainly for troubleshooting purposes) is what differentiates an Application

Can I mark a resource in my android project as deprecated?

牧云@^-^@ 提交于 2019-12-23 07:29:09
问题 I have an android library for which I would like to mark some resources as deprecated. Drawables, dimensions, durations... I read somewhere that I could add deprecated="deprecated" to the resource definition but it doesn't seem to do anything. In Android R you can see things such as @java.lang.Deprecated public static final int autoText = 16843114; I'm trying to produce something similar by editing durations.xml, values.xml, or even public.xml... Thanks! 回答1: Short answer: Not possible.

Creating template app for multiple android apps

不问归期 提交于 2019-12-23 04:49:10
问题 So here is the thing. I want to create few apps, which they all should look exactly the same, but only one variable should change. I'm looking for a way to create one library and to import it in all the other apps, and instead of updating a lot of apps, I would be able to update just the library. Any ideas how such thing can be accomplished? Maybe using meta-data? Thanks 回答1: In addition to CommonsWear's answer, which is correct if you are using Android Studio, what you require can also be

Issues when using a library project in android

筅森魡賤 提交于 2019-12-23 04:45:51
问题 I have developed a Project. it is working fine. so i want to use this project as a library for some other project. so i have created this project as a library. Later i have created new Application and added this library project to my new Application Project. then i run the app . suddenly the previous screen in the activity stack is finishing automatically. i am not getting why this is Happening. Any one have the idea about this issue , Please suggest me 回答1: Even though it is added as a

Android studio make jar file with dependencies

一世执手 提交于 2019-12-23 03:14:58
问题 I want to use android studio to make a library project to a jar file which contains many jar files and library projects like this: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':app:libraries:MyLibrary:app') compile 'com.luckycatlabs:SunriseSunsetCalculator:1.2' compile project(':app:libraries:MyLibrary:app:libraries:MySubLibrary:app') } How can I make a jar file with all this dependencies and own class files? 回答1: Finally, I found the solution: android

Get Android App Start Time in a non-activity class

江枫思渺然 提交于 2019-12-23 02:38:11
问题 I want to get the start datetime of the android application. The simplest way to do is to note the current time in the onCreate of activity class, but my issue is that I am creating an android library with some utility functions. I want to find out the start datetime of end user application (that is using the library) within the library itself. I don't want to bound the app developer to note down the start time in the onCreate method and pass to the library method. Considering this scenario,