[Q] Help displaying day of the month in Widget - Android Software Development

I made a widget, just a icon sized one, that I want to just show the day of the month date, for example today is April 25th so I want it to just show the number "25" on the widget.
Here's my code
DateFormat format = SimpleDateFormat.getDateInstance( SimpleDateFormat.WEEK_OF_MONTH_FIELD, Locale.getDefault() );
I've tried just about all the different settings where WEEK_OF_MONTH_FIELD, but I can't get just the day number to show up. It always shows like April 25 or something.

Try this:
PHP:
Calendar calendar = Calendar.getInstance();
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
Log.d("whats the day mr wolf", " " + dayOfMonth);

Related

K-JAM - Messaging disappeared from Today screen

OK, so the "Messaging" line has disappeared from my Today screen on my 3-day-old K-JAM. I'm unhappy, I like that little line there.
It isn't listed in Settings | Today | Items.
MemMaid shows it, however; I suspect that's because the registry entry is still present. Here's mine:
HKLM\Software\Microsoft\Today\Items\"Messaging"
DLL : SZ = "" (blank)
Enabled : DWORD = 1
Flags : DWORD = 0
Options : DWORD = 0
Order : DWORD = 2
Selectability : DWORD = 2
Type : DWORD = 4
Is there something wrong here? Can someone compare theirs to mine to see if there's a difference? Is there something else that has to be configured to get it to show up on Today?
(If it matters, this happened after installed Agile Messenger. I downloaded it from PocketGear, installed it, set up an account, and got a notice that an upgrade was available, do I want to install it? Sure! It downloads, then tries to install, but of course it can't because it's already running, I presume. Do I want to terminate the currently running program? Sure! Then the installer bombs, too. Turns out I didn't like Agile Messenger, but uninstalling it was a pain. It didn't show up in Remove Programs nor Running Programs, so I had to soft-reset to kill the task, then use MemMaid to clear it all out.)

Message Indicator Missing (Today Plug-In)

I ran Memmaid today and after tinkering noticed my today screen was missing the message section where it shows the number of emails, sms, mms, etc...
Checking the today screen settings I have no item to turn on either.
How can I get it back?
Check you reg and see what you have here
HKLM\Software\Microsoft\Today\Items\"Messaging"
you should have these values
DLL = tmailutl.dll
Enabled = 1
Flags = 0
Options = 0
Opder = 3 (this os the order that it appears on the today screen)
Selectability = 2
Type = 4
say there brother, nice job...
It worked!!
Now I have to figure out which WinMo 6.0 I can install!

Calendar text in Weekly view (Outlook-PC Style)

This is a pocket outlook feature, disableb by default in 320x240 devices.
The text couldn't fit in the small space in those devices. Using a 128 or 96 DPI Athena is a usefull feature
A simple registry tweak is needed to activate
Show Calendar event text in Week View
The key Calendar and the ShowTextInWeekView may not exist - just create it if it doesn't
HKCU\Software\Microsoft\Calendar\ShowTextInWeekView = 1 (DWORD decimal)
To disable it again:
HKCU\Software\Microsoft\Calendar\ShowTextInWeekView = 0 (DWORD decimal)
Please note that your event must have long enough a duration to show the event text, and the week view (with its narrow columns) truncates long words easily
OTHER CALENDAR TWEAKS ARE
Change Calendar 'working days'
If you wish to change the 'working days' in the calendar, adjust the following:
For a Mon-Fri workweek (default):
HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2210003E (DWORD hexadecimal)
For a Mon-Sat workweek:
HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2210007E (DWORD hexadecimal)
For a Tue-Thu workweek:
HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 22100016 (DWORD hexadecimal)
Here's how this works. When editing the value, switch to "Binary" mode. For the default Mon-Fri, you should see:
100010000100000000000000111110
The last 7 numbers are what we're interested in. They stand for the days of the week, in reverse order: Saturday, Friday, Thursday, Wednesday, Tuesday, Monday, Sunday. When the number is "1", it is a working day. If it is "0", it's not a working day. So to look at the above examples again:
Days : SFTWTMS
Mon-Fri: 0111110
Mon-Sat: 1111110
Tue-Thu: 0011100
Using the above, you should be able to set the working days to whatever you'd like. Note that this value also adjusts the working HOURS. The examples here all use the default 8am-5pm workday. See the "Change Calendar 'working hours'" tweak to modify this. Note that the ActiveTimes key and value may not exist. Simply create them first.
Change Calendar 'working hours'
If you wish to change the 'working hours' in the calendar, adjust the following:
For 8am-5pm (default):
HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2210003E (DWORD hexadecimal)
For 9am-5pm:
HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2212003E (DWORD hexadecimal)
For 2pm-10pm:
HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2C1C003E (DWORD hexadecimal)
(from xda-devs wiki)
Would be nice if someone could make a cab for this.
Thanks, useful to turn on this imho essential feature. Would be nice to reduce the font size and unbolden the appointment text.
I'm going to have to stick with day view for now: all-day appointments remain hidden in week view unless they're selected, and there's no way of knowing if you have more than one all-day appointment.
Correct me if I'm wrong, but aren't the work week tweaks mostly redundant? You can change this option in Tools-Options-General-Week View 5/6/7 day week and Tools-Options-General-1st day of week
yaughan said:
Thanks, useful to turn on this imho essential feature. Would be nice to reduce the font size and unbolden the appointment text.
I'm going to have to stick with day view for now: all-day appointments remain hidden in week view unless they're selected, and there's no way of knowing if you have more than one all-day appointment.
Correct me if I'm wrong, but aren't the work week tweaks mostly redundant? You can change this option in Tools-Options-General-Week View 5/6/7 day week and Tools-Options-General-1st day of week
Click to expand...
Click to collapse
Work week tweaks is just to have more control. You can chose a working week with mon and fri holidays 1011101 Knowledge is power
Change Calendar 'working hours'.
Here's how this works:
The first 2 characters define the ending hour as a count of half hours since midnight, in hexadecimal. So for midnight, it would be 0 half hours in hexadecimal = 0. 5pm is 17 hours, or 34 half hours. 34 in hexadecimal is 22. 10pm is 22 hours, or 44 half hours. 44 in hexadecimal is 2C. You can use a calculator capable of hexadecimal conversions to get the hexadecimal number.
Similarly, the next 2 characters define the starting hour as a count of half hours since midnight, in hexadecimal. So for 8am.. 16 half hours, 16 in hexadecimal is 10. 9am = 18 half hours = 12. 14h = 28hh = 1C.

Positioning items on the stage

I am used to work with Flash and if we want to position an item at certain coordinates on the stage we just modify the .x and .y values. But I can't manage to find a way to this to a TextView (or any other item for that matter).
I did manage to get the width and height of the stage using this:
Code:
Display display = getWindowManager().getDefaultDisplay();
stageWidth = display.getWidth();
stageHeight = display.getHeight();
But, if I want for example to position a TextView called tv at the coordinates like this:
tv.x = stageWidth - tv.width - 30
tv.y = stageHeight - tv.height - 30
I don't know how to do it.
Thanks, and sorry if this is a stupid answer...maybe I am to used in working with Flash.

Change battery icon with activity

With my program I launch a activity that show a fake alertdialog for battery low. Now I want change also the icon battery on status bar but this is a system icon and there is not api for to do this. I found on the Internet this not public API http://grepcode.com/file/repository.../com/android/server/status/StatusBarIcon.java but I have a problem for this line :
1) View v = inflater.inflate(com.android.internal.R.layout.status_bar_icon, parent, false);
2) AnimatedImageView im = (AnimatedImageView)v.findViewById(com.android.internal.R.id.image);
because on official API there is not a com.android.internal.R.layout.status_bar_icon or com.android.internal.R.id.image I tried to replace with costant int value but for first line I get View v = [email protected] but for second line I get AnimatedImageView im = null :-(
How can I do it?
I can not do it, I thought of creating a transparent activity in fullscreen modo and notitle and put my fake battery image on the top and with layout margin left put it over the battery icon. I tried it but my image go under the status bar...why ?? :-(

Categories

Resources