All Projects → stfalcon-studio → Contentmanager

stfalcon-studio / Contentmanager

Android library for getting photo or video from a device gallery, cloud or camera. Working with samsung devices. Made by Stfalcon

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Contentmanager

Lassi-Android
All in 1 picker library for android.
Stars: ✭ 108 (+0%)
Mutual labels:  camera, images, picker, videos
android-doc-picker
A simple and easy to use documents Picker android library. Choose any documents like pdf, ppt, text, word or media files from your device
Stars: ✭ 37 (-65.74%)
Mutual labels:  files, images, videos
android-pickpic
Ready to use library that allows people to select pictures from their device and Facebook account.
Stars: ✭ 12 (-88.89%)
Mutual labels:  camera, images, picker
ProPicker
ProPicker is a file picker (image, video, file) library for Android. It helps you to pick any file and return the result in a convenient way
Stars: ✭ 25 (-76.85%)
Mutual labels:  camera, picker
XGImagePickerController
iOS相册图片/视频选择器
Stars: ✭ 32 (-70.37%)
Mutual labels:  camera, picker
RAImagePicker
📸 iMessage-like, Image Picker Controller Provides custom features.
Stars: ✭ 14 (-87.04%)
Mutual labels:  images, videos
cloudinary-api
Shorter and lighter APIs for Cloudinary
Stars: ✭ 41 (-62.04%)
Mutual labels:  images, videos
Ypimagepicker
📸 Instagram-like image picker & filters for iOS
Stars: ✭ 3,661 (+3289.81%)
Mutual labels:  camera, picker
gettyimages-api nodejs
Getty Images API SDK for Node.js
Stars: ✭ 17 (-84.26%)
Mutual labels:  images, videos
Android Multipicker Library
Android Multipicker Library
Stars: ✭ 425 (+293.52%)
Mutual labels:  videos, picker
Vanilla Lazyload
LazyLoad is a lightweight, flexible script that speeds up your website by deferring the loading of your below-the-fold images, backgrounds, videos, iframes and scripts to when they will enter the viewport. Written in plain "vanilla" JavaScript, it leverages IntersectionObserver, supports responsive images and enables native lazy loading.
Stars: ✭ 6,596 (+6007.41%)
Mutual labels:  images, videos
filestack-ios
Official iOS SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
Stars: ✭ 44 (-59.26%)
Mutual labels:  files, picker
Filemasta
A search application to explore, discover and share online files
Stars: ✭ 571 (+428.7%)
Mutual labels:  files, videos
Alchemy
🔮 File conversion, all from the menu bar
Stars: ✭ 815 (+654.63%)
Mutual labels:  files, images
Picker
Picker - A CameraX based WhatsApp Style Image-Video Picker
Stars: ✭ 69 (-36.11%)
Mutual labels:  camera, picker
Mediapicker
Media Picker is an Android Libary that lets you to select multiple images or video
Stars: ✭ 254 (+135.19%)
Mutual labels:  images, picker
MediaSliderView
Pure java based, highly customizable media slider gallery supporting both images and videos for android.
Stars: ✭ 85 (-21.3%)
Mutual labels:  images, videos
react-butterfiles
🦋 Component for building file fields - from basic file inputs to drag and drop image galleries.
Stars: ✭ 44 (-59.26%)
Mutual labels:  files, images
Rxpaparazzo
RxJava extension for Android to take images using camera and gallery and pick files up
Stars: ✭ 467 (+332.41%)
Mutual labels:  camera, picker
Media picker
A Flutter Plugin for Selecting and Taking New Photos and Videos.
Stars: ✭ 24 (-77.78%)
Mutual labels:  camera, videos

ContentManager

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 [email protected]. 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

Download via Gradle:

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

or Maven:

<dependency>
  <groupId>com.github.stfalcon</groupId>
  <artifactId>contentmanager</artifactId>
  <version>0.5</version>
  <type>pom</type>
</dependency>

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.

Usage

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
*/
@Override
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
       tvUri.setText(uri.toString());
   }
}
        
/**
* Call when loading started
*/
@Override
public void onStartContentLoading() {
  //Show loader or something like that
  progressBar.setVisibility(View.VISIBLE);
}

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

/**
* Call if user manual cancel picking or taking content
*/
@Override
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:

@Override
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:

@Override
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:

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
  super.onRestoreInstanceState(savedInstanceState);
  contentManager.onRestoreInstanceState(savedInstanceState);
}

@Override
protected void onSaveInstanceState(Bundle outState) {
  super.onSaveInstanceState(outState);
  contentManager.onSaveInstanceState(outState);
}

Pick image:

contentManager.pickContent(ContentManager.Content.IMAGE);

Pick video:

contentManager.pickContent(ContentManager.Content.VIDEO);

Pick file:

contentManager.pickContent(ContentManager.Content.FILE);

Take photo from camera:

contentManager.takePhoto();

Take a look at the sample project for more information

Thanks

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

License

Copyright 2017 stfalcon.com

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].