cymera

Developer

cymera API

Use our API whenever you need to use Cymera to take and edit photos fast and easy Now you can connect and use Cymera's features from external apps on each OS.

Use the Intents and Intent Filters included on Android to call out Cymera and use its PhotoAlbum function on external apps.
You can edit photo after choosing a photo.

<Action>

com.cyworld.camera.action. IMAGE_PICK

<Input Parameters>

Input Parameters
Parameter name Type Mandatory Description Example
output_dir_name String O output folder name My app
output_pic_width int (px) X output image width 600
output_pic_height int (px) X output image height 600
crop boolean X image scale type
- true : crop with requested (center)
- false : resize with requested size
true

* Output image will be made based on original image when optional parameters are not specified.

<Output Parameters>

Output Parameters
Parameter name Type Description
result_code int result value
picture_uri Uri output Uri information

<Result code>

Result code
Code Description
0 output image with requested size(width & height)
1 output image with requested width
2 output image with requested height

<Sample Code>

sample code
(1) Creating intent
Intent intent = new Intent();
intent.addFlags( Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET );
	ComponentName compName = new  ComponentName( "com.cyworld.camera" , "com.cyworld.cymera.CameraMain" );
intent.setComponent(compName);
intent.setAction( "com.cyworld.camera.action.IMAGE_PICK" );
intent.putExtra( "output_dir_name" , "My app" );
intent.putExtra( "output_pic_width" , 640 );
intent.putExtra( "output_pic_height" , 480 );
intent.putExtra( “crop”, true );
startActivityForResult(intent, REQ_CODE);

// This example show creating "My app" folder and requesting output image with size of 640*480px
(2) Getting result of creating intent
//Activity's onActivityResult() method
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
	if (resultCode == RESULT_OK) {		
		switch (requestCode) {
		    	case REQ_CODE:
				if (data != null) {
					int rcode = data.getIntExtra( “result_code” ); // result code
					Uri uri = data.getParcelableExtra( “picture_uri” ); // result Uri
				}
			break;
		}
	} else if (resultCode == RESULT_CANCEL) {
   		switch (requestCode) {
			case REQ_CODE:
				// process for cancel
			break;
		}
	}
}
Questions about the API? : help@cymera.com