WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.149' for table 'wp_options']
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1715274611.5303740501403808593750', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)


Warning: Cannot modify header information - headers already sent by (output started at /home/lexiqued/www/WordPress/wp-includes/wp-db.php:1502) in /home/lexiqued/www/WordPress/wp-includes/feed-rss2.php on line 8
Windows Phone – Jonathan ANTOINE's thoughts http://www.jonathanantoine.com Yet another blog about... Tue, 12 Apr 2016 08:28:39 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.3 #Windows app bundles and the ‘Subsequent submissions must continue to contain a Windows Phone 8.1 appxbundle’ error message http://www.jonathanantoine.com/2016/04/12/windows-app-bundles-and-the-subsequent-submissions-must-continue-to-contain-a-windows-phone-8-1-appxbundle-error-message/ Tue, 12 Apr 2016 08:28:39 +0000 http://www.jonathanantoine.com/?p=1555 Some days ago when uploading my Windows app to the Store, I’ve got a strange error message : “A previous submission for this app was released with a Windows Phone 8.1 appxbundle. Subsequent submissions must continue to contain a Windows Phone 8.1 appxbundle.”. Here’s how I fixed it !

About appxbundle

When you build an app, you can choose to translate it and add ressource dedicated to a special environments. Images/Logo specific to each pixel density plateau is one example of it. If you create bundles, your final package uploaded on the Store will be one “main” package and satellite package for each “specific target”.

It also means that the user will download only what is necessary to their devices : less bandwith used, smaller apps : happy users !

Creating app’s bundle is easy, in the last step of the Visual Studio package wizard, you choose either “If Necessary” or “Always”.
appbundle

Choosing to use app bundles has some consequences. The one which I was not happy with was that you won’t be able to let the user choose the language of your app since only the languages installed on it’s device will be available.

In my last update of TV Show Tracker, I wanted to let this freedom to my users so I used the wizard and choose to never create a bundle. I uploaded my package to the Store and I then get the previously mentionned error 🙁
error

Creating my own appbundle

The solution is then to create my own app bundle with the SDK tools and upload it to the Store.

Here are the steps :

  1. Create a package using Visual Studio without app’s bundle.
  2. Go to the created package folder and find the appx file (it can be in a subfolder).
  3. Copy this file in a separate folder, all alone.
  4. Use the MakeAppx tool to create a bundle aiming this directory.
  5. Upload the created bundle to the Store.
makeappx bundle /p NameOfTheCreatedBundle.appxbundle /d FolderWithTheAppxInside

The name of the bundle can be anything as the name of the folder with the appx inside.

What did I lost in the process ?

The whole app with all ressources will now be downloaded by my users. This can be frightening : how much more will they have to download ? Let’s take a look inside the app bundle…

zip

So an user on a standard density pixels, english phone will now download the not used “scale-140” assets, the “scale-180” assets and french language : 300 more kb –> 2,85 %. So for 2,85% more package size, my user will be able to choose the language of their app. That’s ok for me 🙂

Happy coding !

]]>
Windows Phone : localize your App name http://www.jonathanantoine.com/2013/12/27/windows-phone-localize-your-app-name/ http://www.jonathanantoine.com/2013/12/27/windows-phone-localize-your-app-name/#comments Fri, 27 Dec 2013 17:27:10 +0000 http://www.jonathanantoine.com/?p=1522 When you build a Windows Phone App, you for sure take some time to translate it in several language. By default there is no easy way to translate the app name but you can do it. Here is a quick “how-to” !

  1. Download this project and add it to your solution : http://code.msdn.microsoft.com/wpapps/Language-Neutral-Resource-5894846e.
  2. Edit the string table in the AppResLib.rc file to set your app name, etc.
  3. Build this project and copy the resulting dll in your WP project. This will be the default values (neutral language)
  4. Change the values in the AppResLib.rc file for a specific language (for example french) and build again the project.
  5. Rename the resulting dll to AppResLib.dll.040c.mui and copy it at the root of the WP project, next to the dll. The “04OC” is specific to “French” and should be set to the value matching the target language. A full list is here : http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx
  6. Do it again for as much language you want
  7. Select all the *.mui files and the AppResLib.dll file and set their build type to content in the properties Windows.
  8. Update your WMAppManifest.xml file and set the app name to this value : @AppResLib.dll,-100 . The value will then be taken for your file, depending of the user language, at the offset 100 in the string table.

reslLib

manifest

Not really obvious but this works fine 🙂

If you want to see this feature in action, it will soon be available in our last app “Say it With Flowers” !

PS: the whole procedure is describe in depth on MSDN but I am sure you love this recap 🙂

PS2: the localized app name won’t be displayed on the Store page because of a bug in the Store : http://blog.webrox.fr/?p=61

]]>
http://www.jonathanantoine.com/2013/12/27/windows-phone-localize-your-app-name/feed/ 2
Miscellaneous : how to receive readable .wav voicemail messages on you Windows Phone http://www.jonathanantoine.com/2013/05/20/miscellaneous-how-to-receive-readable-wav-voice-messages-on-you-windows-phone/ Sun, 19 May 2013 22:00:43 +0000 http://www.jonathanantoine.com/?p=1416 I am a great fan of my Windows Phone and yesterday I found one missing feature. Since I do not have visual voice-mail (because I am using the french operator “Free Mobile“), I wanted to try one of Free great service: send me each voicemail message by mail.

Each time I have a new message, I receive an email with the wav audio file linked: fantastic ! Well in fact, it’s not because my Windows Phone 8 seems not to be able to read this file. Yes… no need to tell me this format created by Microsoft and IBM exists since 1991.

What I wanted to share with you is a free solution, while Microsoft is fixing the issue.

First of all, I don’t seem to be alone with this issue and you can add your votes for a quick fix on this page.

Developer one day, developer everyday : I first tried to create an app and register it for the “wav” files extension but it’s a protected one and so we can not make an app which will be able to read wav files from mail… too bad 🙁

The solution I finally found out is to use the phoneconvert.com service. It’s free, and its usage is simple : forward your email to it and it will respond to you with a Windows Phone 8 compatible version of your wav file.

I hope it will help you too.

]]>
WP Toolkit : Adding a item in the SelectedItems collection of a LongListMultiSelector actually adds 2… http://www.jonathanantoine.com/2013/04/18/wp-toolkit-adding-a-item-in-the-selecteditems-collection-of-a-longlistmultiselector-actually-adds-2/ http://www.jonathanantoine.com/2013/04/18/wp-toolkit-adding-a-item-in-the-selecteditems-collection-of-a-longlistmultiselector-actually-adds-2/#comments Thu, 18 Apr 2013 08:57:28 +0000 http://www.jonathanantoine.com/?p=1392 A quick blog post about a bug I encountered today with the LongListMultiSelector : adding 2 items in its SelectedItem property actually adds 2 items (twice the same) in the SelectedItem collection.

This is quite boring because it also raises the SelectionChanged event twice and can mess up your business logic.

Let’s see how to fix this temporary (I hope!) issue :

The problem is that the LongListMultiSelector listen to the changes(add/remove/replace/clear) in it’s SelectedItem collection so we can’t use it directly.

The solution is to ‘fake’ an user selection using the LongListMultiSelectorItem which is the container of each item.

So instead of writing this code :
[csharp]
foreach (var item in LongListMultiSelector.ItemsSource)
{
//LongListMultiSelector.SelectedItems.Add(item);
}
[/csharp]

you have to write this code :
[csharp]
foreach (var item in LongListMultiSelector.ItemsSource)
{
var container = LongListMultiSelector.ContainerFromItem(item)
as LongListMultiSelectorItem;
if (container != null) container.IsSelected = true;
}
[/csharp]

]]>
http://www.jonathanantoine.com/2013/04/18/wp-toolkit-adding-a-item-in-the-selecteditems-collection-of-a-longlistmultiselector-actually-adds-2/feed/ 3
[WPDev] CustomMessageBox + OnNavigatedTo + Navigate = Exception ! http://www.jonathanantoine.com/2013/04/08/wpdev-custommessagebox-onnavigatedto-navigate-exception/ Mon, 08 Apr 2013 09:27:01 +0000 http://www.jonathanantoine.com/?p=1381 CustomMessageBoxThe Windows Phone Toolkit is really useful.

Yesterday, while I was updating my ConsoTracker app, I met a strange bug using the CustomMessageBox : it was raising a nullReference exception.

Let’s see what was the issue and how to “fix” it.

What I was trying to do was this simple scenario :

  1. Ask the use if he wants to review my app in the OnNavigatedTo event using a CustomMessageBox
  2. If he answers ‘no’, navigate to another page.
  3. If it answers ‘yes’, show the marketplace review task.

As I like playing with tasks, I was using this code :
[csharp]
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
var mBox = new CustomMessageBox
{
Title = "Do you want to… ",
Message = " … click on yes ?",
LeftButtonContent = "Yes",
RightButtonContent = "No"
};
var result = await ShowAsync(mBox);
NavigationService.Navigate(new Uri("/OtherPage.xaml", UriKind.RelativeOrAbsolute));
}

public static async Task<CustomMessageBoxResult> ShowAsync(CustomMessageBox box)
{
var taskCompletionSource = new TaskCompletionSource<CustomMessageBoxResult>();
box.Dismissed += (a, b) => taskCompletionSource.TrySetResult(b.Result);

try { box.Show(); }
catch (Exception exception) { taskCompletionSource.TrySetException(exception); }

return await taskCompletionSource.Task;
}
[/csharp]

This code was throwing an exception. To fix it, I downloaded the source of the Windows Phone Toolkit and I saw that at the end of the dismissal animation, it was trying to access the “Popup” object which was null : BOUM !

So… how did I fix it ? Simply by waiting for the popup to be unloaded instead of using directly the Dismissed event of the CustomMessageBox :
[csharp]
public static async Task<CustomMessageBoxResult> ShowAsync(CustomMessageBox box)
{
var taskCompletionSource = new TaskCompletionSource<CustomMessageBoxResult>();
var result = CustomMessageBoxResult.None;

//Only store the result here.
box.Dismissed += (a, b) => result = b.Result;

//Use this event to set the result.
box.Unloaded += (_, __) => taskCompletionSource.TrySetResult(result);

try { box.Show(); }
catch (Exception exception) { taskCompletionSource.TrySetException(exception); }

return await taskCompletionSource.Task;
}
[/csharp]

I hope it will save you some time too 🙂

]]>
AppHub Tracker : track your wp7 apps from your phone ! http://www.jonathanantoine.com/2012/04/25/apphub-tracker-track-your-wp7-apps-from-your-phone/ http://www.jonathanantoine.com/2012/04/25/apphub-tracker-track-your-wp7-apps-from-your-phone/#comments Wed, 25 Apr 2012 06:45:41 +0000 http://www.jonathanantoine.com/?p=1167 Do you have a lot of windows phone apps ?

Are you always checking the AppHub when you release a new version, wondering if it’s ok to release it ?

Are you always asking yourself “do I have a bug and a bad review” ?

Do you need to know how much is downloaded your app several times a day ?

If yes, you are AppHub addict like me ! Let’s discover an app which will soon be your favorite one !

I am addicted to the AppHub too and I hate to check the AppHub from my Mango’s internet explorer because it’s sloooowwww.

I so decided to create an app which will do the data gathering for me. It’s name is “AppHub Tracker” and it’s already available on all the market place.

All the symptoms above are healed with these features :

  • List all the apps of your AppHub account
  • Display the lifecycle status (approved, approval pending, published) of your apps
  • Display any “warning message” from the AppHub
  • Display the number of downloads of an app
  • Display the reviews of any market place country
  • Display the number of crashes of an app
  • Display (and ready for copy-cut) the deeplink of an app

Try it now !

Did you try it ? Do you need some extra features ? Just tell me in the comments 🙂

And here are some screenshots :

]]>
http://www.jonathanantoine.com/2012/04/25/apphub-tracker-track-your-wp7-apps-from-your-phone/feed/ 3
[WP7] Quick tip : how to set 32 bits per pixel for your app. http://www.jonathanantoine.com/2012/01/08/wp7-quick-tip-how-to-set-32-bits-per-pixel-for-your-app/ http://www.jonathanantoine.com/2012/01/08/wp7-quick-tip-how-to-set-32-bits-per-pixel-for-your-app/#comments Sun, 08 Jan 2012 14:54:59 +0000 http://www.jonathanantoine.com/?p=916 Something new which came with Mango is the ability for the developers to set the number of bits per pixel our app use.

By doing this, your app will have shiny graphics! This increase the color depth and then the gradient are rendered really more smoothly. As expert would say, there is no more banding in your image !

I have found a really great example picture on this web forum to show this :

Forcing your app to use 32 bits per pix is extremly simple to perform trough the WMAppManifest.xml file.

All you have to do is to set the value to 32 using the BitsPerPixel attribute on the App XML element.
Here is an exemple of it in my ConsoTracker WP7 app :
[xml]
<App xmlns="" BitsPerPixel="32" ProductID="{…}" Title="ConsoTracker"
RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal"
Author="Jonathan ANTOINE" Description="Track your usage"
Publisher="ConsoTracker">

</App>
[/xml]

You can find all the possible attributes of the App element on this page : http://msdn.microsoft.com/en-us/library/ff769509(v=vs.92).aspx

Don’t forget to read Peter post on the subject too : http://www.pchenry.com/Home/tabid/36/EntryId/456/Battle-of-the-Bands-with-WP7-and-Image-Banding.aspx.

Thank you Adrien for showing me this tip !

Have fun !

]]>
http://www.jonathanantoine.com/2012/01/08/wp7-quick-tip-how-to-set-32-bits-per-pixel-for-your-app/feed/ 4
WP7 : how to get the version number of my application ? http://www.jonathanantoine.com/2011/11/07/wp7-how-to-get-the-version-number-of-my-application/ http://www.jonathanantoine.com/2011/11/07/wp7-how-to-get-the-version-number-of-my-application/#comments Mon, 07 Nov 2011 10:28:35 +0000 http://www.jonathanantoine.com/?p=787 It’s always a good thing to provide information to the users of your application. One thing which may seem trivial is the version number. In fact it’s a really important information because with it the customers can send you a feedback with enough information to know in which version you have to fix the bug.

In ConsoTracker, the app I build on Windows Phone, I forgot to provide it and users ask met to provide it !

In this post you’ll discover that the classic .Net way does not work and how to retrieve it from your code.

Warning !

Before I give you the code, be aware that the version number you set in your assembly is not read by the MarketPlace. In fact, you provide the information to it in the app submission process.

You do so have to update it in your code as you give the correct version to the market place.

How to do it ?

In .Net you can retrieve the version number of an application from it’s regarding assembly object instance.
[csharp]System.Reflection.Assembly.GetExecutingAssembly().GetName().Version[/csharp]
If you try it on a Windows Phone, you’ll discover that calling the property throw an exception. Also, as pointed out by Thomas in a tweet, it’s security critical which restricts it to internal use by the .NET Framework for Silverlight class library.

That’s too bad because it would have been clean way to retrieve it. Instead you have to read the assembly name and deduce the version number from it.

Here is the helper I use in my application:
[csharp]/// <summary>
/// Retrieve the current version of the executing assembly.
/// This is the one in the AssemblyVersion attribute.
/// </summary>
/// <returns></returns>
public static Version GetCurrentVersion()
{
Version version;

var assembly = Assembly.GetExecutingAssembly().FullName;
var fullVersionNumber = assembly.Split(‘=’)[1].Split(‘,’)[0];

version = new Version(fullVersionNumber);

return version;
}
[/csharp]

Be sure that the version number are synched if you put this code in another assembly. You can do this by sharing a file containing the AssemblyVersion attributes using ‘Add as link’ instead of adding a copy of the file.

Also, as it may represent a performance cost, I recommend you to to call it only once trough a static constructor.

]]>
http://www.jonathanantoine.com/2011/11/07/wp7-how-to-get-the-version-number-of-my-application/feed/ 13
MVVM : De la découverte à la maîtrise – my book is out ! http://www.jonathanantoine.com/2011/09/29/mvvm-de-la-decouverte-a-la-maitrise-my-book-is-out/ http://www.jonathanantoine.com/2011/09/29/mvvm-de-la-decouverte-a-la-maitrise-my-book-is-out/#comments Wed, 28 Sep 2011 23:30:35 +0000 http://www.jonathanantoine.com/?p=594 MVVM is the pattern to know when building WPF, Silverlight, Windows phone and even WinRT (for what I know!) application.

There is already some good books in english which can help the developers to discover and understand it but there were none in French.

This is no more the case because my friend Thomas Lebrun (blog, twitter) and I wrote one entitled “MVVM De la découverte à la maîtrise”.

You can buy it at different places:

  1. A numeric version can be found on our editor page
  2. It is available on Amazon too
  3. The french store, “FNAC” is selling it too !
  4. A printed version can be ordered on lulu

Here is the different things we have covered in it:

  • Présentation du pattern MVVM
  • Les différents éléments et leurs rôles
  • Les différentes philosophies (view-first, model-first, view-model first)
  • Construire la partie modèle
  • Construire un ViewModel
  • Construire les vues
  • Edition de contrôles personnalisés
  • MVVM et Testabilité
  • Glossaire

Feel free to share this post 🙂

An updated, working, version of the source code is available at this adress : http://db.tt/XQfstVbB

Regards,

]]>
http://www.jonathanantoine.com/2011/09/29/mvvm-de-la-decouverte-a-la-maitrise-my-book-is-out/feed/ 11
MANGO live tile: use a picture in the IsolatedStorage as a background for your tile http://www.jonathanantoine.com/2011/08/03/livetileisolatedstoragemango/ http://www.jonathanantoine.com/2011/08/03/livetileisolatedstoragemango/#comments Wed, 03 Aug 2011 23:18:29 +0000 http://lexique-du-net.com/WordPress//?p=1 One on the nice feature coming with WP7’s mango is “live tiles” . You can create tiles directly from your application and update them from a background agent.

Here is the sample which creates a “secondary tile” for your application:

[code language=”csharp”]//This is a .Net class named StandardTileData
var theTile= new StandardTileData
{
Title = "Secondary Tile", //The title
BackgroundImage = new Uri("FrontImage.jpg", UriKind.Relative),
Count = 12, //Notification number
BackTitle = "Back’s page title", //The title of the back page
BackContent = "A text is nice here",
BackBackgroundImage = new Uri("backImage.jpg", UriKind.Relative)
};

// Add the live tile to the Home screen (will exit the app)
ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), theTile);[/code]

Now, you may want to generate a screenshot of your application (using WriteableBitmap) and use it as the tile background. This is possible !

To do so, you have to store the picture in a folder named “Shared/ShellContent” otherwise you will have an NotSupportedException throwned.

The URI to use will then look like this one : “isostore:/Shared/ShellContent/background.png”. You can read this MSDN page  for more information.

It takes me some time and Wilfried   to figure this out, I hope this post will save you the search !

]]>
http://www.jonathanantoine.com/2011/08/03/livetileisolatedstoragemango/feed/ 1