app

Number System Converter

I have stopped developing for Windows Phone – This app is no longer available

 

This is a simple app that performs conversion of numbers between different numbering systems; Binary, Octal, Decimal, Hexadecimal, and Binary-Coded Decimal (BCD). Starting from v1.1, the app supports fraction conversion also with accuracy of up to 12 binary digits.
More systems will be supported in the upcoming versions.
If you would like to suggest a feature for the next version or you have found an issue in the app, contact me on info (at) mohammedalani.com
This app supports Windows phone 7.5 and 8.

Winodws Phone store link:

http://www.windowsphone.com/s?appid=6ede0b59-f2dd-4022-bba2-db0ae14c0aa4

Changlog:

* v1.1: (Expected publishing date: Dec. 12th, 2012)

  • added BCD conversion.
  • added fraction conversion.

* v1.0:

  • published on Dec. 5th, 2012

A Gathering of Small Number Systems Conversions and Operations for WP7

* UPDATE: I have found many bugs and issues with this original code of this library. For an expanded (and working version) you can look at WP7NC.

I know its not too much but I gathered about 16 number-conversion operations and few logical operators in a small DLL for Windows Phone devs who might need it. The functions are:

[crayon lang=”vb”]Public Shared Function Dec2BinStr(ByVal Dec As Long) As String[/crayon]

Converts a decimal number into a binary number in the form of string  (ex: 10 becomes “1010”)

[crayon lang=”vb”]Public Shared Function Dec2BinAry(ByVal Dec As Long) As Integer()[/crayon]

Converts a decimal number into a binary number in the form of an array of ones and zeros.

[crayon lang=”vb”]Public Shared Function BinStr2Dec(ByVal Bin As String) As Long[/crayon]

Converts a binary number in the form of a string into a decimal number.

[crayon lang=”vb”]Public Shared Function BinAry2Dec(ByVal Bin() As Integer) As Long[/crayon]

Converts a binary array into a decimal number.

[crayon lang=”vb”]Public Shared Function HexStr2Dec(ByVal Hex As String) As Long[/crayon]

Converts a hexadecimal number int he form of a string into a decimal number.

[crayon lang=”vb”]Public Shared Function Dec2HexStr(ByVal Dec As Long) As String[/crayon]

Converts decimal number into a hexadecimal number in the form of string.

[crayon lang=”vb”]Public Shared Function HexStr2BinStr(ByVal Hex As String) As String[/crayon]

Converts a hexadecimal number in the form of a string into a binary number, also in the form of string.

[crayon lang=”vb”]Public Function BinStr2HexStr(ByVal Bin As String) As String[/crayon]

Converts a binary number in the form of a string into a hexadecimal number, also in the form of string.

[crayon lang=”vb”]Public Function BinStrAnd(ByVal Bin1 As String, ByVal Bin2 As String) As String[/crayon]

Perform bitwise AND operation between two binary numbers in the form of a string.

[crayon lang=”vb”]Public Function HexStrAnd(ByVal Hex1 As String, ByVal Hex2 As String) As String[/crayon]

Perform bitwise and between two hexadecimal numbers in the form of a string.

[crayon lang=”vb”]Public Function BinStrOr(ByVal Bin1 As String, ByVal Bin2 As String) As String[/crayon]

Perform bitwise OR operation between two binary numbers in the form of a string.

[crayon lang=”vb”]Public Function HexStrOr(ByVal Hex1 As String, ByVal Hex2 As String) As String[/crayon]

Perform bitwise OR operation between two hexadecimal numbers in the form of a string.

[crayon lang=”vb”]Public Function BinStrXOR(ByVal Bin1 As String, ByVal Bin2 As String) As String[/crayon]

Perform bitwise XOR operation between two binary numbers in the form of a string.

[crayon lang=”vb”]Public Function HexStrXOR(ByVal Hex1 As String, ByVal Hex2 As String) As String[/crayon]

Perform bitwise XOR operation between two hexadecimal numbers in the form of a string.

[crayon lang=”vb”]Public Function BinStrNot(ByVal Bin As String) As String[/crayon]

Perform bitwise NOT operation to a binary number in the form of a string.

[crayon lang=”vb”]Public Function HexStrNot(ByVal Bin As String) As String[/crayon]

Perform bitwise NOT operation to a hexadecimal number in the form of a string.

* UPDATE 02-12-2012: I have found out many minor mistakes in some of the conversion function. Thus, I have removed the file and re-written the library as an open-source project. More details can be found here.

Here is the download link:

NumberSystem.DLL v1.0 (10 kbytes)

 

If you have a suggestion to expand this library, please write it down in the comments or tweet it to me, and I’ll try to include it.

How to Handle the User’s Refusal of the License Agreement/Privacy Policy in WP7 Apps

Its a good idea to put the apps privacy policy, or license agreement or whatever you need the user to agree on before using the app, in a separate page and navigate to it in the first run.
There are two scenarios to do this, you either set the privacy policy page as the default and check if the user agreed on it on every run using the IsolatedStorageSetting. If the user did agree, the app navigates to the MainPage. Personally, I do not prefer this way because the privacy page is loaded on every run.
The more feasible scenario is to load the MainPage and during its loading, check if the user have agreed on the policy or not. If not, the app navigates to the policy. Sounds simple, doesnt it? No its not.
What should happen if the user reject the agreement? The app should close itself, right? Sorry, this can not happen in Silverlight apps (its possible in XNA though). There is not single command in Silverlight that gets the app to shutdown.
There is a possible solution to go around this. First of all, we will be using the second scenario where the app’s MainPage is loaded first and after checking the IsolatedStorageSettings, the app navigates to the privacy policy page. If you are not familiar with IsolatedStorageSettings, there is a very simple tutorial that was put together by the good folks at WindowsPhoneGeek.

You can create a setting called “AgreedToPrivacyPolicy” and assign to it a “TRUE” value after the user agrees to it. The main trick here is that on the policy page you should put only one button “I Agree”. Do not put an “I Don’t Agree” button because there is no command to handle it straight forward. To facilitate the use of the IsolatedStorageSettings in the application, identify the settings in the “Partial Public Class MainPage” like this:
[crayon lang=”vb”]Partial Public Class MainPage
Inherits PhoneApplicationPage
Private appSettings As System.IO.IsolatedStorage.IsolatedStorageSettings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings
‘the End Class comes at the end of the app code
[/crayon]
In the MainPage_Loaded sub put the code:
[crayon lang=”vb”]
Private Sub MainPage_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles Me.Loaded
If appSettings.Contains(“AgreedToPrivacyPolicy”) = False Then
NavigationService.Navigate(New Uri(“/PrivacyPolicy.xaml”, UriKind.Relative))
GoTo Jumpiiii ‘Yes I love to use GoTo in VB
End If
If NavigationService.CanGoBack = True Then NavigationService.RemoveBackEntry()
Jumpiiii:
End Sub[/crayon]
Line 6 is very important, and I will explain to you why later on.
After navigating to your privacy policy, the user clicks on I agree and in the button_click sub you add the lines:
[crayon lang=”vb”]
appSettings.Add(“AgreedToPrivacyPolicy”, “True”)
appSettings.Save()
NavigationService.Navigate(New Uri(“/MainPage.xaml”, UriKind.Relative))
[/crayon]
If the user wishes to reject the privacy policy, the user will hit the back button. This would navigate the app to the MainPage and the checking that we added earlier will be invoked again, and again this will navigate the user to the privacy policy page, where it should in fact take the user out of the app. This can be easily achieved by adding the following code to the PrivacyPolicy_Loaded sub:
[crayon lang=”vb”]
Private Sub Page1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles Me.Loaded
NavigationService.RemoveBackEntry()
End Sub[/crayon]
Line 2 here removes the MainPage from the back list such that when the user presses back, the user goes directly out of the app without invoking an exception. This is, in my opinion, the best way to exit and application.
One more thing is the case where the user accepts the agreement and then the app navigates to the MainPage. What happens if the user presses back from there? Will the user be navigated back to the PrivacyPolicy page? The answer is NO. Because we covered that already in line 6 in the first code snippet in this article. We told the MainPage to check if there is a previous page in the Back Stack and if there is, erase it.

Sending Error Reports from Windows Phone 7 Application

Sometimes it impossible to test for ALL possible exceptions. Sometimes you test on a device and it works, and another device gives a certain exception. In most cases, it is useful for the developer to receive error reports from users. This, of course, happens with the user’s will to cooperate by sending an email containing the exception details.

The simple code I put together is in VB (yes I am an antique-collecting dude who just loves VB), prepares an email for the user to be sent to your support email. Sometimes I am really frustrated how almost all WP7 development article give C# codes.

[crayon lang=”vb”]Private Sub Application_UnhandledException(ByVal sender As Object, ByVal e As ApplicationUnhandledExceptionEventArgs) Handles Me.UnhandledException
Dim a As MessageBoxResult
a = MessageBox.Show(“An error has occured, if you like to send a report about that error to the developer to improve the app?”, “Oops”, MessageBoxButton.OKCancel)
If a = MessageBoxResult.Cancel Then GoTo Refuse ‘YES we can use Goto in VB
If a = MessageBoxResult.OK Then
Dim errormessage As String
errormessage = Date.Today.ToString + Key.Enter + e.ExceptionObject.Message.ToString + Key.Enter + e.ExceptionObject.StackTrace
Dim email As New EmailComposeTask
email.To = “support@YOURAPP.com”
email.Body = errormessage
email.Subject = “YOURAPPNAME Anonymous Error Report”
email.Show()
End If
Refuse:
If System.Diagnostics.Debugger.IsAttached Then
‘ An unhandled exception has occurred; break into the debugger
System.Diagnostics.Debugger.Break()
End If
End Sub[/crayon]

this code goes into “App.xaml.vb” to handle all unhandled exceptions by displaying a messagebox to the user asking him/her to send the details of the error to the developer.

You have to put this as the first line in your App.xaml.vb :
[crayon lang=”vb”]Imports Microsoft.Phone.Tasks[/crayon]
Afterwards, you’re good to go.

App: PASSWORDER

I have stopped developing for Windows Phone – This app is no longer available

 

PASSWORDER is a simple powerful application for Windows Phone 7 (WP7). This application generates passwords with very high randomness from CAPITAL LETTERS, small letters, numb3rs and symb()!s.

This application comes in two editions, PASSWORDER FREE (Free) and PASSWORDER PRO (paid).

PASSWORDER FREE PASSWORDER PRO
Current version 1.0 1.0
Features
  • Generate password from all capital letters, small letters, numbers, and passwords.
  • User-controlled password length. (4 to 100)
  • Uses 31 symbols used in MS Windows.
  • High Randomness in password generation.
  • Simple (one-tap) copy-to-clipboard feature to facilitate the use of password in browser or other applications.
  • Ad-supported
  • Generate passwords containing capital letters, small letters, numbers, and passwords.
  • Password Vault, to save all your passwords securely in the same easily-accessible place.
  • Integration of the generator and the vault to facilitate easy saving of generated passwords.
  • The user can control the letters, numbers, and symbols that participate in the password generation.
  • User-controlled password length. (4 to 100)
  • High Randomness in password generation.
  • User can eliminate the symbols that does not fit in his/her password requirements.
  • Simple (one-tap) copy-to-clipboard feature to facilitate the use of password in browser or other applications.
  • No Ads.
Next Version Features Waiting for your suggestions.
Price Free (Ad supported) USD 0.99
Links http://www.windowsphone.com/en-US/apps/dc5ab876-c1d5-4099-bf06-4e67914065f0 http://www.windowsphone.com/en-US/apps/1317802f-5110-47e5-be9d-3c8c18c28cb8

 

If you have any feature suggestions, bugs, anything to say about the apps, please feel free to contact me on info (at) mohammedalani.com

PassworderPro Changelog:

v1.1  Release Date: 10-Feb-2012

* Added the feature of a password vault. The user can save up to 1000 passwords along with descriptions of these passwords. This password vault is protected by a master password.

* Fixed some UI issues.

v1.0 Release Date: 17-Jan-2012

*First Version published.

App: Hijri

Hijri

 Hijri for Windows Phone and Hijri Converter for Windows 8


* If you like Hijri for Windows phone, you might also like Saudi Calendar app (التقويم السعودي).

Hijri is a simple application that performs conversion between Hijri and Gregorian dates. It provides a simple interface to convert Hijri-to-Gregorian and Gregorian-to-Hijri dates.

Hijri (for Windows Phone):

In v1.1 a nice feature was added to the converter. This feature is a live tile that shows you today’s date in Hijri, and updates automatically.

The v1.0 of this application used the online service provided by IslamicFinder.org because of the high accuracy of the conversion on this site. Anyway, starting from v1.1, I have moved the service to my own private server so that the conversion is much faster now.

Starting from version 2.0, the conversion is being done using the open API conversion service provided by www.HijriCal.org. The conversion methods used by the HijriCal.org API are:

1. Um-Alqura Calendar (the official calendar of Saudi Arabia). This calendar provides conversion for Hijri dates from 1350 to 1500 hijri. The dates before or after that are converted using option 2.

2. The Hijri calculation method used by Center of Oriental Studies in Zurich University.

If you spot any bugs, please send me reports. Also if you have any suggestions for features to include in the next version, please feel free to contact me on   info (at) mohammedalani.com

Important Notes Regarding the live tile:

1. If you want to turn off the periodic automatic updating of the live tile, please do it from inside the applications. Do not turn the task off from the phone “Settings” menu as it would cause a conflict with the application settings.

2. If you turn off the auto-update of live tile, the live tile will be updated when you start the application.

3. In case you don’t see the date on the live tile, just wait for a few seconds, the tile will flip and show you the date on the back.

4. If you do not open the application for 14 days, the live tile will stop being updated. This is WP7 restriction, for all periodic tasks.

 

Changelog:

v2.0: (Expected Release date 1-1-2013)

* Move the conversion service to Hijrical.org.

v1.1: (Release date 25-2-2012)

* Added a live tile that shows today’s date in Hijri. This tile updates automatically, and you have the choice to enable and disable the automatic updates.

* Some UI improvements:

-Show number-only keyboard when entering day and year.

-Larger font for the month list.

* Change ads to AdMob

* Added checking for network connectivity to prevent irregular application closing.

 v1.0:

Initial release of application on 26-01-2012.

 

Marketplace Link:

http://www.windowsphone.com/en-US/apps/09c24938-538a-42ae-b9d7-2de8b828ab60

 

Hijri Converter (for Windows 8):

Extra -simple interface with online conversion for highest possible accuracy.

 

Changelog:

v1.0: (Expected Release date 12-12-2012)

* First app release.

 

Windows Store Link:

will be available on release.

 

Privacy Policy:

This application collects anonymous user stats to help improve the service provided. All data collected are anonymous and will be kept securely and not provided to any other entity.

By using this application, you are agree to this privacy policy and to the Terms of Service and Privacy Policy of HijriCal.org as the main conversion service provider.