Coder Social home page Coder Social logo

morristech / android-textoverlay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saschpe/android-textoverlay

0.0 1.0 0.0 267 KB

Provides a simple service that allows to display arbitrary text as a system-window overlay.

License: Apache License 2.0

Java 100.00%

android-textoverlay's Introduction

Android TextOverlay

Download Android Arsenal License Build Status ![Methods and size](https://img.shields.io/badge/Methods and size-core: 61 | deps: 12880 | 8 KB-e91e63.svg)

This library provides a simple service that allows to display arbitrary text as a system-window overlay.

It can be used to display debugging information in the debug build of your app so that every screenshot that QA or beta testers do will automatically include the product flavor or build type of your APK. You can provide additional information such as the Git commit hash or arbitrary strings easily:

Overlay Updated overlay

Usage

You can start / stop the text overlay service the default way in your activities:

@Override
protected void onStart() {
    super.onStart();
    startService(new Intent(this, TextOverlayService.class));
}

@Override
protected void onDestroy() {
    stopService(new Intent(this, TextOverlayService.class));
    super.onDestroy();
}

A more convenient way is to use the include activity lifecycle callbacks in your app's application sub-class:

public class Application extends android.app.Application {
    @Override
    public void onCreate() {
        super.onCreate();
        registerActivityLifecycleCallbacks(new TextOverlayActivityLifecycleCallbacks());
    }
}

Furthermore, you can declare the service in your AndroidManifest.xml to provide additional parameters. This is entirely optional as the library will provide a default declaration for you:

<service
    android:name=".service.TextOverlayService"
    android:exported="false" />

Either way, you have to declare the SYSTEM_ALERT_WINDOW permission in you manifest. The library does not do that for you since you may only want to use the text overlay service in specific flavors or build types:

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

On API level 23 or later, you will have to ask the user to grant this permission. However, the provided TextOverlayActivityLifecycleCallbacks will handle that for you.

Check out the provided example applications for different ways to use this library:

  • textoverlay-activity-example
  • textoverlay-lifecycle-example

Download

compile 'saschpe.android:textoverlay:1.0.8'

Snapshots of the development version are available in Sonatype's snapshots repository.

License

Copyright 2016 Sascha Peilicke

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-textoverlay's People

Contributors

saschpe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.