Page 26 of 136 FirstFirst ... 162425262728 36 76 126 ... LastLast
Results 501 to 520 of 2706

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: GPS Based HTML Lockscreen Weather Theme

  1. #501
    Quote Originally Posted by Ian Nicoll View Post
    Yeah M8, as soon as all the little niggles are ironed out.



    So this just updates the location right?, if there is no change in location the weather doesn't refresh. Where does it set the time to refresh the weather if there is no change in location?

    Thanks again pal.
    In original widget, in the UpdateLocation, you find this

    GetWeather(woeid); setInterval('GetWeather(woeid)', 1000*20*60 );

    So 20s for location update, no change on weather if same place.
    20 min for a refresh of the weather at the same place.

    We can do the same things, Just to have a look on battery draining but i think not to much. For me, it's a little useless, no ? Perhaps better to wait for a refresh rate all 15 minutes.

  2. The Following 8 Users Say Thank You to Dacal For This Useful Post:

    chevymusclecar (03-08-2012), chg128 (03-08-2012), Ian Nicoll (03-08-2012), Schnedi (03-08-2012), Sheff1889 (03-08-2012), stratnik (03-08-2012), The_Durben (03-08-2012), zocker48 (03-09-2012)

  3. #502
    Quote Originally Posted by Ian Nicoll View Post
    Thanks Dacal.

    To Dacal, rasputin, crazy & The_Durben (or anybody who knows)

    Coming home in the taxi tonight I set 20 second lock screen to 20 minutes and tested the original "GPSweather.theme" and it did not update when moving through the various towns. The LS (and the UniAW (PerPage)) are only updating the location after the weather "UpdateInterval" refreshes, (currently set at 20 minutes).

    But from what I gather from "The_Durben" and others it is supposed to update more or less as soon as you move to another district as this is when the "myLocation.txt" file gets updated.

    How often does the GPS app check our location, or is it continuously monitoring and does it update the .txt file immediately?

    And.. (sorry) If the text file coordinates change does the weather widgets immediately change too, or do they only change after the 20 minutes set in the "UpdateInterval" as mine are doing.

    Thanks guys.
    Hey Ian
    So I tested the original lock theme ( restyled that's all and it updates as you move.
    The uniaw however (same one I sent you) must have had a well timed refresh last night as I changed the interval this morning to 60mins and drove through two different locales to work today and it did not update.
    I'm not overly concerned at that as 15-20 interval will do the trick. I think if the uniaw is changed to keep looking consistently for a change in the location.txt it will have a negative impact on battery.

    Edit** I see why the original updates after reading Dacals post.
    I'll test mine tomorrow while I'm working from home with a faster refresh rate as well as location check rate and see the impact on battery with normal use of the phone.
    Last edited by The_Durben; 03-08-2012 at 12:00 PM.

  4. The Following 3 Users Say Thank You to The_Durben For This Useful Post:

    chg128 (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012)

  5. #503
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    5,408
    Thanks
    8,474
    Thanked 21,646 Times in 4,337 Posts

    Thanks guys, but I would like to try it updating the UpdateLocation function every 20 seconds, so maybe Chevy can also try this, it works on my mac but cant test it on the road till tomorrow when I go to work.

    In the Widget.html file of the UniAW add this to body section Or maybe it should be in the head section!, anyway, it works like this on the Mac, just stick it wherever you want .).


    <script language="JavaScript">UpdateLocation(); setInterval('UpdateLocation()', 20000 )</script>

    We will see how the battery goes.

    I know it's not important but would just like to see it change while driving!! (I'm a big kid really lol..)

    Quote Originally Posted by KraXik View Post
    Ian, rather than making UniAW 5 work with GPS code, would it not be easier to make the GPS widget by Crazy into UniAW?
    Hi bud,

    I already went through that headache, because the original uses the var locale="CAXX0677 and the UniAW uses the woeid code in "123456" format it didn't work.

    UniAW with GPS is now working, just still in beta LOL..
    Last edited by Ian Nicoll; 03-08-2012 at 12:27 PM.

    "If it's not broken, I'll fix it till it is"

  6. The Following 6 Users Say Thank You to Ian Nicoll For This Useful Post:

    chevymusclecar (03-08-2012), chg128 (03-08-2012), KraXik (03-08-2012), Sheff1889 (03-08-2012), stratnik (03-08-2012), The_Durben (03-08-2012)

  7. #504
    lmao!! I'm a big kid also Ian and I have added the script code! Will be able to test in a couple of hours!

    Thanks you guys for your diligence!

  8. The Following 5 Users Say Thank You to chevymusclecar For This Useful Post:

    chg128 (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012), stratnik (03-08-2012), The_Durben (03-08-2012)

  9. #505
    Quote Originally Posted by Ian Nicoll View Post
    Thanks guys, but I would like to try it updating the UpdateLocation function every 20 seconds, so maybe Chevy can also try this, it works on my mac but cant test it on the road till tomorrow when I go to work.

    In the Widget.html file of the UniAW add this to body section Or maybe it should be in the head section!, anyway, it works like this on the Mac, just stick it wherever you want .).


    <script language="JavaScript">UpdateLocation(); setInterval('UpdateLocation()', 20000 )</script>

    We will see how the battery goes.

    I know it's not important but would just like to see it change while driving!! (I'm a big kid really lol..)



    Hi bud,

    I already went through that headache, because the original uses the var locale="CAXX0677 and the UniAW uses the woeid code in "123456" format it didn't work.

    UniAW with GPS is now working, just still in beta LOL..
    I added that script to my lock and will test in my way home in about 6hrs.
    Thanks again Ian

  10. The Following 4 Users Say Thank You to The_Durben For This Useful Post:

    chevymusclecar (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012), stratnik (03-08-2012)

  11. #506
    You're all big kids. LMAO !

    Before GPS, no problem to update weather all 15/20 minutes (i don't remember the number of time where i saw rain outside and my widget show a partly cloudy day, but i don't care about this... Just a respring if necessary ).

    Now, you want an update every 20 secondes .

    LOL.

    PS : i also a big kid... I think i'll test this tomorrow....

  12. The Following 6 Users Say Thank You to Dacal For This Useful Post:

    chevymusclecar (03-08-2012), chg128 (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012), stratnik (03-08-2012), The_Durben (03-08-2012)

  13. #507
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    5,408
    Thanks
    8,474
    Thanked 21,646 Times in 4,337 Posts

    ^^ LOL
    Well this big kid is going nite nite, see ya's tomorrow guys.

    Oh man, I need a 50" MacbookPro, 17" is just not big enough for this theming stuff.

    Attached Thumbnails Attached Thumbnails -screen-shot-2012-03-09-3.20.53-am.png  
    Last edited by Ian Nicoll; 03-08-2012 at 01:24 PM.

    "If it's not broken, I'll fix it till it is"

  14. The Following 12 Users Say Thank You to Ian Nicoll For This Useful Post:

    bombmom (03-08-2012), chevymusclecar (03-08-2012), chg128 (03-08-2012), Dacal (03-08-2012), King_O_Hill (03-08-2012), KraXik (03-08-2012), kruzzit (03-08-2012), lostinthemes (03-09-2012), Sheff1889 (03-08-2012), stratnik (03-08-2012), The_Durben (03-08-2012), zocker48 (03-09-2012)

  15. #508
    I'm a big kid with small toys (ipod 2g kids have 4g haha) anyway if someone was to jump in rite now as a newbie...where would they start? What's the latest download they should use to get the latest tweaks here? Or is that still being worked on? Kids want this now.

  16. The Following User Says Thank You to poofster1 For This Useful Post:

    KraXik (03-08-2012)

  17. #509
    Quote Originally Posted by Ian Nicoll View Post
    But this is not what other people are telling us, it changes as they drive, not on the updateInterval!! (Unless they all have their UpdateInterval set to like 2 minutes, which I hope not LOL)

    When I have it running on My Mac with "Live View", I can edit the text file in the theme folder (not in the HTML editor) and the widget changes, I can put the txt file on my desktop and point the widget to it, and again if I edit the coordinates in the text file the widget updates immediately, so I'm wondering why it doesn't do it on the phone!
    It uses the deviceís cellular radio to determine the userís location.

    https://developer.apple.com/library/...eLocation.html

    In iOS 4.0 and later, you can use the significant-change location service to receive location events. This service offers a significant power savings and provides accuracy that is good enough for most applications. It uses the deviceís cellular radio to determine the userís location and report changes in that location, allowing the system to manage power usage much more aggressively than it could otherwise. This service is also capable of waking up an application that is currently suspended or not running in order to deliver new location data.

  18. The Following 10 Users Say Thank You to crazyvivek For This Useful Post:

    chevymusclecar (03-08-2012), chg128 (03-08-2012), Dacal (03-08-2012), hemptation (04-05-2012), Ian Nicoll (03-08-2012), King_O_Hill (03-08-2012), KraXik (03-08-2012), rasputin007 (03-08-2012), stratnik (03-08-2012), The_Durben (03-08-2012)

  19. #510
    where start?

    first page, first post...

    you should read the full thread to understand what these amazing kids are doing!!

  20. The Following 5 Users Say Thank You to Schnedi For This Useful Post:

    chevymusclecar (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012), stratnik (03-08-2012), The_Durben (03-08-2012)

  21. #511
    Quote Originally Posted by crazyvivek View Post
    It uses the device’s cellular radio to determine the user’s location.

    https://developer.apple.com/library/...eLocation.html

    In iOS 4.0 and later, you can use the significant-change location service to receive location events. This service offers a significant power savings and provides accuracy that is good enough for most applications. It uses the device’s cellular radio to determine the user’s location and report changes in that location, allowing the system to manage power usage much more aggressively than it could otherwise. This service is also capable of waking up an application that is currently suspended or not running in order to deliver new location data.
    Ah Yes! Now it makes sense! I do remember reading that.

    Thanks Crazy!

  22. The Following 2 Users Say Thank You to King_O_Hill For This Useful Post:

    chg128 (03-08-2012), KraXik (03-08-2012)

  23. #512
    Thanks for that info crazy

    To everyone else, crazyvivek has a donation link up in his signature if you're in a giving back kinda mood

  24. The Following 7 Users Say Thank You to The_Durben For This Useful Post:

    chevymusclecar (03-08-2012), chg128 (03-08-2012), hemptation (04-05-2012), Ian Nicoll (03-08-2012), King_O_Hill (03-08-2012), KraXik (03-08-2012), stratnik (03-08-2012)

  25. #513
    Livin the iPhone Life nik1975's Avatar
    Join Date
    Feb 2008
    Location
    Thessaloniki, Greece
    Posts
    1,427
    Thanks
    3,270
    Thanked 1,133 Times in 659 Posts

    Quote Originally Posted by chg128 View Post
    mine today ....

    UniAW works well for me too,but sometimes like without animated as well


    Nice job man..Can you do this also for the homescreen, without the photo of car?Only hour, weather??
    Thank you..

  26. The Following 2 Users Say Thank You to nik1975 For This Useful Post:

    chg128 (03-08-2012), KraXik (03-08-2012)

  27. #514
    Mmmm...

    Rework the code to reduce the load in case of location check every 20s... I think (but need to test) that will be better (no need to modify the line in HTML) :

    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    // Author : Vivek Thakur
    // Date : 25 Feb 2012
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    // Modified by Dacal for BaSalt HD theme.
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------

    var prevlatitude = "";
    var prevlongitude = "";
    var textLat;
    var textLong;
    var refreshWeatherTimer;
    var get_location = false;

    function trimString (text) {
    return text.replace(/^\s+/g,'').replace(/\s+$/g,'');
    }

    function UpdateLocation() {
    var file="../../../../var/mobile/Documents/myLocation.txt";
    var txt_request = new XMLHttpRequest();
    txt_request.overrideMimeType("text/xml");
    var LocationTimer = setTimeout(function() {
    txt_request.abort();
    dealWithWeather({error:true});
    }, 10000);
    txt_request.onload = function(e) {
    clearTimeout(LocationTimer);
    getCoordinates(txt_request.responseText);
    }
    txt_request.open("GET", file, false);
    txt_request.setRequestHeader("Cache-Control", "no-cache");
    txt_request.send(null);
    setTimeout("UpdateLocation();", 20000); // Refresh location every 20s
    }

    function getCoordinates(request) {
    var substr = request.split('\n');
    var templatitude=(substr[0]).split('=');
    var templongitude=(substr[1]).split('=');
    latitude = trimString(templatitude[1]);
    longitude = trimString(templongitude[1]);

    if (prevlatitude != latitude || prevlongitude != longitude) {
    prevlatitude = latitude;
    prevlongitude = longitude;
    getWoeid ();
    }
    }

    function getWoeid() {
    var url = "http://where.yahooapis.com/geocode?location=" + latitude + "+" + longitude + "&gflags=R";
    var xml_request = new XMLHttpRequest();
    var WoeidTimer = setTimeout(function() {
    xml_request.abort();
    if (get_location == true) { document.getElementById("Offline").innerHTML = "Offline"; }
    else { dealWithWeather({error:true, errorString:null}); }
    }, 10000);
    xml_request.onload = function(e) {
    clearTimeout(WoeidTimer);
    woeid_loaded(xml_request);
    }
    xml_request.overrideMimeType("text/xml");
    xml_request.open("GET", url+"&antiCache="+Math.floor(Math.random()*1001), false);
    xml_request.setRequestHeader("Cache-Control", "no-cache");
    xml_request.send(null);
    }

    function woeid_loaded(request) {
    if (get_location == true) { clearTimeout(refreshWeatherTimer); }
    var effectiveRoot = findChild(request.responseXML, "ResultSet");
    postal = parseInt(findChild(effectiveRoot, "Result").getElementsByTagName("woeid")[0].childNodes[0].nodeValue);

    if (latitude < 0) { textLat = Math.round(latitude*100)/100 + "\u00B0" + "S"; }
    else if (latitude > 0){ textLat = Math.round(latitude*100)/100 + "\u00B0" + "N"; }
    else { textLat = Math.round(latitude*100)/100 + "\u00B0"; }

    if (longitude < 0) { textLong = Math.round(longitude*100)/100 + "\u00B0" + "W"; }
    else if (longitude > 0) { textLong = Math.round(longitude*100)/100 + "\u00B0" + "E"; }
    else { textLong = Math.round(longitude*100)/100 + "\u00B0"; }

    get_location = true;
    refreshWeather();
    }

    function refreshWeather() {
    fetchWeatherData(dealWithWeather,postal);
    var refreshWeatherTimer = setTimeout("refreshWeather()", updateWeatherEvery); // Refresh weather as specified in Config.js
    }
    In fact, i don't like let a timer which is not specified. Sometimes, timer (define by setInterval or setTimeout) will not stop correctly and will continue to do its job. I prefer assign a variable and stop it when no need anymore.

    In some widget, it's a cause of bug and/or fast battery draining.

    Quote Originally Posted by The_Durben View Post
    To everyone else, crazyvivek has a donation link up in his signature if you're in a giving back kinda mood
    Done . Thx man, i appreciate the work. No big money, but it's a start

    Question (and i must also check that !) : What is the precision of the GPS ? Imagine you have the phone in your pocket, and you move from kitchen to bedroom => Is it a significant change for update the weather ? Oh god, my battery...
    Last edited by Dacal; 03-08-2012 at 03:11 PM.

  28. The Following 8 Users Say Thank You to Dacal For This Useful Post:

    bombmom (03-08-2012), chevymusclecar (03-08-2012), chg128 (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012), lostinthemes (03-09-2012), stratnik (03-08-2012), The_Durben (03-08-2012)

  29. #515
    So Dacal will not need to add this line....

    <script language="JavaScript">UpdateLocation(); setInterval('UpdateLocation()', 20000 )</script>

    In HTML?

  30. The Following User Says Thank You to chevymusclecar For This Useful Post:

    KraXik (03-08-2012)

  31. #516
    Guys, during your tests, if you drive don't forget to look the road... Don't focalize on you phone .

    Quote Originally Posted by chevymusclecar View Post
    So Dacal will not need to add this line....

    <script language="JavaScript">UpdateLocation(); setInterval('UpdateLocation()', 20000 )</script>

    In HTML?
    No. I'm trying to make a all-in-one script for modders. The change to an existing widget must be minor. For now, need only 4 things.

    1) Include a line in the HTML (be careful must point to the right location for js) :

    <script type="text/javascript" charset="utf-8" src="Resources/JavaScript/Main/GetLocation_Weather.js"/></script>
    2) Copy the "GetLocation_Weather.js" (code in previous post) in the place above

    3) Slightly modify the main javascript of your theme (for my widget, i call an init function in main.js) and must replace (for exemple ) :

    validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal
    by :

    if (locale == 0) { UpdateLocation(); }
    else { validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal); }
    4) Put the locale variable to 0. For my widget (and a lot now, as a many are based on my code), edit the ../Setup/Config.js.

    I think i didn't forget anything....
    Last edited by Dacal; 03-08-2012 at 03:34 PM.

  32. The Following 6 Users Say Thank You to Dacal For This Useful Post:

    chevymusclecar (03-08-2012), chg128 (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012), rasputin007 (03-08-2012), The_Durben (03-08-2012)

  33. #517
    Quote Originally Posted by chevymusclecar View Post
    So Dacal will not need to add this line....

    <script language="JavaScript">UpdateLocation(); setInterval('UpdateLocation()', 20000 )</script>

    In HTML?
    I added Ian's script and it's kicking my phone batteries azz. 35% in 3hrs
    Id like to know the same thing Chevy

  34. The Following 3 Users Say Thank You to The_Durben For This Useful Post:

    chevymusclecar (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012)

  35. #518
    Quote Originally Posted by The_Durben View Post
    I added Ian's script and it's kicking my phone batteries azz. 35% in 3hrs
    Id like to know the same thing Chevy
    Try my code (think it's better, Ian it's not a critic !), but i'm scare that battery draining is more intensive than an update in same time of "classic" weather.

  36. The Following 4 Users Say Thank You to Dacal For This Useful Post:

    chevymusclecar (03-08-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012), The_Durben (03-08-2012)

  37. #519
    Livin the iPhone Life KraXik's Avatar
    Join Date
    Mar 2011
    Location
    Winchester, UK
    Posts
    2,637
    Thanks
    2,685
    Thanked 1,757 Times in 894 Posts

    I'm confused as to why the update thing has to change? It works amazingly well with Crazys lockscreen. Why do we need to change it? Me = confused. :s

  38. The Following User Says Thank You to KraXik For This Useful Post:

    chg128 (03-08-2012)

  39. #520
    Quote Originally Posted by KraXik View Post
    I'm confused as to why the update thing has to change? It works amazingly well with Crazys lockscreen. Why do we need to change it? Me = confused. :s
    The crazy LS work very well ! It's the implementation in others widgets which need to be more easy. The main goal (i think) is to make a easy add-on for existing widget.

  40. The Following 9 Users Say Thank You to Dacal For This Useful Post:

    chevymusclecar (03-08-2012), chg128 (03-09-2012), Ian Nicoll (03-08-2012), KraXik (03-08-2012), lostinthemes (03-09-2012), Schnedi (03-08-2012), Sheff1889 (03-09-2012), stratnik (03-08-2012), The_Durben (03-08-2012)

Page 26 of 136 FirstFirst ... 162425262728 36 76 126 ... LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •