application

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.

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.