Visualizzazione post con etichetta hot. Mostra tutti i post
Visualizzazione post con etichetta hot. Mostra tutti i post

lunedì 24 dicembre 2012

myBattery for Windows Phone

MyBattery" is out, and it's free for some days!

Do you want to see your battery level in the live tile or in the lock screen?
NOW YOU CAN.. with the best app for this category!
Just pin the tile and check your battery level.


Features:
  • Modern UI with animations.
  • Battery percentage.
  • Remaining charge time.
  • Charts: from daily to all history.
  • Swap chart color.
  • Choose your images: colored or not.
  • Notifications in the Lock screen.

Windows Phone API limitations:
  • The live tile and the lock screen can be updated approximately every 30 minutes.
  • The live tile and the lock screen can show percentage from 0 to 99.
  • The notification icon in the lock screen can't change.



Check the marketplace now: Download myBattery


QRCode

domenica 2 dicembre 2012

Windows Phone - Battery API

One of the new additions with the Windows Phone SDK 8.0, is the ability to query the battery charge.

Here the simple code:
Battery battery = Battery.GetDefault();
var percentage = battery.RemainingChargePercent;
var remainingTime = battery.RemainingDischargeTime;

And the event:
battery.RemainingChargePercentChanged += (s, args) =>
{
 // your code here
};

Enjoy!

domenica 28 ottobre 2012

Windows Phone - Localization

When you publish a Windows Phone application in the Marketplace, you have more visibility if you support the region language.

An easy way to build a localized app is to use resources file (.resx).

First of all remember to set the default "neutral" language in the project properties! This is an important step because the "AppResources.resx" file is used from all not specified languages.

Add new file, and name it "AppResources.resx" for default language. For a new language, just add a new resource named with the CultureInfo ISO letters:
  • AppResources.it-IT.resx for italian language.
  • AppResources.cs-CZ.resx for czech language.
  • AppResources.fr-FR.resx for french language.
  • etc..
Remember to set all resource files to the public access modifier.



Now unload your project and edit the csproj file to add your supported language:
<SupportedCultures>it-IT;en-US;cs-CZ;fr-FR</SupportedCultures>

Create a class to get your resources.

public class LocalizedStrings
    {
        private static AppResources localizedResources = new AppResources();

        public AppResources Strings
        {
            get
            {
                return localizedResources;
            }
        }
    }

In your xaml you need to declare your class as resource:
<phone:PhoneApplicationPage.Resources>
     <local:LocalizedStrings x:Key="LocalizedStrings"/>
 </phone:PhoneApplicationPage.Resources>

Now you can use your localized string like this:
Text="{Binding Strings.Loading, Source={StaticResource LocalizedStrings}}"
Or from code behind:
txtLoading.Text = AppResources.Loading;

To test your app you can insert this code in application launching event:
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("it-IT");
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("it-IT");

All CultureInfo codes here.

giovedì 13 settembre 2012

Windows Phone - Live Tiles with Telerik

The default Windows Phone framework offers a simple template for tiles:
  • Static background image from application or from url.
  • Title.
  • Number (top right).
  • A back message.

With Telerik RadControl for Windows Phone you have more power in your hands!


myWeather

"LiveTileHelper" class helps you to create dynamic live tiles with your own design and your own content.

The "RadExtendedTileData" extends the standard tile data with two properties VisualElement and BackVisualElement.
Now the amazing thing: this properties accept UIElement. Yes, UIElement!!

Now let's code...
LiveTileHelper.CreateOrUpdateTile( 
 new RadExtendedTileData() 
 { 
  Title = "My front title",
  VisualElement = new MyUserControl(),
  BackTitle = "My back title" 
  BackContent = "My back message", 
  BackVisualElement = new MyUserControl2(), 
 }, 
 new Uri("/MainPage.xaml?param=myparam", UriKind.RelativeOrAbsolute)
);

You can customize MyUserControl and MyUserControl2 as you want, the only limit is your imagination.

Then, why should you use this controls?
  • Easyness
  • More features
  • Time saver
  • Support and help

And remember this: a good app, has a good live tile.