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

Search This thread

jschmier

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

Attachments

  • TF101BatteryWidget.apk
    152.1 KB · Views: 1,382
  • ModWeather.apk
    5.8 MB · Views: 1,739
  • ModWeatherResized.apk
    5.8 MB · Views: 2,334
Last edited:

Disket

Member
Dec 26, 2010
40
1
OP, could you share what was the widget that's showing the battery status for tab+dock?
 

mike5065

Senior Member
May 14, 2011
118
10
Thanks, works great.

Can't confirm the root not required part, since I rooted a couple days ago.

Downloading using TF stock browser didn't want to to work. Using XDA app did. Weird.

Mine required reboot for widget to be available.

Thanks again.
 

jschmier

Senior Member
May 8, 2011
264
436
OP, could you share what was the widget that's showing the battery status for tab+dock?
dual battery widget, available in marketplce

It is actually a widget that I created for my own use and has nowhere near the features of Dual Battery Widget. 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.
 

Gramps

Member
Oct 30, 2008
18
1
Thank you for the weather widget change. I will try it out when I get home.

I noticed your Optimus on the Iceberg battery LWP widget. Can you tell me where you got that. I looks awesome.

Thanks,
Gramps....
 

MetAloid

Senior Member
Mar 16, 2010
65
10
hi
is it possible to make one version with the text of the city and temperature half the size of the original

would like that alot

i did try to do it my self but every time i try to decompile the file apktool give me error message


thanks
 

jschmier

Senior Member
May 8, 2011
264
436
is it possible to make one version with the text of the city and temperature half the size of the original

Would you like to see the text of the city and temperature half the size of that displayed when in landscape mode, portrait mode, or both?

I'm not committing to do the work just yet, but I would like to have a better understanding of your request.
 

MetAloid

Senior Member
Mar 16, 2010
65
10
Would you like to see the text of the city and temperature half the size of that displayed when in landscape mode, portrait mode, or both?

I'm not committing to do the work just yet, but I would like to have a better understanding of your request.

both if it is not to much to ask
 

mike5065

Senior Member
May 14, 2011
118
10
Makes me wonder if you've indirect fixed the temperature cut off problem that has plagued this widget from day 1, the one fixed by rotating.

Will report back here if I stop seeing the problem.

Thanks again. I also like the resized....
 

weaseltt

Member
May 11, 2011
40
3
OP, I have been waiting for something that allows me to re-size this widget since the first time I saw it. I downloaded both apks but for some reason neither of them allows me to click install. I can scroll the list of permissions, I can click the "more" button and I can click the "cancel" button. I just can't click "install". Any ideas on what may be causing that?

I am not rooted, btw. Hopefully I can get this to work for me. Thanks.
 

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.