AndroidProcesses


Source link: https://github.com/jaredrummler/AndroidProcesses

AndroidProcesses

A small Android library to get the current running processes


PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED

Google has significantly restricted access to /proc in Android Nougat. This library will not work on Android 7.0. Please star this issue.

More details can be found at:

What is this library for?

This small library can get a list of running apps and does not require any permissions.

Why would I need this?

Android 5.0+ killed getRunningTasks(int) and getRunningAppProcesses(). Both of these methods are now deprecated and only return the caller’s application process.

Android 5.0 introduced UsageStatsManager which provides access to device usage history and statistics. This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps. However, declaring the permission implies intention to use the API and the user of the device can grant permission through the Settings application.

Usage

Get a list of running apps:

// Get a list of running apps List<AndroidAppProcess> processes = AndroidProcesses.getRunningAppProcesses();
  for (AndroidAppProcess process : processes) {

// Get some information about the process
String processName = process.name;
 Stat stat = process.stat();

int pid = stat.getPid();

int parentProcessId = stat.ppid();

long startTime = stat.stime();

int policy = stat.policy();

char state = stat.state();

 Statm statm = process.statm();

long totalSizeOfProcess = statm.getSize();

long residentSetSize = statm.getResidentSetSize();

 PackageInfo packageInfo = process.getPackageInfo(context, 0);

String appName = packageInfo.applicationInfo.loadLabel(pm).toString();
 
}

Limitations

  • System apps will not be included on some Android versions because they have a higher SELinux context.
  • This is not a full replacement of getRunningAppProcesses(). The library does not provide a processes' pkgList, lru, or importance.
  • This is currently not working on the N developer preview.

Download

Download the latest AAR or grab via Gradle:

compile 'com.jaredrummler:android-processes:1.1.1'

or Maven:

<dependency>
<groupId>com.jaredrummler</groupId>
<artifactId>android-processes</artifactId>
<version>1.1.1</version>
<type>aar</type> </dependency>

License

Copyright (C) 2015 Jared Rummler  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

CatLog is a free and open-source log reader for Android.

It shows a scrolling (tailed) view of the Android "Logcat" system log, hence the goofy name. It also allows you to record logs in real time, send logs via email, and filter using a variety of criteria.

Simply pass a url to play youtube video on new activity. It supports screen orientation, media volume control and etc.

The design goals of this project are as follows:

  • Provide an on-device view of explicit log output during app development.
  • Do not disrupt the normal lifecycle of the app (no app switching).
  • Transparent implementation (using the same API as android.util.Log, easily disabled).
  • Minimal setup.

Android simple listview by using linearlayout. Behavior is the same except no scrollable, thus you can use it freely in scrollview. It is very basic implementation, you should not use for the huge list.

Paginize is a light-weight application framework for Android.

An ImageView that supports different kind of cropping rather than the only Android is currently supporting: centerCrop

Using this library, you can crop your desired image by sides described below:

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