This is a very simple WorldClock widget.
I wanted to find out what is possible with B4A and widgets and so I started to create this project.
I think the result is quite amazing. At the beginning of this project I haven't thought that this all is possible but thanks to the great Reflection library I got all working as expected.
Be aware that it is only a widget and not a complete app, so just add it to your homescreen and configure it. To change the settings for a widget click on it.
The widget has the following features:
- Resizable layout (works with most custom launcher and stock launcher since Android 3+)
- Different instances of the same widget. All with their own settings.
- Search for any location in the world and set its timezone automatically. This uses the standard Android search feature, geolocation and a web service.
- Widget configuration screen.
- Different layouts for portrait and landscape
- Selectable layout from widget configuration screen
- Adjustable widget transparency (Android 2.1 and up)
- Correct widget size for Android 4+
- Uses different background on different Android Versions
- Detects changes in system settings (Manually setting time and timezone)
- Uses correct Time and Date format according to Device settings
- NEW: Real time preview of the exact widget
The project uses the following libraries:
- AHLocale - For TimeZone selection and formatting dates and times.
- AHViewPager - For selecting different widget layouts.
- Geocoder - For searching for locations
- HTTP - For requesting timezone data
- ICOSImageView - For displaying the widget layout preview images (Needs special scale type)
- IME - For closing the keyboard after searching for location
- Phone - Detecting Android version
- Reflection - For many magic things.
- XmlSax - For parsing Webservice result (Timezone)
- HTTPUtils2 - For requesting TimeZone data from webservice
- Statemanager - For saving widget settings and saving Activity state
- Dialogs - For the color dialog (setting text color)
V1.1:
- Show the real widget in the preview
- Added colordialog for selecting text color
I wanted to find out what is possible with B4A and widgets and so I started to create this project.
I think the result is quite amazing. At the beginning of this project I haven't thought that this all is possible but thanks to the great Reflection library I got all working as expected.
Be aware that it is only a widget and not a complete app, so just add it to your homescreen and configure it. To change the settings for a widget click on it.
The widget has the following features:
- Resizable layout (works with most custom launcher and stock launcher since Android 3+)
- Different instances of the same widget. All with their own settings.
- Search for any location in the world and set its timezone automatically. This uses the standard Android search feature, geolocation and a web service.
- Widget configuration screen.
- Different layouts for portrait and landscape
- Selectable layout from widget configuration screen
- Adjustable widget transparency (Android 2.1 and up)
- Correct widget size for Android 4+
- Uses different background on different Android Versions
- Detects changes in system settings (Manually setting time and timezone)
- Uses correct Time and Date format according to Device settings
- NEW: Real time preview of the exact widget
The project uses the following libraries:
- AHLocale - For TimeZone selection and formatting dates and times.
- AHViewPager - For selecting different widget layouts.
- Geocoder - For searching for locations
- HTTP - For requesting timezone data
- ICOSImageView - For displaying the widget layout preview images (Needs special scale type)
- IME - For closing the keyboard after searching for location
- Phone - Detecting Android version
- Reflection - For many magic things.
- XmlSax - For parsing Webservice result (Timezone)
- HTTPUtils2 - For requesting TimeZone data from webservice
- Statemanager - For saving widget settings and saving Activity state
- Dialogs - For the color dialog (setting text color)
V1.1:
- Show the real widget in the preview
- Added colordialog for selecting text color
Attachments
Last edited: