×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Bangalore,India
    Posts
    129

    S40 emulator terminates

    The code snippet terminates if i use string buffer in s40 emulator but it runs if i use String
    StringBuffer
    Code:
    int searchStringPos = resolve(request.getUrl()).indexOf("?");
    		StringBuffer uri = new StringBuffer(resolve(request.getUrl()));
    
    		if (searchStringPos > -1) {
    			uri.append("&uid=");
    		} else {
    			uri.append("?uid=");
    		}
    		uri.append(uid);
    		uri.append("&appVersion=");
    		uri.append(Constants.appVersion);
    		uri.append("&uidType=IMEI");
    		String url = new String(uri.toString());
    
    		System.out.println("url...."+url);
    		try {
    		
    			HttpConnection httpConn = (HttpConnection) Connector.open(url);
    STRING
    Code:
    String url = resolve(request.getUrl());
    		if (url.indexOf("?") > -1) {
    			url += "&uid="+ uid +"&appVersion="+Constants.appVersion+"&uidType=IMEI";  
    		} else {
    			url += "?uid="+ uid +"&appVersion="+Constants.appVersion+"&uidType=IMEI";
    		}
    		try {
    //		line system
    	System.out.println("inside openHttpConnection is url " + url);
    			HttpConnection httpConn = (HttpConnection) Connector.open(url);

    and if i uncomment line system s40 emulator terminates.
    my main aim is to get rid of out of memory

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: S40 emulator terminates

    Hello kusumat,

    if i uncomment line system s40 emulator terminates.
    What is 'line system'?

    my main aim is to get rid of out of memory
    So does the emulator terminate because of Out of Memory?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Bangalore,India
    Posts
    129

    Re: S40 emulator terminates

    Hi
    if i uncomment this line

    Code:
    System.out.println("inside openHttpConnection is url " + url);
    then en error occurs

    i believe its because of long string.

    and as i posted code earlier

    if i use string buffer uri instead of string url the emulator crashes (not very sure if it is cuz of Out of memory )

    thanks

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: S40 emulator terminates

    Check your URL, it should be urlencoded and should have any blank spaces at the start or end.
    Cut & Paste your URL string... why is it too long... is it more then 256 chac's, if yes reduce it for S40.

    thanks,
    ~Amitabh

  5. #5
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Bangalore,India
    Posts
    129

    Re: S40 emulator terminates

    Hi im2amit,

    yeah url length is 327 thats y my app is crashing in other locations.


    thanks lot

Similar Threads

  1. S40 and Symbian Foundation conflict? Future of S40?
    By thomas.jay in forum General Development Questions
    Replies: 6
    Last Post: 2013-09-09, 16:05
  2. Video on S40 5th edition Lite (and S40 5th edition FP1 Lite)
    By thijsman86 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2010-03-05, 09:08
  3. S40 - S60 Calling sequence diff
    By prakash.raman in forum Mobile Java General
    Replies: 1
    Last Post: 2008-07-23, 11:07
  4. Problem with S40 5th Edition emulation, NCF 1.2 and BT dongle
    By nevillesatz in forum Bluetooth Technology
    Replies: 1
    Last Post: 2007-07-05, 10:52
  5. Nokia手机主要参数列表
    By cqucyf in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 0
    Last Post: 2005-05-04, 16:34

Posting Permissions

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