×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    42

    How do I approach this?

    Hey guys

    I have situation and I am not sure how to approach this.

    I have a custom Canvas that has 3 buttons.

    1. Add Picture
    2. Add Description
    3. Submit

    When a user clicks Add Picture, they get taken to a camera form. But now I need to get the image back to the original form. Then the same with description, which will be text.

    So that when the user clicks Submit, it already has the image and description. That I can then use to process.

    I know how to take the photo and get the text in the other forms, just do not know how to get the values back to the original.

    Any feedback would be much appreciated. Thanks

  2. #2
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: How do I approach this?

    its just depend upon the way you code if you are having object of camera form and description form in custom canvas then you can access their variables by creating a method

    another approach is if you dont have the object in custom canvas then u can make those variables static nd access them in any class

    But the second approach is not the better one avoid it unless there is no other solution
    Regards,
    Saurabh

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    42

    Re: How do I approach this?

    Thanks for the reply.

    I am not sure what you mean. This is how its done currently:

    Inside the commandListener:

    if (c==select) {
    if (currentSelection==0) {
    _midlet.setDisplay(new CameraForm(_midlet, this));
    }
    else {
    _midlet.setDisplay(new descriptionForm(_midlet, this));
    }
    }

    _midlet is the main midlet of my application that gets sent through to every form if they need to interact with it. and forms have an option of sending the parent with, thus the "this". Could I say parentForm.Image = myImageHere;? Would something like that work?

  4. #4
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: How do I approach this?

    Quote Originally Posted by NightStalkerDNS View Post
    Thanks for the reply.

    I am not sure what you mean. This is how its done currently:

    Inside the commandListener:

    if (c==select) {
    if (currentSelection==0) {
    _midlet.setDisplay(new CameraForm(_midlet, this));
    }
    else {
    _midlet.setDisplay(new descriptionForm(_midlet, this));
    }
    }

    _midlet is the main midlet of my application that gets sent through to every form if they need to interact with it. and forms have an option of sending the parent with, thus the "this". Could I say parentForm.Image = myImageHere;? Would something like that work?

    k so ur are creating instance in custom canvas only so what you can do create two string field in this canvas as public
    1......for saving the path of the image u captured
    2......for saving the description

    nd the approach you have mentioned at bottom is correct if parentform is your custom canvas
    Regards,
    Saurabh

  5. #5
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: How do I approach this?

    you also might just have two private variables within your Canvas ( for example Image shotPicture and String pictureDescription) and create two setMethods from those... When you create your new DescriptionForm (of the pictureForm) you pass the Canvas to it sconstructor for example after which both Forms will have access to the previously described set methods...
    It's easy as pie

    This (setter and getter methods and references to objects) is pretty basic object oriented programming, so if all this sounds new to you you might want to learn some basic java and it's OOP capabilities... I assure you you will be needing that kind of knowledge !

  6. #6
    Registered User
    Join Date
    Dec 2009
    Posts
    42

    Re: How do I approach this?

    Hi

    Thanks for the reply. Yes, I understand OOP. And I do parse my main form as a constructor with the midlet. Just wanted to know if that is acceptable in j2me. Guess it is then

    Thanks

Similar Threads

  1. MIDlet signing [openssl approach to generate CSR]
    By eesbee in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2009-08-18, 06:08
  2. Replies: 2
    Last Post: 2007-10-05, 20:40
  3. how to approach to reduce Heap Memory Consumption
    By sharma_durg in forum Mobile Java General
    Replies: 3
    Last Post: 2006-10-03, 21:24
  4. Is "1 day free license" a good approach?
    By MobileVisuals in forum Digital Rights Management & Content Downloading
    Replies: 0
    Last Post: 2006-01-12, 19:24
  5. Approach to a Symbian-signed game...
    By iWannaMakeGames in forum Symbian
    Replies: 0
    Last Post: 2005-09-06, 21:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×