CuXtomCam


Source link: https://github.com/krazykira/CuXtomCam

CuXtomCam

Up for Adoption: kindly email me on [email protected] if you want to mantain it

An open source camera for google glass. This is a an alternative to the default camera on Glass. CuXtom Cam provides you the default behaviour along with some special feature..

Special Features

  • Use Swipe FORWARD and BACKWARD Gestures to perform Zoom In and Zoom out.
  • During preview you can use TAP Gesture or Camera Button to take photo and end video recording.
  • Take pictures, Record videos and save them in your own folder on Glass.
  • There is no default 10 seconds video duration. Video can be recorded as long as the user wants. if user doesn't specify then default video recording length is 1 hour.

CuXtom Cam Glassware

Want to see CuXtomCam in action? Then check out Google Glass Glassware that is made using CuxtomCam library

Requirements

You can use cuXtom Cam library by adding it as library project. For a sample application see the sample app.

How To Use

Start CuXtom Cam Activity like this

private void startCuxtomCam() {

String folder = Environment.getExternalStorageDirectory()
  + File.separator + Environment.DIRECTORY_PICTURES
  + File.separator + "MyFolder";
Intent intent = new Intent(getApplicationContext(),
  CuxtomCamActivity.class);
intent.putExtra(CuxtomIntent.CAMERA_MODE, CAMERA_MODE.VIDEO_MODE);
intent.putExtra(CuxtomIntent.ENABLE_ZOOM, true);
// Enable zoom Gesture
intent.putExtra(CuxtomIntent.FILE_NAME, "myvideo"); // No need for extensions
intent.putExtra(CuxtomIntent.VIDEO_DURATION, 20);  // This duration is in seconds. Skipping this will record video for 1 hour
intent.putExtra(CuxtomIntent.FOLDER_PATH, folder); // Set folder to save image and video
startActivityForResult(intent, CUXTOM_CAM_REQUEST);

}
 

Recieve response from CuXtom Cam like this

@Override  protected void onActivityResult(int requestCode, int resultCode, Intent data) {

if (requestCode == CUXTOM_CAM_REQUEST) {

 if (resultCode == RESULT_OK) {

  String path = data.getStringExtra(CuxtomIntent.FILE_PATH);
  int FIleType = data.getIntExtra(CuxtomIntent.FILE_TYPE,

 FILE_TYPE.PHOTO);
  if (FIleType == FILE_TYPE.PHOTO) {

// Path points to Photo file
  
}
 else {

  // Path points to Video file
  
}

  
}

}

super.onActivityResult(requestCode, resultCode, data);  
}
 

Don't forget to add the follwing lines in to your manifest.xml

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

<uses-feature android:name="android.hardware.camera" />
  <uses-feature android:name="android.hardware.camera.autofocus" />

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

 <application

android:allowBackup="true"

android:icon="@drawable/ic_launcher"

android:label="@string/app_name"

android:theme="@android:style/Theme.DeviceDefault" >

<activity

 android:name="com.glass.cuxtomcam.CuxtomCamActivity"

 android:immersive="true" >

</activity>

  </application> 

For a detailed example check out the sample app

Developed By

License

Copyright 2014 Sheraz Ahmad Khilji  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. 

For those who use this library don't forget to tell me how was it.

HAPPY CODING ^_^

Resources

Quick action dialog fragment.

A very simple currency converter for Android.

ClassyShark is a handy browser for Android executables. It has clients for both Android (apk) and Desktop (jar). With ClassyShark you can open APK/Zip/Class/Jar files and analyze their contents.

It is a simple MVP demo which shows how to pick photos.

A custom TextView, when pinch in out gesture used, then it resizes text size.

This library analyses a best crop position and size by calculating some features (edge, skin tone, staturation and face).

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