×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155

    Unhappy Image delete failure in LG

    Hi,

    i m writing the following code to delete an image using jsr 75.

    Code:
    FileConnection fc=(FileConnection)Connector.open(ImagePath,Connector.READ_WRITE);
    if(fc.exists())
    {	if(fc.canWrite())
    		fc.delete();
    }
    if(fc!=null)
        fc.close();
    form.append("Deleted: "+ImagePath);
    it works fine in emulator, but on LG KG195, it neither deletes the image nor gives any error message or exception

    Thanx in advance
    Vineet Billorey "The Great"

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: Image delete failure in LG

    what about other handsets. If is fine with others then check the settings.Not too muich about LG devices..
    Better to post this problem here.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  3. #3
    Super Contributor
    Join Date
    Jun 2007
    Location
    Mumbai
    Posts
    539

    Re: Image delete failure in LG

    Check if 'fc' is null or not!
    au revoir
    Prakash Raman

  4. #4
    Registered User
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155

    Re: Image delete failure in LG

    Code:
    Check if 'fc' is null or not!
    can't understand..sorry
    Vineet Billorey "The Great"

  5. #5
    Super Contributor
    Join Date
    Jun 2007
    Location
    Mumbai
    Posts
    539

    Re: Image delete failure in LG

    I mean are you able to get fileConnection?
    au revoir
    Prakash Raman

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Image delete failure in LG

    Hi,
    Please make the code inside the try-catch,might be the exception was thrown,but was not caught,Please check that the form,you are using to append the status is not null.

    Try to debug the code using the IDE.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Super Contributor
    Join Date
    Jun 2007
    Location
    Mumbai
    Posts
    539

    Re: Image delete failure in LG

    And Veenet, check your file path is it correct or not?
    au revoir
    Prakash Raman

  8. #8
    Registered User
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155

    Re: Image delete failure in LG

    thanx for reply.
    its fully in try-catch block
    Code:
    try
    {	FileConnection fc=(FileConnection)Connector.open(ImagePath,Connector.READ_WRITE);
    	if(fc.exists())
    	{	if(fc.canWrite())
    			fc.delete();
    		if(fc!=null)
    			fc.close();
    		form.append("Deleted: "+ImagePath);
    	}
    	else
    		form.append("No Connection");
    }catch(java.io.IOException ioe){form.append(ioe.toString());}
    catch(Exception e){form.append(e.toString());}
    on LG KG 195, even it shows the mesage:- "Deleted: "+ImagePath

    but the image is not actually deleted at all.
    Vineet Billorey "The Great"

  9. #9
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: Image delete failure in LG

    Code:
    try
    {	FileConnection fc=(FileConnection)Connector.open(ImagePath,Connector.READ_WRITE);
    	if(fc.exists())
    	{	if(fc.canWrite()){
    			fc.delete();
                            if(fc.exists())
                               form.append("Deleted: "+ImagePath);
                      }
    		if(fc!=null)
    			fc.close();
    		
    	}
    	else
    		form.append("No Connection");
    }catch(java.io.IOException ioe){form.append(ioe.toString());}
    catch(Exception e){form.append(e.toString());}
    I had made a little change to ur code. Now check still ur Image path is appending to form or not.

    check and reply..
    thanks,
    jitu_goldie..

    KEEP TRYING..

  10. #10
    Registered User
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155

    Re: Image delete failure in LG

    thanx for reply
    i tried ur code

    Code:
    if(fc.exists())
    {	if(fc.canWrite()){
    		fc.delete();
                           if(fc.exists())
                              form.append("Deleted: "+ImagePath);
                     }
    and now, it is not showing the message:- "Deleted: "+ImagePath
    and again, the image is also not deleted
    Vineet Billorey "The Great"

  11. #11
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: Image delete failure in LG

    Quote Originally Posted by vineetbillorey View Post
    thanx for reply
    i tried ur code

    Code:
    if(fc.exists())
    {	if(fc.canWrite()){
    		fc.delete();
                           if(fc.exists())
                              form.append("Deleted: "+ImagePath);
                     }
    and now, it is not showing the message:- "Deleted: "+ImagePath
    and again, the image is also not deleted
    Did u got my mean. If delete function is not working then how could u delete the file.
    search on LG forum.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  12. #12
    Registered User
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155

    Re: Image delete failure in LG

    yes,

    thanx for reply.

    it may be LG problem.

    because delete() itself closes and flushes all input/output streams, and hence fc.exists() is not available after call to delete.
    Vineet Billorey "The Great"

Similar Threads

  1. AknIconUtils is caching the image
    By Tatanka.nbr1 in forum Symbian
    Replies: 12
    Last Post: 2007-01-05, 19:08
  2. Using Icon as Image
    By korakotc in forum Symbian
    Replies: 6
    Last Post: 2006-02-13, 19:34
  3. HELP: Mutable Image to Immutable Image?
    By rj_cybersilver in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-03-26, 09:58
  4. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29
  5. Creating and Delete databases
    By -kevbo- in forum Symbian
    Replies: 1
    Last Post: 2001-12-13, 12:54

Posting Permissions

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