Search Results

Search found 205 results on 9 pages for 'sai srikanth'.

Page 7/9 | < Previous Page | 3 4 5 6 7 8 9  | Next Page >

  • how to access camera.java in on cick event?

    - by Srikanth Naidu
    hi , i am making a app which takes photo on button click i have camera.java which operates camera and takes photo how to i call it on the below event? public void onClick(DialogInterface arg0, int arg1) { setContentView(R.layout.startcamera); } Camera .java package neuro.com; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import android.app.Activity; import android.hardware.Camera; import android.hardware.Camera.PictureCallback; import android.hardware.Camera.ShutterCallback; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.FrameLayout; public class CameraDemo extends Activity { private static final String TAG = "CameraDemo"; Camera camera; Preview preview; Button buttonClick; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.startcamera); preview = new Preview(this); ((FrameLayout) findViewById(R.id.preview)).addView(preview); buttonClick = (Button) findViewById(R.id.buttonClick); buttonClick.setOnClickListener( new OnClickListener() { public void onClick(View v) { preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback); } }); Log.d(TAG, "onCreate'd"); } ShutterCallback shutterCallback = new ShutterCallback() { public void onShutter() { Log.d(TAG, "onShutter'd"); } }; /** Handles data for raw picture */ PictureCallback rawCallback = new PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { Log.d(TAG, "onPictureTaken - raw"); } }; /** Handles data for jpeg picture */ PictureCallback jpegCallback = new PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { FileOutputStream outStream = null; try { // write to local sandbox file system // outStream = CameraDemo.this.openFileOutput(String.format("%d.jpg", System.currentTimeMillis()), 0); // Or write to sdcard outStream = new FileOutputStream(String.format("/sdcard/%d.jpg", System.currentTimeMillis())); outStream.write(data); outStream.close(); Log.d(TAG, "onPictureTaken - wrote bytes: " + data.length); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { } Log.d(TAG, "onPictureTaken - jpeg"); } }; }

    Read the article

  • How can we show the preview image of the video in table view cell ?

    - by srikanth rongali
    I have a table view and if we touch a cell a video plays. I need to show the preview image of the video in the UITableViewCell. I have kept some dummy image in the cell at image place and remaining space ion cell is with some labels and buttons. I need the image preview of the video with play symbol on it. How can I make this ? Should I use any photoshop type of things or any programable things. I do not know photoshop. Thank You.

    Read the article

  • Cocos2d on iPhone: Using Sprites Defined in Separate Class Files.

    - by srikanth rongali
    I'm trying to draw two sprites on the same screen. I have defined the two sprite objects in two separate class files. If I comment out two lines (see "item 1" comment below) then I get a display as [a backgroundimage[background2.jpg] with a sprite[grossini.png] on the left side. If I uncomment the two lines I do not get the background image and sprite of (gameScreen.m). I get only the sprite [grossinis_sister1.png] defined in (enemy.m). But what I need is a [backgroundimage[background2.jpg]], sprite[grossini.png] and sprite [grossinis_sister1.png] in one screen. This is implementation file of my first class: #import "gameScreen.h" #import "enemy.h" @implementation gameScreen -(id)init { if((self = [super init])) { CCSprite *backGroundImage = [CCSprite spriteWithFile:@"background2.jpg"]; backGroundImage.anchorPoint = ccp(0,0); CCParallaxNode *voidNode = [CCParallaxNode node]; [voidNode addChild:backGroundImage z:-1 parallaxRatio:ccp(0.0f,0.0f) positionOffset:CGPointZero]; [self addChild:voidNode]; CGSize windowSize = [[CCDirector sharedDirector] winSize]; CCSprite *player = [CCSprite spriteWithFile:@"grossini.png"]; player.position = ccp(player.contentSize.width/2, windowSize.height/2); [self addChild:player z:0]; //eSprite = [[enemy alloc]init]; //<-- see item 1 //[self addChild:eSprite]; } return self; } This is my implementation file of my second class: #import "enemy.h" #import "gameScreen.h" @implementation enemy -(id)init { if ((self = [super init])) { CGSize windowSize = [[CCDirector sharedDirector] winSize]; CCSprite *enemySprite = [CCSprite spriteWithFile:@"grossinis_sister1.png" ]; enemySprite.position = ccp(windowSize.width/2, windowSize.height/2); [self addChild:enemySprite]; } return self; } @end

    Read the article

  • When we should use NSThreads in a cocoa Touch ?

    - by srikanth rongali
    I am writing a small game by using cocos2d. It is a shooting game. Player on one side and enemy on other side. To run the both actions of player shooting and enemy shooting do we should use threads ? Or can we do without using them. At present I am not using threads. But I can manage to do both actions of player and enemy at same time. Should I use threads compulsory good performance ? Or am I doing wrong without using threads ? Please help me from this confusion. Thank you.

    Read the article

  • How can we add scrolling text in cocos2d by using UITextView ?

    - by srikanth rongali
    I want a UITextView in cocos2d. I used in init method I wrote the code, UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0, windowSize.height/2,windowSize.width/2)]; textView.backgroundColor = [UIColor clearColor]; textView.text = @"I am First enemy"; [textView setEditable:NO]; [[[CCDirector sharedDirector]openGLView]addSubview:textView]; the orientation is [[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; I need the text to appear in landscape mode, but I am getting the text in following way. How can I make the text to appear in the landScape mode. I am working in cocos2d. CanOI scroll the text ? What should i add to make the text scroll up and down. Thank you.

    Read the article

  • .NET on Windows to Mono on Ubuntu

    - by Srikanth
    I am looking at a possibility to change my ASP.NET 2.0 application to the Mono framework. I have used the Mono Migration Analyzer tool and it does detect some P/Invoke and interop dependencies. For example: 1) We use Excel interops and on Linux we are looking to use StarOffice/OpenOffice instead. Is there an easy way of substituting Excel with StarOffice? (I know it sounds bizarre, but I just don't want to miss out in case anyone has done it already.) 2) LDAP authentication: What could be the best alternative in Ubuntu (or an other flavour of Linux)? 3) Is there an Ajax framework for Mono? Preferably with similar controls as Atlas? I hope I am not too ambitious here..

    Read the article

  • How can we make the text to appear in landscape mode in cocos2d by using UITextView ?

    - by srikanth rongali
    I want a UITextView in cocos2d. I used in init method UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0, windowSize.height/2,windowSize.width/2)]; textView.backgroundColor = [UIColor clearColor]; textView.text = @"I am First enemy"; [textView setEditable:NO]; [[[CCDirector sharedDirector]openGLView]addSubview:textView]; the orientation is [[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; I need the text to appear in landscape mode, but I am getting the text in following way. How can I make the text to appear in the landScape mode. I am working in cocos2d. CanOI scroll the text ? What should i add to make the text scroll up and down. Thank you.

    Read the article

  • Do, custom fonts work in UITextView that was loaded in cocos2d layer ?

    - by srikanth rongali
    Do, custom fonts work in UITextView ? I loaded UITextView *textView in cocos2d layer. And I trying to set the font of the text as Copperplate Gothic Bold. I downloaded the font file Coprgtb.TTF. But, the text is not adjusting to this font. The system fonts are working, but the custom fonts are not working ? I added the font file in resources folder. what can I do to make them work ? Thank You.

    Read the article

  • Writing the code by dividing it into more files in cocoatouch.

    - by srikanth rongali
    My problem is, I need a background image, a sprite(with animation) on left edge, another sprite(with animation) at other edge, a number count animation 1-2-3 at middle. I got all these when I wrote all in same file.(like [self addChild:label], [self addChild:sprite].., But in this it needs touch enables for both sprites separately, and touchDisabled to the remaining screen. So thought of writing in different files. But now it is not working. I kept one sprite, background image, numbercount in one file and another spritr in other file. Either I am getting the second sprite or the (sprite+background+numberCount) is displayed. This is my problem. plz give me solution. Thank You

    Read the article

  • How to use the variable declared in one class in another class in Obj C.

    - by srikanth rongali
    I have a NSDate *date1 in class1 implementation file(I initialized it as Global variable). I have NSDate *date2 in class 2 implementation file (initialized it as Global variable). I need to calculate the NSTimeInterval between the two dates in class 2. But I could not do it. I could not access date1 in this class. It is giving error as (date2 undeclared). Please give me help in how to call other class variables in this class. Thank you.

    Read the article

  • Writing the code iby dividing it into more files.

    - by srikanth rongali
    My problem is, I need a background image, a sprite(with animation) on left edge, another sprite(with animation) at other edge, a number count animation 1-2-3 at middle. I got all these when I wrote all in same file.(like [self addChild:label], [self addChild:sprite].., But in this it needs touch enables for both sprites separately, and touchDisabled to the remaining screen. So thought of writing in different files. But now it is not working. I kept one sprite, background image, numbercount in one file and another spritr in other file. Either I am getting the second sprite or the (sprite+background+numberCount) is displayed. This is my problem. plz give me solution. Thank You

    Read the article

  • How to delete a customized cell in UITableView ?

    - by srikanth rongali
    I have UITableView. I customized the cell height (increased). I have 4 labels(UILabel) and 1 image(UIImage) and 3 buttons (UIButton). one of the button is delete button. By touching the cell or button(play button) on the image a video is loaded and played. I need to delete the cell by touching delete button. If I touched the delete button the corresponding video is deleted from library . But, how to delete the cell and all remaining data in it ? I am not able to delete the cells or the data in the cells. How to do it ? Thank you.

    Read the article

  • How can I play video by touching the button on the video image of the video in tableviewcell ?

    - by srikanth rongali
    I have a table view in which if each cell is touched video plays. Each cell have image of the video cell.imageView.image. And on the image I have a button (UIButton) with play symbol. If I touch the play button the corresponding video should be played same like the when cell is touched. I have a selector for the play button. How can I relate the corresponding cell to the play button. Thank You.

    Read the article

  • How to use tags in iPhone application code ?

    - by srikanth rongali
    I need to access the [indexPath row] outside the tableView method. I need to use it in my own method in same class and other classes also. How can I do it. If the cell in the table view have buttons, By selecting the buttons how can I say which row was selected ? I think of using the tags. But, I do not know much about tags. Thank you.

    Read the article

  • How can I delete video stored in the photo library ?

    - by srikanth rongali
    I have saved video in to the photo library. -(void)exportVideo:(id)sender { NSString *path = [DOCUMENTS_FOLDER stringByAppendingString:@"/air.mp4"]; NSLog(@"Path:%@", path); NSLog(@"Export Button CLicked"); UISaveVideoAtPathToSavedPhotosAlbum(path, self, @selector(video:didFinishSavingWithError: contextInfo:), nil); } - (void)video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { NSLog(@"Finished saving video with error: %@", error); } Now I need to delete the video i have stored programmatically. How can I delete the video ? Are there any functions for it? Thank You.

    Read the article

  • How can I make the keyboard disappear after entering the text ?

    - by srikanth rongali
    I have two text fields in my view. I did it using IB. My problems are After entering the text in textField1 I am entering text in textField2. When I click in textField1 again the previous text is disappeared in the textField1. After entering the text in both the textFields, I need the keyboard to disappear. But, even I touched the return key in the keyboard layout or I touched the screen outside the text field the keyboard is not disappearing. How can I make this. Thank you.

    Read the article

  • How can i access or execute .java file in another javafile in android app development?

    - by Srikanth Naidu
    i got 2 java files app.java and gallaery.java App.java public class App extends Activity implements OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button Listvideo = (Button) findViewById(R.id.Listvideo); Listvideo.setOnClickListener(this); public void onClick(View view) { if (view == findViewById(R.id.Listvideo)) { // i have to call gallery.java here which executes list of images in the android pone } }

    Read the article

  • I could not understand where the memory is leaking in my code ?

    - by srikanth rongali
    I have the following code. I do not understand the problem in it. Whenever I include this class in my class the code is going to infinite loop. I could not get where I am wrong. please help me. Just point the errors in the code. #import "readFileData.h" #import "DuelScreen.h" @implementation readFileData @synthesize enemyDescription, numberOfEnemies, numberOfValues; @synthesize enemyIndex, numberOfEnemyGunDrawImages, numberOfEnemyGunFireImages, numberOfEnemyDieImages; @synthesize countDownSpeed, enemyGunDrawInterval, enemyGunFire, enemyRefire; @synthesize enemyAccuracyProbability, enemyGunCoordinateX, enemyGunCoordinateY; -(id)init { if( (self = [super init]) ) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"enemyDetals.txt"]; NSString *contentsOfFile = [[NSString alloc ]initWithContentsOfFile:path]; NSArray *lines = [contentsOfFile componentsSeparatedByString:@"#"]; numberOfEnemies = [lines count]; int nEnemy; nEnemy = 0; NSArray *eachEnemy=[[lines objectAtIndex:nEnemy] componentsSeparatedByString:@"^"]; DuelScreen *enemyNumber1 = [[DuelScreen alloc] init]; NSLog(@"tempCount value in: readFile: %d", enemyNumber1.tempCount); enemyIndex = enemyNumber1.tempCount - 1; countDownSpeed = [[eachEnemy objectAtIndex:0]intValue]; enemyGunDrawInterval = [[eachEnemy objectAtIndex:1]floatValue]; enemyGunFire = [[eachEnemy objectAtIndex:2]floatValue]; enemyAccuracyProbability = [[eachEnemy objectAtIndex:3]floatValue]; enemyRefire = [[eachEnemy objectAtIndex:4]floatValue]; numberOfEnemyGunDrawImages = [[eachEnemy objectAtIndex:5]intValue]; numberOfEnemyGunFireImages = [[eachEnemy objectAtIndex:6]intValue]; numberOfEnemyDieImages = [[eachEnemy objectAtIndex:7]intValue]; enemyGunCoordinateX = [[eachEnemy objectAtIndex:8]floatValue]; enemyGunCoordinateY = [[eachEnemy objectAtIndex:9]floatValue]; enemyDescription = [eachEnemy objectAtIndex:10]; } return self; } @end

    Read the article

  • Problem with accessing classes from another class.

    - by srikanth rongali
    I have a classA, classB,classC. I have another class classABC; All are CCLayer inherited. I need to call all the classA, classB, classC from classABC. #import <Foundation/Foundation.h> #import "cocos2d.h" @interface classABC : CCLayer { classA *aClass; } @property(nonatomic, retain)classA *aClass; @end #import "classABC" #import "classA.h" #import "classB.h" #import "classC.h" @implementation classABC -(id)init { if( (self = [super init]) ) { ClassA *aClass = [[ClassA alloc]init]; CCScene *aClassS = [CCScene node]; CCLayer * aClassL = [aClass node]; [aClassS addChild: aClassL]; [[CCDirector sharedDirector] setAnimationInterval:60.0/60]; [[CCDirector sharedDirector] replaceScene: aClass]; } return self; } @end But I am not getting the classA displayed. How should I do it ? Thank You.

    Read the article

< Previous Page | 3 4 5 6 7 8 9  | Next Page >