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

Search This thread

guilhermedsx

Senior Member
Nov 19, 2010
180
18
Is there any chance to make a small version for 800x480 running ICS? (Similar to the PadFone widget)
I'd try to do it myself but I'm a total disaster editing stuff ):
 

sinebubble

Member
Mar 30, 2011
33
4
Anyone else having issues getting changes to the "temperature unit" and "update frequency" settings to stick? I pulled the ModWeatherResized.zip from the first post and installed it on a Galaxy Nexus running CM9 nightly. I've rebooted and "fixed permissions" using Rom Manager, but that hasn't fixed it.
 

jschmier

Senior Member
May 8, 2011
264
436
Anyone else having issues getting changes to the "temperature unit" and "update frequency" settings to stick? I pulled the ModWeatherResized.zip from the first post and installed it on a Galaxy Nexus running CM9 nightly. I've rebooted and "fixed permissions" using Rom Manager, but that hasn't fixed it.

Can you provide a logcat log?
 

jschmier

Senior Member
May 8, 2011
264
436
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.
 

Attachments

  • weather.ics.apk
    5.9 MB · Views: 197
  • weather.resized.ics.apk
    5.9 MB · Views: 380
Last edited:

jschmier

Senior Member
May 8, 2011
264
436
Still doesn't work...

Does it work aside from not saving your settings?

Your previous logcat didn't provide anything useful. Could you provide another? Start from adding the widget to the desktop, adjust and save the settings, and refresh/update the weather. That should exercise most of the code and might shed some light on the problem. Don't filter the log. There may be some entries that don't seem relevant, but may be. If there is any personal info in the log, you can remove it. If you don't want to post the capture for the world to see, you can get it to me via private message.

Another option may be adjusting the widget to use your desired settings by default.
 

sinebubble

Member
Mar 30, 2011
33
4
...I should probably start a new thread for this and include screen shots, but this post will do for now.

I uninstalled the previous versions, rebooted, then installed your new version. Looks like there is some cut off even after I resize the widget.
 

Attachments

  • Screenshot_2012-03-17-15-39-21.png
    Screenshot_2012-03-17-15-39-21.png
    130.3 KB · Views: 184
  • Screenshot_2012-03-17-15-39-33.png
    Screenshot_2012-03-17-15-39-33.png
    131.3 KB · Views: 183
  • Like
Reactions: jschmier

jschmier

Senior Member
May 8, 2011
264
436
I uninstalled the previous versions, rebooted, then installed your new version. Looks like there is some cut off even after I resize the widget.

Thanks for sharing the screen shots.

Was the daily forecast showing for both 4x4 and 4x3 sizes?

Additional size adjustments are relatively easy as they are just edits to the xml layout files. I only had my TF101 to test with and hadn't considered that it might look slightly different on a phone.
 

sinebubble

Member
Mar 30, 2011
33
4
The 4x3 is cut off. Screen shot attached.
 

Attachments

  • Screenshot_2012-03-17-22-04-17.png
    Screenshot_2012-03-17-22-04-17.png
    128.8 KB · Views: 163

--anx--

Senior Member
Apr 22, 2008
1,415
534
Cosenza
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.

I should probably start a new thread for this and include screen shots, but this post will do for now.

That's too big...I've tried it on a Galaxy S2, but it takes 4x3 space...
 

jschmier

Senior Member
May 8, 2011
264
436
Absolutely yes...here it is: http://db.tt/fowvse3f

I wonder if the little icons just below the forecast can be erased...it can save more space...and results in a better looking!

Thanks for sharing the screen shot. The icons can absolutely be removed.

They shouldn't show up at all if the widget is resized to 4x3 as they should not be in the layout for that size. Starting with the ICS version of the widget, Asus made it resizable to 1x1, 4x3, and 4x4. Only the 4x4 should show the daily forecast. It appears to work correctly on my TF101 (the only ICS device I have to test with).

I also noticed that I did not completely remove the "last updated" text from the ICS version of the widget, so I will need to correct this as well.
 

--anx--

Senior Member
Apr 22, 2008
1,415
534
Cosenza
Are you able to resize the current "resized widget" from 4x4 to 4x3 or 1x1 and if so, does the layout change to remove the daily forecast for the 4x3 size?

Yes!!! I'm able to resize the widget!!!
http://db.tt/uLSJVKAE
It's great!!! But there's still a big problem... the temperature doesn't change from farenheit to celsius...and the update interval can't be changed from 2hrs to another timing...

Can be tweaked?
 

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.