Detect Touch Event of Windows Phone on any screen - windows-phone-7

Since, I am new to Windows Phone technology ,so I want to detect touch event of Windows phone screen that means if I have touched on any screen on Windows Phone not necessary in application only outside of application (like start screen,settings screen) so can I get that touch event or any pixel information regarding that touch.Any help would be greatly appreciated .
Thanks you.

To protect the privacy of the user, there is no way to globally hook all touch events from an application. You can only react to events within your application.
Further, an application cannot access the screen while other applications are active. That would be a significant privacy hole if an application could record the actions of other applications.

Related

Windows phone notification that stays till user checks

I am new to windows phone app dev. I want to know if there is any way to have a notification alive till the user checks it. I found that "toast notification" expires in 10 seconds irrespective of user checks it or not. And there is no way of finding out if a tile notification arrived or not. Is there any workaround? I want to have notifications that are similar to Android notifications which stay till user checks them.
Persistent on-screen notifications on Windows Phone are not possible, by intentional design. It's interesting to see how many users on Android disliked persistent notifications when applications started to interrupt and then disrupt the current foreground application experience.
The design philosophy is that they distract from the user experience and could be easily abused by applications.
The general Microsoft recommendation for the platform would be to use a combination of a notification, Live Tile (reference), and in application UI update.
In Android 4.3, the behavior was changed to highlight applications that were constantly running (interesting reference)
You can use "MessageBox.Show(String)".
Refer below for:
MSDN Doc
Example 1
Example 2

Locking the user screen in Windows store apps for Windows Surface

I am developing an application for Windows Surface RT.I have an requirement to lock the device screen
programmatically(thru c#). I searched MSDN and various form but in vain. Please help me to figure out this requirement.
You can't force the screen to be "locked" from a Windows Store application. It's just not an available API.

Is there an analogue of Windows Phone 'User Idle Detection' in Windows 8?

I've used the following code on Windows Phone 7 and 8 to disable user idle detection when my App is displaying data to the user and they are unlikely to interact with the screen e.g. A recipe App where the screen needs to stay on:
http://msdn.microsoft.com/en-us/library/microsoft.phone.shell.phoneapplicationservice.useridledetectionmode(v=vs.92).aspx
Does anyone know if there is an analogue of this available for Windows 8 applications? My tablet app has the same requirement to disable the screen turning off. I haven't managed to find anything :-(
Many thanks,
Jon
You should use the DisplayRequest class, specifically DisplayRequest.RequestActive for this purpose. You must also remember to call DisplayRequest.RequestRelease once you are done to allow the display to sleep, for example, if you are not viewing a recipe, or you are in a menu screen, etc.

Disable screen capture wp7

I am developing a security related windows phone application. I need to disable/block screen capture for my application.
In Android, we used to set a flag FLAG_SECURE to the window of which we want to block the screen capture. Is there anything similar in wp7 also??
Thanks
You can't do screen captures on Windows Phone unless you use homebrew apps, so I wouldn't worry too much about it.
And even if there were screen capture apps on the marketplace, you would have no way to be safe. Even if you found a way to prevent screen captures, how would you prevent users from taking a picture of the phone with a camera, or sideloading the app on the emulator then making screen captures of the emulator?
There's currently no API available to developers that allows you to perform screen captures with a locked device.
The alternatives are as follows:
Unlock your device and sideload one of the homebrew based screen
capture apps.
Take a picture of the screen itself (Crude but it
would do the job).
Microsoft have stated that they do not intend to change this in the near future (CNET Article)

How to run a WP7 silverlight application after some period of time?

I have an application in WP7 silverlight that needs to be launched after a specific period of time, something like an alarm.
But I want to launch the application itself not WP7's alarm.
I use:
this.Visibility = Visibility.Collapsed;
for hiding the application, I know it is not the correct way for making it run in the background.
Any hint please? Thanks.
The platform specifically does not support running apps in the way you describe.
If your functionality can't run in a background agent then your only options are to use an alarm or toast message (sent as a push notification) to prompt the user to start the app.
One of the design decisions behind the platform is that the user should always know what is going on on the phone so having apps stop and start by themselves would be contrary to this.
You can run a background agent and display a toast notification to the user , and launch the application when the user clicks on the toast.
You can also push toast messages to the device, and rely on the user clicking the toast .

Resources