Android library for getting photo or video from a device gallery, cloud or camera. Working with samsung devices. Made by Stfalcon
Switch branches/tags
Nothing to show
Clone or download
Latest commit faf5d7c Jul 19, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
contentmanager changed version Mar 27, 2017
gradle/wrapper new feature : picking files Mar 27, 2017
sample new feature : picking files Mar 27, 2017
.gitignore init Jul 12, 2016 Update Jul 19, 2017
build.gradle new feature : picking files Mar 27, 2017 init Jul 12, 2016
gradlew init Jul 12, 2016
gradlew.bat init Jul 12, 2016
settings.gradle init Jul 12, 2016


Library for getting photos, videos or files of any type from a device gallery, external storage, cloud(Google Drive, Dropbox and etc) or camera. With asynchronous load from the cloud and fixed bugs for some problem devices like Samsung or Sony.

Who we are

Need iOS and Android apps, MVP development or prototyping? Contact us via We develop software since 2009, and we're known experts in this field. Check out our portfolio and see more libraries from stfalcon-studio.


Download via Gradle:

compile 'com.github.stfalcon:contentmanager:0.5'

or Maven:


Migration to version 0.5

In version 0.5 we have removed callback onLoadContentProgress(int loadPercent)(because it is very hard to calculate loadPercent correctly) and replaced it with callback onStartContentLoading() to handle a start of loading content. So if you are using ContentManager previous version, you need to make some correction after updating ContentManager version to 0.5. Also, we have added new cool feature: picking files with any types.


Add the folowing permission to AndroidManifest.xml:

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

Implement callback interface:

public class MainActivity extends AppCompatActivity implements ContentManager.PickContentListener {

Then implement PickContentListener methods:

* Success result callback
* @param uri         Content uri
* @param contentType If you pick content can be Image or Video, if take - only Image
public void onContentLoaded(Uri uri, String contentType) {
   if (contentType.equals(ContentManager.Content.IMAGE.toString())) {
       //You can use any library for display image Fresco, Picasso, ImageLoader
       //For sample:
       ImageLoader.getInstance().displayImage(uri.toString(), ivPicture);
   } else if (contentType.equals(ContentManager.Content.FILE.toString())) {
       //handle file result
* Call when loading started
public void onStartContentLoading() {
  //Show loader or something like that

* Call if have some problem with getting content
* @param error message
public void onError(String error) {
  //Show error

* Call if user manual cancel picking or taking content
public void onCanceled() {
  //User canceled

Declare field:

private ContentManager contentManager;

Create instance where "this" is your activity:

contentManager = new ContentManager(this, this);

Override onActivityResult method of activity. It is needed for handling the result:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  contentManager.onActivityResult(requestCode, resultCode, data);

Override onRequestPermissionsResult method to handle realtime permissions:

public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    contentManager.onRequestPermissionsResult(requestCode, permissions, grantResults);

Override onSaveInstanceState, onRestoreInstanceState. It is needed for fixing bugs with some Samsung and Sony devices when taking photo in a landscape mode:

protected void onRestoreInstanceState(Bundle savedInstanceState) {

protected void onSaveInstanceState(Bundle outState) {

Pick image:


Pick video:


Pick file:


Take photo from camera:


Take a look at the sample project for more information


Thanks to @coomar2841 and his Android Multipicker Library. We peeked at him some points in the implementation of picking files.


Copyright 2017

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.