Thursday, 28 February 2013

[Give Away] HTC One X+

Here is something awesome for Android Revolution HD users. I will give away one, brand new HTC One X+ (GSM only) in color of your choice - black or white, to one winner of this little competition. There is no country limit - it's a worldwide party!

The competition starts at 12:00 PM (GMT + 1) on Monday 4th, March 2013 and will continue until 12:00 PM (GMT + 1) on Sunday 10th, March 2013. Winner will be announced on Monday 11th, March 2013.

What you need to do:

1) "Like" HTC (facebook.com/htc) and Android Revolution HD (facebook.com/AndroidRevolutionHD) on Facebook

2) "Follow" HTC (@HTC) and Android Revolution HD (@mike1986_) on Twitter

3) Tweet about this contest with link to this page using hash-tag "androidrevolutionhd" (#androidrevolutionhd)
Example tweet: Win HTC One X+ at http://android-revolution-hd.blogspot.com/2013/02/give-away-htc-one-x.html #androidrevolutionhd

Note: If you already meet the requirements from points 1 and 2, now all you need to do is tweet! No need to re-follow or re-like accounts mentioned above. Re-tweets doesn't count. This must be your own tweet. Remember to include link to this contest and hash-tag #androidrevolutionhd.

How will I select the winner? I will randomly choose one person from the list of my Twitter followers who tweeted about this give away using #androidrevolutionhd hash-tag. Is that all? Yes! Easy as that! Just 2 clicks and 1 tweet to win amazing, high-end HTC One X+ - Engadget's Smartphone of the Year! 

Good luck!


Want to learn more about HTC One X+?
Visit this site - HTC One X+ overview

Wednesday, 20 February 2013

The only One

Some high quality pictures of new HTC flagship device - the One.

Many people already asked me about the colors of HTC One and which one is better. I was holding both versions side to side and in reality silver one looks better in my opinion. On the pictures, the black one looks very good too, but when holding a silver HTC One you can see how the aluminium zero-gaps body is shining and it looks really gorgeous. Black version doesn't reflect light that much but some potential scratches might be less visible there, which is an advantage. So, which color will you pick? :)








How to build a multi-touch control for Windows Phone

     What I intend for multi-touch? Windows Phone is already a multi-touch device but for some reason (I guess it is legacy of Silverlight) the standard Xaml controls don’t have a real multi-touch behavior. Real multi-touch means that I should be able to interact with two different objects at the same time with multiple fingers. What happens now for the XAML standard controls is that once a control start receiving touch events (ManipulationStarted, ManipulationEnded, ManipulationDelta) all the other controls will not receive touch events. The easiest test to do is add a standard button on the page, put one finger on the screen outside the button and try to press the button with another finger. You will see that the button does not respond to your commands. For Xaml applications this might not be a problem, but for games it becomes one. Xaml (I mean Xaml+C# or XAML+VB.NET) is fast to develop easy games.

The solution would be to build your own control and use Touch.FrameReported to “drive” it. In this sample I will build a multi-touch button. I will call it ButtonEx (some of you remember OpenNETCF J?) and I will just add three events to it: TouchDown, TouchUpInside, TouchUpOutSide (iOs MonoTouch event names). With this three events I should have better control (Click in reality is a TouchUpInside event) .
So I've created a new Windows Phone Class Library called ControlsEx and I added the control ButtonEx derived from ContentControl. I copied the standard style of the Button control (you can easily generate it from a standard button using Blend and Edit Copy command on the Button Template). I've then added the style to the /Themes/generic.xaml file inside our project.  When I create the control I will subscribe Loaded and Unloaded events as I want to start receiving Touch events when the control loads and unsubscribe the Touch events when the control gets unloaded.

  public ButtonEx()  
{
DefaultStyleKey = typeof(ButtonEx);
this.Loaded += ButtonEx_Loaded;
this.Unloaded += ButtonEx_Unloaded;
IsEnabledChanged += ButtonEx_IsEnabledChanged;
IsPressed = false;
}
void ButtonEx_Loaded(object sender, RoutedEventArgs e)
{
Touch.FrameReported += Touch_FrameReported;
}
void ButtonEx_Unloaded(object sender, RoutedEventArgs e)
{
Touch.FrameReported -= Touch_FrameReported;
}

     Now everything we need “happens” inside the Touch_FrameReported  method. For my button I am interested to trace only one finger(using its id) from TouchAction.Down until TouchAction.Up. Once the first finger is down on the surface of my control I memorize the id and track it’s actions till it leaves the screen. Depending of the control that you are building you might have to take in consideration multiple fingers. One thing that is pretty important when starting to track a finger is to see if your control is in front or not (imagine an MessageBox over your controls and when you press the Ok button you will also press the button which is in the back). To resolve this issue I’ve used TouchDevice.DirectlyOver property of the TouchPoint and the VisualTreeHelper to see if the UIElement returned by DirectlyOver is a member of my control or not.
  bool IsControlChild(DependencyObject element)  
{
DependencyObject parent = element;
while ((parent != this) && (parent != null))
parent=VisualTreeHelper.GetParent(parent);
if (parent == this)
return true;
else
return false;
}
Here is the method Touch_FrameReported method:

 void Touch_FrameReported(object sender, TouchFrameEventArgs e)  
{
if (Visibility == Visibility.Collapsed)
return;
TouchPointCollection pointCollection = e.GetTouchPoints(this);
for (int i = 0; i < pointCollection.Count; i++)
{
if (idPointer == -1)
{
if (IsEnabled&&(Visibility==Visibility.Visible) && (pointCollection[i].Action == TouchAction.Down) && IsControlChild(pointCollection[i].TouchDevice.DirectlyOver))
{
//start tracing this finger
idPointer = pointCollection[i].TouchDevice.Id;
IsPressed = true;
VisualStateManager.GoToState(this,"Pressed", true);
if (TouchDown != null)
TouchDown(this, pointCollection[i].Position);
}
}
else if ((pointCollection[i].TouchDevice.Id == idPointer) && (pointCollection[i].Action == TouchAction.Up))
{
idPointer =-1;
IsPressed = false;
UpdateIsEnabledVisualState();
if ((pointCollection[i].Position.X > 0 && pointCollection[i].Position.X < ActualWidth) && (pointCollection[i].Position.Y > 0 && pointCollection[i].Position.Y < ActualHeight))
{
if (TouchUpInside != null)
TouchUpInside(this, pointCollection[i].Position);
}
else
{
if (TouchUpOutside != null)
TouchUpOutside(this, pointCollection[i].Position);
}
}
}
}
    For the button control we don’t have to trace the movements of the finger until Up action but we might need to if we are writing a Slider control for example. The sample application that you will find in the source code uses 2 ButtonEx controls and a standard Button control. The ButtonEx should always respond to your commands (fingers).

    I’ve also used this approach to develop an multi-touch XAML game for flying an Bluetooth BeeWi helicopter. I will also have a session on the 27th February at Community Days here in Italy where I will present a session on developing a game for Windows Phone and I will use this game as a starting point. This application has multi-touch buttons, slider and joystick control.

Also have to thank the TTT (Train The Trainer) program which awarded me a beautiful Sphero for my multi-touch controls.

As always don’t hesitate to contact me if you have further questions.
NAMASTE

Wednesday, 13 February 2013

Android Revolution HD on HTC London Event





On Tuesday, February 19th, 2013 in London there is something big going to happen. We've all heard some rumors and seen leaked pictures, but there is nothing officially confirmed just yet. Our biggest expectation is to see new high-end HTC device called HTC One (HTC M7) running new user interface - HTC Sense 5.0. Maybe there is something more...

Why am I writing all this? Because I will be there, relating on live this great event. From Feb. 18th I'll be in London with HTC, counting down the last minutes to the show beginning. Follow me on Twitter (@mike1986_), watch my Facebook site (http://www.facebook.com/AndroidRevolutionHD) and check out this blog regularly for hot & fresh news, photos and details about upcoming HTC top products!

You can see my photos from that great journey here - http://android-revolution-hd.blogspot.com/p/trip-to-london-for-htc-event-2013.html



Writing to log.nsf via Formula, LotusScript or Java

While debugging @Formula code I was using a lot of @StatusBar command to output values in status bar to debug. But the status bar in Lotus Notes shows only around 20-30 last entries. I was looking for a way to write that information to my local log.nsf where I could see the entire trace and analyse it. That's when I ran into this post on Notes/Domino 8.5 forum. It says that by adding LogStatusBar=1 to your notes.ini all the messages that get printed to status bar will be written to log.nsf. And problem solved!

As this method writes every message printed in status bar to log, it works for any language running on client.

Tuesday, 5 February 2013

Update the HTC Mazaa to Windows Phone 7.8

 HTC Mazaa was the first ever Windows Phone to run the 7.5 build of the OS. It is a really great development device (as performance it is somewhere between the gen 1 devices and the gen 2 devices) but unfortunately it haven't received any updates since the RTM release build 7.10.7720.68. If you still have RTM build on it you will probably see that you are not even able to access the Store anymore. The bad news is that it will not receive any automatic updates but if you want you can still manually update it to the Windows Phone 7.8 version on it.
   To manually update the device you will need :
  1. Zune 4.8 final (build 4.8.2345.0)
  2. Download the WP7_update_tool.rar and install the UpdateWP package for your platform (x86 or x64). This is version 4.8.2134.0. You can download the Update tool from this post
   What you will need to do is simulate the steps that Zune does when it updates your phone. At each step there are a number of cab that you can send to the phone at the same time. BACKUP YOUR PHONE before updating. This tutorial starts the update from the version 7.10.7720.68 up to 7.10.8858.136. If you have a heigher version than 7.10.7720.68 just start from the step of the version you have. We assume that your Mazaa has the following language packs installed (if you have less just remove the corresponding cabs from each step):
  • German (0407)
  • English - United States (0409)
  • French (040C)
  • Italian (0410)
  • English - United Kingdom (0809)
  • Spanish (0C0A)
   At each step just run:
 updatewp /iu [concatenate cab's from step here with space between]

Here are the cabs for each step:

1) 7.10.7720.68-7.10.7740.16

2) 7.10.7740.16-7.10.8107.79


3) 7.10.8107.79-7.10.8112.7

4) 7.10.8112.7-7.10.8773.98


5) 7.10.8773.98-7.10.8779.8 

6) 7.10.8779.8-7.10.8783.12

7) 7.10.8783.12-7.10.8858.136

If you have problems updating please let me know.

BTW I am not responsible if you BRICK your phone :) . Here is mine updated:



NAMASTE

Monday, 4 February 2013

How to use Team Foundation Service with MonoDevelop

  As you probably know Team Foundation Service team announced a few days ago full support for Git protocol. This was AWESOME news for our small company that needed a FREE source control solution for our MonoTouch and Mono for Android projects. We were already using visualstudio.com for our Windows Phone and Windows 8 projects and previously to Git support in TFS we had an in-house svn server but I was not really happy with it. The thing it took me most was to understand what is the Git endpoint address than everything is standard.
  Here is a quick guide on how to create and then use a TFS Git repository with MonoDevelop:
  1. First you need to create a new Team Project with Git support 
     
     Once the project is created press the "Navigate to projec"t button. 

2. Go to Code explorer and you will be able to see the the Git endpoint address. It might not show the git endpoint the first time but if you navigate away and try again you will see it.


3. Use the Git endpoint address to register a new Repository in MonoDevelop



4. Then just publish your solution using the registered repository. You can see all your files in Code Explorer and also all the commits:




Tip: If you want to use a more simple user name than you full live id you can enable your Alternate Credentials on the User Profile page 


The same Git endpoint can be also used to "Connect to a repository" in Xcode for your Obejctive C projects.

Thank you TFS TEAM for this great feature.


NAMASTE

Friday, 1 February 2013

Functions and properties of the XSP object

Stephan Wissel has blogged about some useful functions of XSP obeject. But the list is not complete. So I decided to put the XSP object through my helper JavaScript function listPropsAndFunctions. Below is the list of whatever I could find. I would be updating this list with explanation of whatever properties and functions I am able to find from time to time.

_allowDirtySubmit

_dirty

_dirtyFormId

_eventNameHtmlToWidget

_listeningForDojo

_listeningForDojoOnload

_onLoadListeners

_submitValue

_submitValueSet

Continue reading »