×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    WRT examples not working on Nokia Web App Simulator v1.2.0 & some newbie questions.

    Hi, I'm new to Nokia development and having a few issues with some of the examples I've been going through.

    First I downloaded the AccuWidget and RouteWidget examples. Both were not displaying correctly in the Web App Simulator Tool. I discovered that the problem was with the javascript links. The links had self closing tags "/>" instead of </script>. Changing these tags fixed the content display issues. I was then able to get the RouteWiget example working in S60 5th Emulator with positioning simulation.

    1) Are you able to test location/GPS based apps and positioning simulation with the web app simulator tool or do you have to use the emulator?

    2)Are you able to debug JavaScript in the emulator?

    I read the article "Reacting to the changes in screen size in WRT" and downloaded the example. reacting_to_orientation_changes.zip.
    The text on the screen just displays "Home screen activated" instead of changing according to the screen resolution and orientation.

    3) Any ideas why this example works fine in the emulator and not with the app simulator tool?

    4) My understanding is that WRT run on S60 3rd, S60 5th and Symbian^3 devices only. Is this correct?

    5) What are all the screen resolutions I have to be concerned with when developing WRT apps?
    WRT 1.0 > 360x640, 800x352, 320x240, 240x320
    WRT 1.1 > 360x630, 320x240, 240x320
    Is this correct?
    Those are the only available options in the web app simulator.
    Last edited by B.Adams; 2011-04-26 at 13:51.

  2. #2
    Regular Contributor
    Join Date
    May 2009
    Location
    sydney
    Posts
    117

    Re: WRT examples not working on Nokia Web App Simulator v1.2.0 & some newbie question

    please see comments below,

    Quote Originally Posted by B.Adams View Post
    Hi, I'm new to Nokia development and having a few issues with some of the examples I've been going through.

    First I downloaded the AccuWidget and RouteWidget examples. Both were not displaying correctly in the Web App Simulator Tool. I discovered that the problem was with the javascript links. The links had self closing tags "/>" instead of </script>. Changing these tags fixed the content display issues. I was then able to get the RouteWiget example working in S60 5th Emulator with positioning simulation.

    1) Are you able to test location/GPS based apps and positioning simulation with the web app simulator tool or do you have to use the emulator?
    YES
    2)Are you able to debug JavaScript in the emulator?
    Firebug/Web App js breaker.

    I read the article "Reacting to the changes in screen size in WRT" and downloaded the example. reacting_to_orientation_changes.zip.
    The text on the screen just displays "Home screen activated" instead of changing according to the screen resolution and orientation.

    3) Any ideas why this example works fine in the emulator and not with the app simulator tool?
    - they should both working.

    4) My understanding is that WRT run on S60 3rd, S60 5th and Symbian^3 devices only. Is this correct?
    +mostly support WRT 1.1+, some of the handset only support WRT 1.0

    5) What are all the screen resolutions I have to be concerned with when developing WRT apps?
    WRT 1.0 > 360x640, 800x352, 320x240, 240x320
    WRT 1.1 > 360x630, 320x240, 240x320
    Is this correct? - Please check the nokia device list.

    Those are the only available options in the web app simulator.


    Hope this helps.
    chrs,
    Wenz
    Nokia is back!

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: WRT examples not working on Nokia Web App Simulator v1.2.0 & some newbie question

    Thanks for the reply.
    I'm not too clear on your answer though, could you please clarify for me. Is that yes you can do positioning simulation with Web App Simulator Tool or is that yes you have to use the emulator for positioning simulation?
    If it is possible with the Web App Simulator could you explain how I set this up or point me to an article to help me get started.

    Are you able to debug JavaScript in the emulator? You replied with "Firebug/Web App js breaker". Could you please elaborate.
    Did a Google search for "web app js breaker" but came up empty. Not sure how firebug helps any, that's a browser plugin? Need to test javascript in WRT app that uses the runtime api.
    I take it it's not possible with the emulators?

    Concerning the "Reacting to the changes in screen size in WRT" example, I stepped through the javascript to the following function:

    function detectResolution() {
    var screenWidth = screen.width;
    var screenHeight = screen.height;
    var windowWidth = window.innerWidth;
    var windowHeight = window.innerHeight;

    if (windowHeight < (0.75 * screenHeight) ||
    windowWidth < (0.75 * screenWidth)) {
    // If the window width or height is less than 75 % of the screen width
    // or height, we assume the home screen view should be active
    resolution = RESOLUTION_HOME_SCREEN;
    } else if (screenWidth == 240 && screenHeight == 320) {
    resolution = RESOLUTION_QVGA_PORTRAIT;
    } else if (screenWidth == 320 && screenHeight == 240) {
    resolution = RESOLUTION_QVGA_LANDSCAPE;
    } else if (screenWidth == 360 && screenHeight == 640) {
    resolution = RESOLUTION_NHD_PORTRAIT;
    } else if (screenWidth == 640 && screenHeight == 360) {
    resolution = RESOLUTION_NHD_LANDSCAPE;
    } else {
    resolution = RESOLUTION_UNDEFINED;
    }
    }

    The screen.width and screen.height properties returned are that of my monitor,1920x1080 and not the simulator.
    So, resolution = RESOLUTION_HOME_SCREEN; is always returned.

    Why is my monitors resolution being returned and not the simulators screen resolution?
    This seems like a bug in the Web App Simulator to me? The emulator handles this function correctly...
    Last edited by B.Adams; 2011-04-27 at 14:14.

  4. #4
    Super Contributor
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: WRT examples not working on Nokia Web App Simulator v1.2.0 & some newbie question

    Hi,

    Positioning simulation is supported in the Web App Simulator. Just click location button on the toolbar and move the marker to a new place to update your location.

    You can use firebug lite in the emulator if you wish, but I would prefer to debug JavaScript using Web Inspector bundled with the Web App Simulator.

    Please use window.innerHeight instead to detect if your widget is shown on HS.

    Code:
    //Miniview treshold in px
    var MINIVIEW_TRESHOLD = 150;
    
    window.onresize = checkViewMode; 
    
    //check and updates the current view mode
    function checkViewMode(){
    	
        if (window.innerHeight < MINIVIEW_TRESHOLD) {
    		//showMiniView
    		
        }else {
           //showFullScreenView
        }
    }
    Br,
    Ilkka

  5. #5
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: WRT examples not working on Nokia Web App Simulator v1.2.0 & some newbie question

    Thanks, I appreciate the help.

    Sorry what I really meant by “positioning simulation” is actually simulating a route from point A to point B with speed.

    I’m able to get the latitude, longitude and distance parameters but not speed.

  6. #6
    Super Contributor
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: WRT examples not working on Nokia Web App Simulator v1.2.0 & some newbie question

    Hi,

    Route simulation is not directly supported, but a bit of hacking does the trick. Maybe you could calculate the speed needed to move between points, if you need to have meaningful data, but in general it could be done as follows. Just insert this to your JavaScript

    Code:
    var loctionInformation =[{
    			"Longitude":0.02892424,
    			"Latitude":51.508074,
    			"Altitude":836.5,
    			"HorizontalSpeed":15
    		},
    		{
    			"Longitude":0.02892424,
    			"Latitude":52.508074,
    			"Altitude":836.5,
    			"HorizontalSpeed":1.45
    		},
    		{
    			"Longitude":0.02892424,
    			"Latitude":53.508074,
    			"Altitude":836.5,
    			"HorizontalSpeed":13.3
    		},
    		{
    			"Longitude":0.02892424,
    			"Latitude":54.508074,
    			"Altitude":836.5,
    			"HorizontalSpeed":12.3
    		},
    		{
    			"Longitude":0.02892424,
    			"Latitude":55.508074,
    			"Altitude":836.5,
    			"HorizontalSpeed":1.3
    		},{
    			"Longitude":0.02892424,
    			"Latitude":56.508074,
    			"Altitude":836.5,
    			"HorizontalSpeed":1
    		}		
    ];
    
    var simulPoint =0;
    function simulateRoute(){
    	
        device.implementation.loadData('Service.Location', 'BasicLocationInformation', loctionInformation[simulPoint]);
    	simulPoint = (++simulPoint) % loctionInformation.length;
    
    }
    
    function init(){
    	
    	setInterval(simulateRoute, 1000);
    ....
    }

  7. #7
    Registered User
    Join Date
    Apr 2011
    Posts
    9

    Re: WRT examples not working on Nokia Web App Simulator v1.2.0 & some newbie question

    Thanks, that's perfect!

Similar Threads

  1. Replies: 1
    Last Post: 2010-12-15, 10:03
  2. Replies: 6
    Last Post: 2009-12-09, 00:39
  3. Some links are not working on the Nokia 9500
    By kotse0 in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2005-02-07, 05:47
  4. some newbie questions
    By lumpinus in forum Symbian Tools & SDKs
    Replies: 4
    Last Post: 2004-12-30, 17:59

Posting Permissions

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