In order to keep shitty attitude they have made it as difficult and frightening to install as they could possibly do. First of all, there is no version for Germany (Telekom Deutschland), North America, South Korea and Japan. Most of my readers will probably notice this “North America” part.
Another thing to notice is zip file with another zip file and then an installation inside. It reminds me of Babushka doll. All that is rounded with layer of warnings that would make Charles Manson seek his mommy. And for a good reason - all your data will be gone once upgrade starts.
In order to even think about phone upgrade, you need to get HTC Sync from HTC support. This is probably most bloated piece of shit software from HTC but unavoidable. Just to be sure this won’t mess with my development setup on this machine I made fresh install on my wife’s laptop.
Whole update takes approximately 5 minutes and it goes without any problem (if you discount wiping data as a problem). It leaves you with software version 3.14.405.1 (Android 2.3.3) and no hope of getting next update. :)
P.S. If you are wondering, my internal storage has 124 MB free.
In last post I wen’t through task of restoring properties from their textual representation. But how did we end up with text?
It is as simple as loop through all public properties and then using TypeConverter in order to properly convert a value to it’s string representation. Do notice that ConvertToInvariantString is preferred over ConvertToString in order for code to properly work on non-USA Windows.
publicstatic IDictionary<string,string>GetPairs(object objectInstance){var result =new Dictionary<string,string>();foreach(var propertyInfo in objectInstance.GetType().GetProperties()){//loops through all public propertiesvar propertyConverter = TypeDescriptor.GetConverter(propertyInfo.PropertyType);//gets converter for propertyvar stringValue = propertyConverter.ConvertToInvariantString(propertyInfo.GetValue(objectInstance,null));//converts value to string
result.Add(propertyInfo.Name, stringValue);}return result;}
P.S. Saving key/value pairs to file is not shown here… guess how it is done… :)
It all started with list of key value pairs from file. Each key was some property on object that needed to be set and value was obviously value for that property. Since there was no type information in file, I had to use reflection in order to set value. And then problem hit me. Reflection would not sort out my problem with converting string value to proper type.
To solve it, I just loop through all key/value pairs and find property with that name in my object’s instance. Once property is found, I get a magic thing called TypeConverter. TypeConverter enables conversion from string to proper type that can be used in standard reflection SetValue call. And thus problem is solved. Code follows:
foreach(var item in pairs){//go through all key/value pairsvar propertyInfo = instance.GetType().GetProperty(item.Key);//find property with same name
Trace.Assert(propertyInfo !=null);//we must have this propertyvar propertyConverter = TypeDescriptor.GetConverter(propertyInfo.PropertyType);//lets find proper converter.
Trace.Assert(propertyConverter !=null);//we must have converter
propertyInfo.SetValue(instance, propertyConverter.ConvertFromInvariantString(item.Value),null);//set value}
In short, it is a site where you should be able to find best practice code samples. You can even make a request for some sample that you need. Of course, not all requests will be granted but interesting and much sought code should appear there eventually.
Of course, anybody can upload their code sample for any request and thus take some load off poor Microsoft guy who got writing samples as a task. :)
It is interesting idea, but let’s wait whether usefulness/noise will be better than rest of Internet.
Being programmer I need to do send executable files a lot. However my mail client, Google Mail, does not like this. Since it check for executable files is done even in zipped archives, easiest solution for me was to use my trusty WinRAR. Google had no idea that .exe was hidden inside it.
Not any more. Google now supports RAR archives also. While that does help with preview, it also enables Google to check my RAR files for executables. And to annoy me with “Our system detected an illegal attachment on your message.”
Now only way to send executables is to change archive extension to e.g. rarx… Annoyances…