Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ghophp/android-media-cache
Cache media files like images and videos, from URL request.
https://github.com/ghophp/android-media-cache
Last synced: 25 days ago
JSON representation
Cache media files like images and videos, from URL request.
- Host: GitHub
- URL: https://github.com/ghophp/android-media-cache
- Owner: ghophp
- Created: 2012-04-09T21:45:32.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2021-10-18T20:59:17.000Z (over 3 years ago)
- Last Synced: 2024-12-23T13:52:30.798Z (29 days ago)
- Homepage:
- Size: 156 KB
- Stars: 10
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Media Cache client for Android
This library use android based resources to download and cache images from a server.
## Install
1 - Clone the project;
2 - In Eclipse > File > New > Java Project;
3 - Unmark use default location and select the folder cloned;
4 - Add to build path a android.jar compatible with your project version (sdk folder > platform > android-14 > android.jar);
5 - Add to your Android project a the dependence to this project.## Instance
String folder = "teste";
boolean hasSD = false;
String remote = "http://localhost:8888/public/images";
MediaCache cache = new MediaCache(
folder,
hasSD,
remote
);
**folder**: A local folder, that should exist, and will receive cached files.
**hasSD**: The library should save on external storage or internal.
**remote**: Remote folder with the files.## Usage
String path = 'teste.jpg';
int type = 0; // 0 - image | 1 - video
String updated = "1970-01-01 00:00:00";Media media = new Media(
path,
type,
updated
);cache.get(media, context, new OnMediaResponse() {
public void onVideo(String video) {
}
public void onError(Integer errorCode, String errorMessage) {
}
public void onBitmap(Bitmap bitmap) {
}
});## TODO
* update file based on update attribute on Media model.
* teste suite## License
Copyright (C) 2012 Guilherme Henrique de Oliveira
Distributed under the MIT License.