powerd by comzept.de RSS 2.0
Comerciales
 Thursday, October 20, 2011

image

Mit dem Update auf Mango sind viele neue Funktionen und Erweiterungen auf dem Windows Phone 7 verfügbar. In der .NET Usergroup Berlin Brandenburg wurde einen Abend lang gezeigt, wie Anwendungen entwickelt und erweitert werden können für WP7 mit Mango. Neben Silverlight und XNA Anwendungen standen auch Themen die Lokalisierung (Wernfried Schwenkner) und Navigation sowie MVVM auf dem Telefon im Vordergrund.

Wie bei dem .NET Usergroup Vortrag versprochen hier die Folien und die Beispiele zu dem Abend rund um das Windows Phone 7.

Download: Beispiele
Download: Folien

Thursday, October 20, 2011 8:50:17 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [1] -
.NET | C# | Vortrag | Windows Phone 7 | WP7
 Sunday, July 31, 2011

There are two interesting properties regarding the lock screen within the Windows Phone 7 (WP7) SDK.

UserIdleDetectionMode

Disabling this will stop the screen from timing out and locking. As an example, you might want to disable UserIdleDetectionMode while downloading a large file or smething like this. After the “long running action” is completed, do not forget to re-enable UserIdleDetectionMode so the screen can timeout as usual.

 

PhoneApplicationService.Current.UserIdleDetectionMode

 

ApplicationIdleDetectionMode

If you disable ApplicationIdleDetectionMode, your app will continue to run when the screen locks. This is a “one shot” action, there is no way to set it back until the app is started again.

Please note that this will consume more energy.

 

PhoneApplicationService.Current.ApplicationIdleDetectionMode

 

PS: The certification process will require to give the user an option where those properties can be configure, if the user does not want one of those. Zwinkerndes Smiley

Sunday, July 31, 2011 10:23:34 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [10] -
C# | Tipps&Tricks | Windows Phone 7 | WP7
 Saturday, July 30, 2011

The connection state of a socket is reflected in the Connected property, but this property only gets updated with the last send- or receive-action. To determine the connection state before send or receive the one an only way is polling the state directly from the socket it self. The following extension class will help doing this.

 public static class SocketEx {
    public static bool IsSocketConnected(this Socket s) {
      // note this are µSec
      var part1 = s.Poll(1000, SelectMode.SelectRead);
      var part2 = (s.Available == 0);
      return !(part1 & part2);
    }
  }
Saturday, July 30, 2011 9:14:06 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
.NET | C# | Tipps&Tricks
 Tuesday, July 26, 2011

24-07-2011 18-19-54

  • completely rewritten database engine
    the new improoved database engine is more flash friendly and much more performant :-)
  • can upload multiple traces to DropBox –
    by tapping the left border in the trace list you can select multiple traces to upload at once to DropBox
  • all uploads will be zipped -
    reduces data transfers and transfer time via 3G / UMTS about 10 times
  • vdop and hdop in the GPX file -
    the dop values can by used within JOSM to see the accuracy of the signal as a circle
  • fixed: timestamp in JOSM compatible format -
    there was a minor issue with the international time format when using the traces with JOSM
  • some minor improvements

more features will follow soon stay tuned …



 

wp7_152x50_blue


PS: please feel free to add suggestion as comments

Tuesday, July 26, 2011 2:11:36 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [2] -
OSMLogger

Dynamically accessing functions via the dynamic type is limited to instance members. The following wrapper will enable static members as well.

 public class StaticMembersDynamicWrapper : DynamicObject {
    private readonly Type _type;
    
    public StaticMembersDynamicWrapper(Type type) { _type = type; }

    public override bool TryGetMember(GetMemberBinder binder, out object result) {
      PropertyInfo prop = _type.GetProperty(binder.Name, BindingFlags.FlattenHierarchy | 
        BindingFlags.Static | BindingFlags.Public);
      if (prop == null) {
        result = null;
        return false;
      }

      result = prop.GetValue(null, null);
      return true;
    }

    public override bool TryInvokeMember(InvokeMemberBinder binder, 
      object[] args, out object result) {
      MethodInfo method = _type.GetMethod(binder.Name, BindingFlags.FlattenHierarchy | 
        BindingFlags.Static | BindingFlags.Public);
      if (method == null) {
        result = null;
        return false;
      }

      result = method.Invoke(null, args);
      return true;
    }
  }
Tuesday, July 26, 2011 1:57:05 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [2] -
.NET | C# | Tipps&Tricks
 Monday, June 20, 2011

ScreenDump_2011-33-20 09 33 42 2080 ScreenDump_2011-35-20 09 35 50 0240 ScreenDump_2011-41-20 09 41 18 5530 ScreenDump_2011-52-29 05 52 34 2830 ScreenDump_2011-52-29 05 52 46 1670

Changes:

  • added: show recorded traces on the map
  • added: continue recorded traces
  • added: calculate distance
  • fixed: GPX files could sometimes not be opened with JOSM
  • fixed: upload to dropbox improved
    but still not possible to use ÄÖÜ in filename
  • updating all old 0.3.0.1 traces to 0.4.0.1 format automatically

more features will follow soon stay tuned …

wp7_152x50_blue

Monday, June 20, 2011 8:34:29 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
OSMLogger
 Monday, May 30, 2011

ScreenDump_2011-26-27 03 26 11 6480

One of my favorite hobbies is OSM mapping. Since some months I own a brand-new Windows Phone 7. Whereas there are different tools for GPS or GPX tracing I did not find what I was looking for in the marketplace. So I decided to write my own tool. OSMLogger is mainly dedicated to the people using their Windows Phone 7 mobiles to record traces for uploading them to OSM. But anyhow you can use OSMLogger where ever you want to record a trace of GPS positions and keep it as GPX file.

Please note that OSMLogger needs a working data connection that all features can be used. Depending on your data plan this might cause additional costs.

Features in version 0.3.0.1:

  • Record GPS Data on your Phone
  • Upload GPS trace as GPX-file to DROP-BOX via context menu
  • A simple tachymeter
  • Traces can be renamed or removed via context menu
  • Traces will be shown on a bing map

    wp7_152x50_blue

  • Monday, May 30, 2011 7:10:32 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
    OSMLogger
     Wednesday, March 09, 2011

    Normally each enumerable in an enum type has an integer value. But sometimes it might be useful to have enums with string values. The following helper Attribute and the extension function will implement one possibility to use enums with string values.


    using System;
    using System.Linq;
    using System.Reflection;
    
    namespace Texxtoor.Utilities {
      #region -= Helper -
    
      public class StringValueAttribute : Attribute {
        public string StringValue { get; protected set; }
        
        public StringValueAttribute(string value) {
          StringValue = value;
        }
    
      }
    
      public static class StringAttributeExtention {
    
        public static string GetStringValue(this Enum value) {
          Type type = value.GetType();
          FieldInfo fieldInfo = type.GetField(value.ToString());
          var attribs = fieldInfo.GetCustomAttributes(typeof(StringValueAttribute), false) as StringValueAttribute[];
          return attribs.Length > 0 ? attribs[0].StringValue : null;
        }
    
        public static T GetValueByString<T>(string str)  {
          T ret = default(T);
          foreach (T item in Enum.GetValues(typeof (T)).Cast<T>().Where(item => (item as Enum).GetStringValue() == str)) {
            ret = item;
          }
          return ret;
        }
      }
      #endregion
    
    }
    


    Usage:


     public enum E1Connector {
        [StringValue("BAL")]
        Balanced = 0,
        [StringValue("UNB")]
        UnBalanced = 1
      }
    
      ...
    
      var x = StringAttributeExtention.GetValueByString<E1Connector>("BAL");
    
      var y = E1Connector.UnBalanced.GetStringValue();
          
    
    Wednesday, March 09, 2011 10:32:23 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
    C# | Tipps&Tricks
     Tuesday, March 08, 2011

    Bei der Portierung eines Tools, welches ich vor einiger Zeit unter Windows XP entwickelt habe, bin ich überraschend auf folgende Fehlermeldung gestoßen.

    System.Net.Sockets.SocketException: Es wurde eine Adresse verwendet, die mit dem angeforderten Protokoll nicht kompatibel ist

    Nach einer genaueren Betrachtung des Problems stellte sich heraus, dass unter Windows XP alles wie gehabt funktioniert, jedoch unter Windows 7 und Windows Server 2008 die lokale IP Adresse nicht mehr wie gewohnt mit

    IPHostEntry ipHostInfo = Dns.GetHostEntry(host);
    IPAddress ipAddress = ipHostInfo.AddressList[0];

    aufgelöst werden konnte. Stattdessen empfiehlt es sich folgende Methode zu verwenden.

    IPHostEntry ipHostInfo = Dns.GetHostEntry(host);
    IPAddress ipAddress = (ipHostInfo.AddressList
    .FirstOrDefault(address => address.AddressFamily != AddressFamily.InterNetworkV6));
    Tuesday, March 08, 2011 11:11:48 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [2] -
    .NET | C# | Tipps&Tricks
    Comerciales
    Archive
    <May 2012>
    SunMonTueWedThuFriSat
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789
    Kontakt
    Live-Chat:
    Disclaimer

    Disclaimer
    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

    Impressum

    © Copyright 2012
    Matthias Fischer
    Sign In

    Statistics
    Total Posts: 54
    This Year: 0
    This Month: 0
    This Week: 0
    Comments: 24
    Themes
    Pick a theme:
    All Content © 2012, Matthias Fischer
    DasBlog theme 'Business' created by Christoph De Baene (delarou)