Removed 'last updated' from Asus Weather Widget (root not required)

Search This thread

alexovy

Senior Member
Jan 18, 2010
531
192
thank you for the widget, it looks awesome.

I have some problems, though:
1. It doesn't detect my correct location;
2. If I choose manual location, I can find my location, but the weather is not changing to my location.

Can you tell me how to fix?

Thank you!
 

JuEv0splash

Senior Member
Sep 5, 2011
78
28
Denton
Is there any chance somebody (hopefully op) would be willing to make this normal sized with fahrenheit and 2 hours the default? Would really appreciate it. I like the normal size as it looks better on the gs3 cause it doesn't show the 4 day under the widget.

GS3 unrooted and can't select save on portrait or landscape.

Thanks a lot guys. I hope somebody would be willing to help me out.

Just an FYI for folks like me trying to figure out how to save changes to the update intervals and Celsius/Fahrenheit options...

I did a build.prop edit. Using the Nexus 7 I changed DPI to 160, rebooted, opened widget settings and changed to my liking, changed DPI back to 213, rebooted again, presto!

Sent from my Nexus 7 using Tapatalk 2
 
T

The_Biz

Guest
Just an FYI for folks like me trying to figure out how to save changes to the update intervals and Celsius/Fahrenheit options...

I did a build.prop edit. Using the Nexus 7 I changed DPI to 160, rebooted, opened widget settings and changed to my liking, changed DPI back to 213, rebooted again, presto!

Sent from my Nexus 7 using Tapatalk 2
I thought about this before but I'm not rooted. :good:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 49
    I was a bit annoyed by the addition of the "last updated" line in the Asus Weather widget included in the 3.2 update. I thought it was ugly and provided a bit too much information to the widget. Since there wasn't an option to switch it off, I disabled it from being displayed. I also edited the widget layout files to create another version with smaller text. A screenshot is attached that shows the original (top) and the modified (bottom) Weather widgets. The second screenshot shows the original (top), modified (bottom left), and modified & resized (bottom right).

    Root access is not required as the modified Weather widget is not a system application and can coexist with the original Weather widget. The ModWeather.apk installs like any other application and does not replace the original Weather widget. After installing the widget, I found a reboot necessary to get the widget to appear in the list.

    I have received confirmation that it works without root.

    Update: I received reports of these modified widgets not working for some. Upon investigation, I believe I found the source of the problem and have corrected it. I also rebuilt the modified widgets using the stock widget from a system dump of build 8.6.15.13. If you installed these modified widgets prior to October 7th 2011, you may want to install the updated version(s). I updated the version number to 1.0.2 to facilitate upgrading from the previous 1.0 version.

    Update 2: With the release of ICS, Asus included the ability to resize the Weather widget to 1x1, 4x3, or 4x4. The 4x4 variant includes a daily forecast. I have been working on a resized variant w/ the 'last updated' text removed. While it is still a work in progress, the latest revision can be found here.

    Feel free to let me know whether it works or not for you and don't be afraid to press that little thanks button below.

    --------
    There have been several inquiries related to the battery widget in the screenshots. It is actually a widget that I created for my own use and has nowhere near the features of some of the other offerings. My Transformer is my first real exposure to Android, so I wanted to write my own to get a better understanding of Android application development. I also wanted to use images that complemented the Asus Weather and Date widgets. I am providing this widget as is and cannot guarantee any further development and/or improvements. However, feedback is always appreciated.

    Battery widget updated to version 1.1.0 on August 16th 2011.
    --------
    ________________________

    I hope some of you find this information useful. If so, be sure to say thanks via the button below.
    12
    ICS Asus Weather Widget Resized

    I spent a bit more time adjusting the layout of the daily forecast (4x4 size) and I completed the removal of the 'last updated' time from the widget (previously forgot an edit).

    I also added a little debug that might help determine why some users (Galaxy Nexus) are having difficulties in resizing. I found that after re-installing while testing, I often had to switch orientations (landscape -> portrait or portrait -> landscape) before resizing would work.

    This revision still uses my modified default settings (4x4, 2 hour update interval, Fahrenheit). I have not yet addressed why some users (Galaxy Nexus) cannot change the settings.

    The previous revision can still be found in this post.

    Update: I added a version that defaults to Celsius for those currently unable to change the settings.
    3
    Creating the Reworked & Resized Weather Widget

    The following is an overview of the process I followed in creating the modified & resized weather widget found in the first post. These instructions are intended to serve as a guide to those interested in creating their own modifications.

    After going through this process a few times and/or modifying a few different APK files, this whole thing becomes much less intimidating.

    Prerequisites
    • Deodexed Asus Weather APK (attached to post)
    • android-apktool - tool for reengineering Android apk files (here)
    • SignApk.jar - (Google search)
    • zipalign - archive alignment tool (included in Android SDK)

    Step 1 - Decoding the APK
    Using apktool, decode the APK to retrieve the resources into nearly original form. In this example, the decoded files are placed in a directory called ModWeatherResizedDir.
    Code:
    apktool decode Weather.apk ModWeatherResized

    Step 2 - Modifying the package name
    The package name is a unique identifier used by Android to manage the installed applications. The easiest package name modification simply involves changing all instances of asus to another unique identifier.

    Using your favorite editor (I like gVim), modify all references to the package name (com.asus.weather*) found in the XML resource files (ModWeatherResizedrDir/AndroidManifest.xml and ModWeatherResizedDir/res/xml/*.xml) .

    The package name is also embedded in the smali disassembly files (ModWeatherResizedDir/smali/com/asus/weather/*.smali and ModWeatherResizedDir/smali/com/asus/weather/accuWeather/*.smali). My recommendation is to find an editor that makes it easy to perform a global search and replace.

    The package name must also match the folder hierarchy under the smali folder (ModWeatherResizedDir/smali/com/asus/weather/ and ModWeatherResizedDir/smali/com/asus/weather/accuWeather/). One simple option is to change the name of the asus folder to match a new unique identifier selected for the application.

    Step 3 - Update the application name and any additional text
    Using your favorite editor, modify the text (i.e. app_name) found in ModWeatherResizedDir/res/values/strings.xml.

    Step 4 - Modify resources
    The XML layout resources for the widget are found in ModWeatherResizedDir/res/layout-land/widgetlayout.xml and ModWeatherResizedDir/res/layout-land/widgetlayout.xml. The weather widget uses a relative layout and each text element can be re-sized and/or re-positioned. I followed a trial and error approach to get things where I wanted them. I also modified the thumbnail image in ModWeatherResizedDir/res/drawable-mdpi/.

    Step 6 - Modify the smali disassembly
    Modifications to the smali disassembly files are required to change the behavior of the widget. This is where I removed the 'last updated' text by setting the update value to "" in WeatherWidgetProvider.smali. I added a line (const-string vXX, "" where XX is the variable number being moved into v2 prior to the call to setTextViewText) following both occurrences of const v4, 0x7f080014, which corresponds to the id for the "widget_lastupdate" value in ModWeatherResizedDir/res/values/public.xml.
    I found it useful to pull the classes.dex file from the APK, convert it from .dex to .class format using dex2jar, and then browse the reconstructed source using JD-GUI. It is important to remember that the reconstructed source is not a 100% match to the original source code. However, it is useful for comparing against and understanding the corresponding smali source.

    Step 6 - Build the APK
    Now that the desired modifications have been made, build the APK using apktool.
    Code:
    apktool build ModWeatherResizedDir ModWeatherResized_unsigned.apk

    Step 7 - Sign the APK
    The Android system requires that all installed applications be digitally signed with a certificate whose private key is held by the application's developer. I followed the instructions found here or here for generating my keys and using them to sign the APK. It should also be possible to sign the APK using the approach recommended at developer.android.com.
    Code:
    java -jar signapk.jar certificate.pem key.pk8 ModWeatherResized_unsigned.apk ModWeatherResized_signed.apk

    Step 8 - Zipalign the APK
    Zipalign the APK to optimize the way it is packaged in order to enable the Android operating system to interact with the application more efficiently. The benefit of this step is a reduction in the amount of RAM consumed when running the application.
    Code:
    zipalign -f -v 4ModWeatherResized_signed.apk ModWeatherResized.apk
    ________________________

    I hope some of you find this information useful. If so, be sure to say thanks via the button below.
    2
    ICS Asus Weather Widget Resized (old)

    Here's an ICS-based, resized Asus Weather widget. It is still a bit of a work in progress as I completed some of the modifications late last night and may not have worked out all of the kinks yet. If you give it a try, let me know how it works for you.

    Update: I spent a bit more time with it today and completed the re-sizing for both landscape and portrait modes. I defaulted the size to 4x4 instead of 4x3 so the daily forecast is displayed by default. Re-sizing to 4x3 removes the forecast. I added drop shadows to the daily forecast weather icons and made the background image used behind the forecast transparent. I also tried my hand at changing the default settings, so the defaults for this version of the widget are to update every 2 hours and display the temperature in Fahrenheit. I have attached a deodexed & signed version of the original ICS Asus Weather widget for those who do not have it and would like to compare.

    Update 2: An updated revision of this widget is now available here.

    I should probably start a new thread for this and include screen shots, but this post will do for now.
    1
    I have updated the original post to include a version with reduced text size. I actually prefer this one to the original.