Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vrallev/app-context
A tiny utility library for Android to get the global app context without overriding the application class.
https://github.com/vrallev/app-context
android android-application application-context context
Last synced: 3 months ago
JSON representation
A tiny utility library for Android to get the global app context without overriding the application class.
- Host: GitHub
- URL: https://github.com/vrallev/app-context
- Owner: vRallev
- License: apache-2.0
- Archived: true
- Created: 2016-10-09T17:05:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-09T17:16:42.000Z (about 8 years ago)
- Last Synced: 2024-09-21T18:14:40.237Z (4 months ago)
- Topics: android, android-application, application-context, context
- Language: Java
- Size: 81.1 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# App-Context
A tiny utility library for Android to get the global app context without overriding the application class. This is especially helpful for Android library projects.
## Download
Download [the latest version](http://search.maven.org/#search|gav|1|g:"net.vrallev.android"%20AND%20a:"app-context") or grab via Gradle:
```groovy
dependencies {
compile 'net.vrallev.android:app-context:1.0.0'
}
```## Usage
Use `AppContext.get()` to get the global application context.
```java
public class MyClass {public void doSomething() {
Context context = AppContext.get();
}
}
```## License
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 athttp://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.