Lynx


Source link: https://github.com/pedrovgs/Lynx

Lynx

Are you bored of connect your device to your computer to know what's happening inside your app? If you hate it, this is going to be your favorite library. Shake your phone, press a button or add a LynxView to your layouts and you'll see what Andoird logcat is printing :)

Lynx is an Android library created to show a custom view with all the information logcat is printing, different traces of different levels will be rendererd to show from log messages to your application exceptions. You can filter this traces (using regular expressions if you want), share your logcat to other apps, configure the max number of traces to show or the sampling rate used by the library. The min Api Level supported is 10.

Screenshots

Usage

To use Lynx Android library and get your logcat inside your app you can use different approaches:

    1. Start LynxActivity using a LynxConfig object.
private void openLynxActivity() {

  LynxConfig lynxConfig = new LynxConfig();

  lynxConfig.setMaxNumberOfTracesToShow(4000)

.setFilter("WTF");

Intent lynxActivityIntent = LynxActivity.getIntent(this, lynxConfig);

  startActivity(lynxActivityIntent);

}
 
    1. Configure LynxShakeDetector to start LynxActivity if you shake your phone.
public class YourApplication extends Application {

 @Override public void onCreate() {

  super.onCreate();

  LynxShakeDetector lynxShakeDetector = new LynxShakeDetector(this);

  lynxShakeDetector.init();

}
 
}
 
    1. Add LynxView to your layouts and configure it as you wish.
<com.github.pedrovgs.lynx.LynxView

 xmlns:lynx="http://schemas.android.com/apk/res-auto"

 android:layout_width="match_parent"

 android:layout_height="@dimen/lynx_view_height"

 lynx:filter="Lynx"

 lynx:max_traces_to_show="1500"

 lynx:text_size="12sp"/> 

You can provide different configurations based on styleable attributes:

  • Filter to apply by default: lynx:filter="Lynx"
  • Max number of traces to show inside LynxView: lynx:max_traces_to_show=3000
  • Text size used to render traces inside LynxView: lynx:text_size="12sp
  • Sampling rate used to read from the application log: lynx:sampling_rate=200

To be able to show LynxActivity shaking your phone or starting it programatically you'll have to add LynxActivity to your AndroidManifest.

<activity android:name="com.github.pedrovgs.lynx.LynxActivity"/> 

If you have to support applications based on Android 2.X you'll have to add READ_LOG permission to your AndroidManifest. This is not needed for newer Android versions.

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

Add it to your project

Add Lynx dependency to your build.gradle

dependencies{

  compile 'com.github.pedrovgs:lynx:1.1.0' 
}
 

Or add Lynx as a new dependency inside your pom.xml

<dependency>
  <groupId>com.github.pedrovgs</groupId>
  <artifactId>lynx</artifactId>
  <version>1.0.7</version>
  <type>aar</type> </dependency> 

Do you want to contribute?

I'd like to improve this library with your help, there are some new features to implement waiting for you ;)

  • Play/Pause LynxView.
  • Provide a custom UI based on styles.
  • Any cool feature you can imagine!

Libraries used in this project

  • [Renderers] 3
  • [Seismic] 4
  • [Robolectric] 5
  • [JUnit] 6
  • [Mockito] 7

Developed By

License

Copyright 2015 Pedro Vicente Gómez Sánchez  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. 

Resources

RxJava bindings for DBFlow models, and query language.

A custom ImageButton that invoke onClickListener only when touch is inside the circle not outside (rectangle area of button).

Project vlayout is a powerfull LayoutManager extension for RecyclerView, it provides a group of layouts for RecyclerView. Make it able to handle a complicate situation when grid, list and other layouts in the same recyclerview.

Simple and easy json parser, json generator, and data holder based on JSONArray and JSONObject for android.

Pinview library for Android.

Material Chip view can be used as tags for categories, contacts or creating text clouds.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes